/**
 * This file was auto-generated from an OpenAPI spec.
 */

import {
  aiFunction,
  AIFunctionsProvider,
  pick,
  sanitizeSearchParams
} from '@agentic/core'
import defaultKy, { type KyInstance } from 'ky'

import { github } from './github'

/**
 * Agentic Github client.
 *
 * GitHub's v3 REST API.
 */
export class GithubClient extends AIFunctionsProvider {
  protected readonly ky: KyInstance

  protected readonly apiBaseUrl: string

  constructor({
    apiBaseUrl = github.apiBaseUrl,
    ky = defaultKy
  }: {
    apiKey?: string
    apiBaseUrl?: string
    ky?: KyInstance
  } = {}) {
    super()

    this.apiBaseUrl = apiBaseUrl

    this.ky = ky.extend({
      prefixUrl: apiBaseUrl
    })
  }

  /**
   * Get Hypermedia links to resources accessible in GitHub's REST API.
   */
  @aiFunction({
    name: 'github_meta_root',
    description: `Get Hypermedia links to resources accessible in GitHub's REST API.`,
    inputSchema: github.MetaRootParamsSchema,
    tags: ['meta']
  })
  async metaRoot(
    _params: github.MetaRootParams
  ): Promise<github.MetaRootResponse> {
    return this.ky.get('/').json<github.MetaRootResponse>()
  }

  /**
 * Lists all global security advisories that match the specified parameters. If no other parameters are defined, the request will return only GitHub-reviewed advisories that are not malware.

By default, all responses will exclude advisories for malware, because malware are not standard vulnerabilities. To list advisories for malware, you must include the `type` parameter in your request, with the value `malware`. For more information about the different types of security advisories, see "[About the GitHub Advisory database](https://docs.github.com/code-security/security-advisories/global-security-advisories/about-the-github-advisory-database#about-types-of-security-advisories).".
 */
  @aiFunction({
    name: 'github_security_advisories_list_global_advisories',
    description: `Lists all global security advisories that match the specified parameters. If no other parameters are defined, the request will return only GitHub-reviewed advisories that are not malware.

By default, all responses will exclude advisories for malware, because malware are not standard vulnerabilities. To list advisories for malware, you must include the \`type\` parameter in your request, with the value \`malware\`. For more information about the different types of security advisories, see "[About the GitHub Advisory database](https://docs.github.com/code-security/security-advisories/global-security-advisories/about-the-github-advisory-database#about-types-of-security-advisories).".`,
    inputSchema: github.SecurityAdvisoriesListGlobalAdvisoriesParamsSchema,
    tags: ['security-advisories']
  })
  async securityAdvisoriesListGlobalAdvisories(
    params: github.SecurityAdvisoriesListGlobalAdvisoriesParams
  ): Promise<github.SecurityAdvisoriesListGlobalAdvisoriesResponse> {
    return this.ky
      .get('/advisories', {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'ghsa_id',
            'type',
            'cve_id',
            'ecosystem',
            'severity',
            'cwes',
            'is_withdrawn',
            'affects',
            'published',
            'updated',
            'modified',
            'epss_percentage',
            'epss_percentile',
            'before',
            'after',
            'direction',
            'per_page',
            'sort'
          )
        )
      })
      .json<github.SecurityAdvisoriesListGlobalAdvisoriesResponse>()
  }

  /**
   * Gets a global security advisory using its GitHub Security Advisory (GHSA) identifier.
   */
  @aiFunction({
    name: 'github_security_advisories_get_global_advisory',
    description: `Gets a global security advisory using its GitHub Security Advisory (GHSA) identifier.`,
    inputSchema: github.SecurityAdvisoriesGetGlobalAdvisoryParamsSchema,
    tags: ['security-advisories']
  })
  async securityAdvisoriesGetGlobalAdvisory(
    params: github.SecurityAdvisoriesGetGlobalAdvisoryParams
  ): Promise<github.SecurityAdvisoriesGetGlobalAdvisoryResponse> {
    return this.ky
      .get(`/advisories/${params.ghsa_id}`)
      .json<github.SecurityAdvisoriesGetGlobalAdvisoryResponse>()
  }

  /**
 * Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app)" endpoint.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_get_authenticated',
    description: `Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the \`installations_count\` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app)" endpoint.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.`,
    inputSchema: github.AppsGetAuthenticatedParamsSchema,
    tags: ['apps']
  })
  async appsGetAuthenticated(
    _params: github.AppsGetAuthenticatedParams
  ): Promise<github.AppsGetAuthenticatedResponse> {
    return this.ky.get('/app').json<github.AppsGetAuthenticatedResponse>()
  }

  /**
   * Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`.
   */
  @aiFunction({
    name: 'github_apps_create_from_manifest',
    description: `Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary \`code\` used to retrieve the GitHub App's \`id\`, \`pem\` (private key), and \`webhook_secret\`.`,
    inputSchema: github.AppsCreateFromManifestParamsSchema,
    tags: ['apps']
  })
  async appsCreateFromManifest(
    params: github.AppsCreateFromManifestParams
  ): Promise<github.AppsCreateFromManifestResponse> {
    return this.ky
      .post(`/app-manifests/${params.code}/conversions`)
      .json<github.AppsCreateFromManifestResponse>()
  }

  /**
 * Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)."

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_get_webhook_config_for_app',
    description: `Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)."

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.`,
    inputSchema: github.AppsGetWebhookConfigForAppParamsSchema,
    tags: ['apps']
  })
  async appsGetWebhookConfigForApp(
    _params: github.AppsGetWebhookConfigForAppParams
  ): Promise<github.AppsGetWebhookConfigForAppResponse> {
    return this.ky
      .get('/app/hook/config')
      .json<github.AppsGetWebhookConfigForAppResponse>()
  }

  /**
 * Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)."

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_update_webhook_config_for_app',
    description: `Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)."

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.`,
    inputSchema: github.AppsUpdateWebhookConfigForAppParamsSchema,
    tags: ['apps']
  })
  async appsUpdateWebhookConfigForApp(
    params: github.AppsUpdateWebhookConfigForAppParams
  ): Promise<github.AppsUpdateWebhookConfigForAppResponse> {
    return this.ky
      .patch('/app/hook/config', {
        json: pick(params, 'url', 'content_type', 'secret', 'insecure_ssl')
      })
      .json<github.AppsUpdateWebhookConfigForAppResponse>()
  }

  /**
 * Returns a list of webhook deliveries for the webhook configured for a GitHub App.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_list_webhook_deliveries',
    description: `Returns a list of webhook deliveries for the webhook configured for a GitHub App.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.`,
    inputSchema: github.AppsListWebhookDeliveriesParamsSchema,
    tags: ['apps']
  })
  async appsListWebhookDeliveries(
    params: github.AppsListWebhookDeliveriesParams
  ): Promise<github.AppsListWebhookDeliveriesResponse> {
    return this.ky
      .get('/app/hook/deliveries', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'cursor'))
      })
      .json<github.AppsListWebhookDeliveriesResponse>()
  }

  /**
 * Returns a delivery for the webhook configured for a GitHub App.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_get_webhook_delivery',
    description: `Returns a delivery for the webhook configured for a GitHub App.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.`,
    inputSchema: github.AppsGetWebhookDeliveryParamsSchema,
    tags: ['apps']
  })
  async appsGetWebhookDelivery(
    params: github.AppsGetWebhookDeliveryParams
  ): Promise<github.AppsGetWebhookDeliveryResponse> {
    return this.ky
      .get(`/app/hook/deliveries/${params.delivery_id}`)
      .json<github.AppsGetWebhookDeliveryResponse>()
  }

  /**
 * Redeliver a delivery for the webhook configured for a GitHub App.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_redeliver_webhook_delivery',
    description: `Redeliver a delivery for the webhook configured for a GitHub App.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.`,
    inputSchema: github.AppsRedeliverWebhookDeliveryParamsSchema,
    tags: ['apps']
  })
  async appsRedeliverWebhookDelivery(
    params: github.AppsRedeliverWebhookDeliveryParams
  ): Promise<github.AppsRedeliverWebhookDeliveryResponse> {
    return this.ky
      .post(`/app/hook/deliveries/${params.delivery_id}/attempts`)
      .json<github.AppsRedeliverWebhookDeliveryResponse>()
  }

  /**
   * Lists all the pending installation requests for the authenticated GitHub App.
   */
  @aiFunction({
    name: 'github_apps_list_installation_requests_for_authenticated_app',
    description: `Lists all the pending installation requests for the authenticated GitHub App.`,
    inputSchema:
      github.AppsListInstallationRequestsForAuthenticatedAppParamsSchema,
    tags: ['apps']
  })
  async appsListInstallationRequestsForAuthenticatedApp(
    params: github.AppsListInstallationRequestsForAuthenticatedAppParams
  ): Promise<github.AppsListInstallationRequestsForAuthenticatedAppResponse> {
    return this.ky
      .get('/app/installation-requests', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.AppsListInstallationRequestsForAuthenticatedAppResponse>()
  }

  /**
 * The permissions the installation has are included under the `permissions` key.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_list_installations',
    description: `The permissions the installation has are included under the \`permissions\` key.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.`,
    inputSchema: github.AppsListInstallationsParamsSchema,
    tags: ['apps']
  })
  async appsListInstallations(
    params: github.AppsListInstallationsParams
  ): Promise<github.AppsListInstallationsResponse> {
    return this.ky
      .get('/app/installations', {
        searchParams: sanitizeSearchParams(
          pick(params, 'per_page', 'page', 'since', 'outdated')
        )
      })
      .json<github.AppsListInstallationsResponse>()
  }

  /**
 * Enables an authenticated GitHub App to find an installation's information using the installation id.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_get_installation',
    description: `Enables an authenticated GitHub App to find an installation's information using the installation id.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.`,
    inputSchema: github.AppsGetInstallationParamsSchema,
    tags: ['apps']
  })
  async appsGetInstallation(
    params: github.AppsGetInstallationParams
  ): Promise<github.AppsGetInstallationResponse> {
    return this.ky
      .get(`/app/installations/${params.installation_id}`)
      .json<github.AppsGetInstallationResponse>()
  }

  /**
 * Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_delete_installation',
    description: `Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.`,
    inputSchema: github.AppsDeleteInstallationParamsSchema,
    tags: ['apps']
  })
  async appsDeleteInstallation(
    params: github.AppsDeleteInstallationParams
  ): Promise<github.AppsDeleteInstallationResponse> {
    return this.ky
      .delete(`/app/installations/${params.installation_id}`)
      .json<github.AppsDeleteInstallationResponse>()
  }

  /**
 * Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access.

Optionally, you can use the `repositories` or `repository_ids` body parameters to specify individual repositories that the installation access token can access. If you don't use `repositories` or `repository_ids` to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. Up to 500 repositories can be listed in this manner.

Optionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_create_installation_access_token',
    description: `Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of \`401 - Unauthorized\`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access.

Optionally, you can use the \`repositories\` or \`repository_ids\` body parameters to specify individual repositories that the installation access token can access. If you don't use \`repositories\` or \`repository_ids\` to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. Up to 500 repositories can be listed in this manner.

Optionally, use the \`permissions\` body parameter to specify the permissions that the installation access token should have. If \`permissions\` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.`,
    inputSchema: github.AppsCreateInstallationAccessTokenParamsSchema,
    tags: ['apps']
  })
  async appsCreateInstallationAccessToken(
    params: github.AppsCreateInstallationAccessTokenParams
  ): Promise<github.AppsCreateInstallationAccessTokenResponse> {
    return this.ky
      .post(`/app/installations/${params.installation_id}/access_tokens`, {
        json: pick(params, 'repositories', 'repository_ids', 'permissions')
      })
      .json<github.AppsCreateInstallationAccessTokenResponse>()
  }

  /**
 * Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_suspend_installation',
    description: `Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.`,
    inputSchema: github.AppsSuspendInstallationParamsSchema,
    tags: ['apps']
  })
  async appsSuspendInstallation(
    params: github.AppsSuspendInstallationParams
  ): Promise<github.AppsSuspendInstallationResponse> {
    return this.ky
      .put(`/app/installations/${params.installation_id}/suspended`)
      .json<github.AppsSuspendInstallationResponse>()
  }

  /**
 * Removes a GitHub App installation suspension.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_unsuspend_installation',
    description: `Removes a GitHub App installation suspension.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.`,
    inputSchema: github.AppsUnsuspendInstallationParamsSchema,
    tags: ['apps']
  })
  async appsUnsuspendInstallation(
    params: github.AppsUnsuspendInstallationParams
  ): Promise<github.AppsUnsuspendInstallationResponse> {
    return this.ky
      .delete(`/app/installations/${params.installation_id}/suspended`)
      .json<github.AppsUnsuspendInstallationResponse>()
  }

  /**
 * OAuth and GitHub application owners can revoke a grant for their application and a specific user. You must provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted.
Deleting an application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized).
 */
  @aiFunction({
    name: 'github_apps_delete_authorization',
    description: `OAuth and GitHub application owners can revoke a grant for their application and a specific user. You must provide a valid OAuth \`access_token\` as an input parameter and the grant for the token's owner will be deleted.
Deleting an application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized).`,
    inputSchema: github.AppsDeleteAuthorizationParamsSchema,
    tags: ['apps']
  })
  async appsDeleteAuthorization(
    params: github.AppsDeleteAuthorizationParams
  ): Promise<github.AppsDeleteAuthorizationResponse> {
    return this.ky
      .delete(`/applications/${params.client_id}/grant`, {
        json: pick(params, 'access_token')
      })
      .json<github.AppsDeleteAuthorizationResponse>()
  }

  /**
   * OAuth applications and GitHub applications with OAuth authorizations can use this API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. Invalid tokens will return `404 NOT FOUND`.
   */
  @aiFunction({
    name: 'github_apps_check_token',
    description: `OAuth applications and GitHub applications with OAuth authorizations can use this API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. Invalid tokens will return \`404 NOT FOUND\`.`,
    inputSchema: github.AppsCheckTokenParamsSchema,
    tags: ['apps']
  })
  async appsCheckToken(
    params: github.AppsCheckTokenParams
  ): Promise<github.AppsCheckTokenResponse> {
    return this.ky
      .post(`/applications/${params.client_id}/token`, {
        json: pick(params, 'access_token')
      })
      .json<github.AppsCheckTokenResponse>()
  }

  /**
   * OAuth  or GitHub application owners can revoke a single token for an OAuth application or a GitHub application with an OAuth authorization.
   */
  @aiFunction({
    name: 'github_apps_delete_token',
    description: `OAuth  or GitHub application owners can revoke a single token for an OAuth application or a GitHub application with an OAuth authorization.`,
    inputSchema: github.AppsDeleteTokenParamsSchema,
    tags: ['apps']
  })
  async appsDeleteToken(
    params: github.AppsDeleteTokenParams
  ): Promise<github.AppsDeleteTokenResponse> {
    return this.ky
      .delete(`/applications/${params.client_id}/token`, {
        json: pick(params, 'access_token')
      })
      .json<github.AppsDeleteTokenResponse>()
  }

  /**
   * OAuth applications and GitHub applications with OAuth authorizations can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. Invalid tokens will return `404 NOT FOUND`.
   */
  @aiFunction({
    name: 'github_apps_reset_token',
    description: `OAuth applications and GitHub applications with OAuth authorizations can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. Invalid tokens will return \`404 NOT FOUND\`.`,
    inputSchema: github.AppsResetTokenParamsSchema,
    tags: ['apps']
  })
  async appsResetToken(
    params: github.AppsResetTokenParams
  ): Promise<github.AppsResetTokenResponse> {
    return this.ky
      .patch(`/applications/${params.client_id}/token`, {
        json: pick(params, 'access_token')
      })
      .json<github.AppsResetTokenResponse>()
  }

  /**
 * Use a non-scoped user access token to create a repository-scoped and/or permission-scoped user access token. You can specify
which repositories the token can access and which permissions are granted to the
token.

Invalid tokens will return `404 NOT FOUND`.
 */
  @aiFunction({
    name: 'github_apps_scope_token',
    description: `Use a non-scoped user access token to create a repository-scoped and/or permission-scoped user access token. You can specify
which repositories the token can access and which permissions are granted to the
token.

Invalid tokens will return \`404 NOT FOUND\`.`,
    inputSchema: github.AppsScopeTokenParamsSchema,
    tags: ['apps']
  })
  async appsScopeToken(
    params: github.AppsScopeTokenParams
  ): Promise<github.AppsScopeTokenResponse> {
    return this.ky
      .post(`/applications/${params.client_id}/token/scoped`, {
        json: pick(
          params,
          'access_token',
          'target',
          'target_id',
          'repositories',
          'repository_ids',
          'permissions'
        )
      })
      .json<github.AppsScopeTokenResponse>()
  }

  /**
 * > [!NOTE]
> The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`).
 */
  @aiFunction({
    name: 'github_apps_get_by_slug',
    description: `> [!NOTE]
> The \`:app_slug\` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., \`https://github.com/settings/apps/:app_slug\`).`,
    inputSchema: github.AppsGetBySlugParamsSchema,
    tags: ['apps']
  })
  async appsGetBySlug(
    params: github.AppsGetBySlugParams
  ): Promise<github.AppsGetBySlugResponse> {
    return this.ky
      .get(`/apps/${params.app_slug}`)
      .json<github.AppsGetBySlugResponse>()
  }

  /**
   * Gets a GitHub Classroom assignment. Assignment will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.
   */
  @aiFunction({
    name: 'github_classroom_get_an_assignment',
    description: `Gets a GitHub Classroom assignment. Assignment will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.`,
    inputSchema: github.ClassroomGetAnAssignmentParamsSchema,
    tags: ['classroom']
  })
  async classroomGetAnAssignment(
    params: github.ClassroomGetAnAssignmentParams
  ): Promise<github.ClassroomGetAnAssignmentResponse> {
    return this.ky
      .get(`/assignments/${params.assignment_id}`)
      .json<github.ClassroomGetAnAssignmentResponse>()
  }

  /**
   * Lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.
   */
  @aiFunction({
    name: 'github_classroom_list_accepted_assignments_for_an_assignment',
    description: `Lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.`,
    inputSchema:
      github.ClassroomListAcceptedAssignmentsForAnAssignmentParamsSchema,
    tags: ['classroom']
  })
  async classroomListAcceptedAssignmentsForAnAssignment(
    params: github.ClassroomListAcceptedAssignmentsForAnAssignmentParams
  ): Promise<github.ClassroomListAcceptedAssignmentsForAnAssignmentResponse> {
    return this.ky
      .get(`/assignments/${params.assignment_id}/accepted_assignments`, {
        searchParams: sanitizeSearchParams(pick(params, 'page', 'per_page'))
      })
      .json<github.ClassroomListAcceptedAssignmentsForAnAssignmentResponse>()
  }

  /**
   * Gets grades for a GitHub Classroom assignment. Grades will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.
   */
  @aiFunction({
    name: 'github_classroom_get_assignment_grades',
    description: `Gets grades for a GitHub Classroom assignment. Grades will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.`,
    inputSchema: github.ClassroomGetAssignmentGradesParamsSchema,
    tags: ['classroom']
  })
  async classroomGetAssignmentGrades(
    params: github.ClassroomGetAssignmentGradesParams
  ): Promise<github.ClassroomGetAssignmentGradesResponse> {
    return this.ky
      .get(`/assignments/${params.assignment_id}/grades`)
      .json<github.ClassroomGetAssignmentGradesResponse>()
  }

  /**
   * Lists GitHub Classroom classrooms for the current user. Classrooms will only be returned if the current user is an administrator of one or more GitHub Classrooms.
   */
  @aiFunction({
    name: 'github_classroom_list_classrooms',
    description: `Lists GitHub Classroom classrooms for the current user. Classrooms will only be returned if the current user is an administrator of one or more GitHub Classrooms.`,
    inputSchema: github.ClassroomListClassroomsParamsSchema,
    tags: ['classroom']
  })
  async classroomListClassrooms(
    params: github.ClassroomListClassroomsParams
  ): Promise<github.ClassroomListClassroomsResponse> {
    return this.ky
      .get('/classrooms', {
        searchParams: sanitizeSearchParams(pick(params, 'page', 'per_page'))
      })
      .json<github.ClassroomListClassroomsResponse>()
  }

  /**
   * Gets a GitHub Classroom classroom for the current user. Classroom will only be returned if the current user is an administrator of the GitHub Classroom.
   */
  @aiFunction({
    name: 'github_classroom_get_a_classroom',
    description: `Gets a GitHub Classroom classroom for the current user. Classroom will only be returned if the current user is an administrator of the GitHub Classroom.`,
    inputSchema: github.ClassroomGetAclassroomParamsSchema,
    tags: ['classroom']
  })
  async classroomGetAClassroom(
    params: github.ClassroomGetAclassroomParams
  ): Promise<github.ClassroomGetAclassroomResponse> {
    return this.ky
      .get(`/classrooms/${params.classroom_id}`)
      .json<github.ClassroomGetAclassroomResponse>()
  }

  /**
   * Lists GitHub Classroom assignments for a classroom. Assignments will only be returned if the current user is an administrator of the GitHub Classroom.
   */
  @aiFunction({
    name: 'github_classroom_list_assignments_for_a_classroom',
    description: `Lists GitHub Classroom assignments for a classroom. Assignments will only be returned if the current user is an administrator of the GitHub Classroom.`,
    inputSchema: github.ClassroomListAssignmentsForAclassroomParamsSchema,
    tags: ['classroom']
  })
  async classroomListAssignmentsForAClassroom(
    params: github.ClassroomListAssignmentsForAclassroomParams
  ): Promise<github.ClassroomListAssignmentsForAclassroomResponse> {
    return this.ky
      .get(`/classrooms/${params.classroom_id}/assignments`, {
        searchParams: sanitizeSearchParams(pick(params, 'page', 'per_page'))
      })
      .json<github.ClassroomListAssignmentsForAclassroomResponse>()
  }

  /**
   * Returns array of all GitHub's codes of conduct.
   */
  @aiFunction({
    name: 'github_codes_of_conduct_get_all_codes_of_conduct',
    description: `Returns array of all GitHub's codes of conduct.`,
    inputSchema: github.CodesOfConductGetAllCodesOfConductParamsSchema,
    tags: ['codes-of-conduct']
  })
  async codesOfConductGetAllCodesOfConduct(
    _params: github.CodesOfConductGetAllCodesOfConductParams
  ): Promise<github.CodesOfConductGetAllCodesOfConductResponse> {
    return this.ky
      .get('/codes_of_conduct')
      .json<github.CodesOfConductGetAllCodesOfConductResponse>()
  }

  /**
   * Returns information about the specified GitHub code of conduct.
   */
  @aiFunction({
    name: 'github_codes_of_conduct_get_conduct_code',
    description: `Returns information about the specified GitHub code of conduct.`,
    inputSchema: github.CodesOfConductGetConductCodeParamsSchema,
    tags: ['codes-of-conduct']
  })
  async codesOfConductGetConductCode(
    params: github.CodesOfConductGetConductCodeParams
  ): Promise<github.CodesOfConductGetConductCodeResponse> {
    return this.ky
      .get(`/codes_of_conduct/${params.key}`)
      .json<github.CodesOfConductGetConductCodeResponse>()
  }

  /**
   * Lists all the emojis available to use on GitHub.
   */
  @aiFunction({
    name: 'github_emojis_get',
    description: `Lists all the emojis available to use on GitHub.`,
    inputSchema: github.EmojisGetParamsSchema,
    tags: ['emojis']
  })
  async emojisGet(
    _params: github.EmojisGetParams
  ): Promise<github.EmojisGetResponse> {
    return this.ky.get('/emojis').json<github.EmojisGetResponse>()
  }

  /**
 * Lists all code security configurations available in an enterprise.

The authenticated user must be an administrator of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_get_configurations_for_enterprise',
    description: `Lists all code security configurations available in an enterprise.

The authenticated user must be an administrator of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`read:enterprise\` scope to use this endpoint.`,
    inputSchema: github.CodeSecurityGetConfigurationsForEnterpriseParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityGetConfigurationsForEnterprise(
    params: github.CodeSecurityGetConfigurationsForEnterpriseParams
  ): Promise<github.CodeSecurityGetConfigurationsForEnterpriseResponse> {
    return this.ky
      .get(
        `/enterprises/${params.enterprise}/code-security/configurations`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'per_page', 'before', 'after')
          )
        }
      )
      .json<github.CodeSecurityGetConfigurationsForEnterpriseResponse>()
  }

  /**
 * Creates a code security configuration in an enterprise.

The authenticated user must be an administrator of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_create_configuration_for_enterprise',
    description: `Creates a code security configuration in an enterprise.

The authenticated user must be an administrator of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:enterprise\` scope to use this endpoint.`,
    inputSchema:
      github.CodeSecurityCreateConfigurationForEnterpriseParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityCreateConfigurationForEnterprise(
    params: github.CodeSecurityCreateConfigurationForEnterpriseParams
  ): Promise<github.CodeSecurityCreateConfigurationForEnterpriseResponse> {
    return this.ky
      .post(
        `/enterprises/${params.enterprise}/code-security/configurations`,
        {
          json: pick(
            params,
            'name',
            'description',
            'advanced_security',
            'dependency_graph',
            'dependency_graph_autosubmit_action',
            'dependency_graph_autosubmit_action_options',
            'dependabot_alerts',
            'dependabot_security_updates',
            'code_scanning_default_setup',
            'code_scanning_default_setup_options',
            'code_scanning_delegated_alert_dismissal',
            'secret_scanning',
            'secret_scanning_push_protection',
            'secret_scanning_validity_checks',
            'secret_scanning_non_provider_patterns',
            'secret_scanning_generic_secrets',
            'secret_scanning_delegated_alert_dismissal',
            'private_vulnerability_reporting',
            'enforcement'
          )
        }
      )
      .json<github.CodeSecurityCreateConfigurationForEnterpriseResponse>()
  }

  /**
 * Lists the default code security configurations for an enterprise.

The authenticated user must be an administrator of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_get_default_configurations_for_enterprise',
    description: `Lists the default code security configurations for an enterprise.

The authenticated user must be an administrator of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`read:enterprise\` scope to use this endpoint.`,
    inputSchema:
      github.CodeSecurityGetDefaultConfigurationsForEnterpriseParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityGetDefaultConfigurationsForEnterprise(
    params: github.CodeSecurityGetDefaultConfigurationsForEnterpriseParams
  ): Promise<github.CodeSecurityGetDefaultConfigurationsForEnterpriseResponse> {
    return this.ky
      .get(
        `/enterprises/${params.enterprise}/code-security/configurations/defaults`
      )
      .json<github.CodeSecurityGetDefaultConfigurationsForEnterpriseResponse>()
  }

  /**
 * Gets a code security configuration available in an enterprise.

The authenticated user must be an administrator of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_get_single_configuration_for_enterprise',
    description: `Gets a code security configuration available in an enterprise.

The authenticated user must be an administrator of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`read:enterprise\` scope to use this endpoint.`,
    inputSchema:
      github.CodeSecurityGetSingleConfigurationForEnterpriseParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityGetSingleConfigurationForEnterprise(
    params: github.CodeSecurityGetSingleConfigurationForEnterpriseParams
  ): Promise<github.CodeSecurityGetSingleConfigurationForEnterpriseResponse> {
    return this.ky
      .get(
        `/enterprises/${params.enterprise}/code-security/configurations/${params.configuration_id}`,
        {}
      )
      .json<github.CodeSecurityGetSingleConfigurationForEnterpriseResponse>()
  }

  /**
 * Deletes a code security configuration from an enterprise.
Repositories attached to the configuration will retain their settings but will no longer be associated with
the configuration.

The authenticated user must be an administrator for the enterprise to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_delete_configuration_for_enterprise',
    description: `Deletes a code security configuration from an enterprise.
Repositories attached to the configuration will retain their settings but will no longer be associated with
the configuration.

The authenticated user must be an administrator for the enterprise to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:enterprise\` scope to use this endpoint.`,
    inputSchema:
      github.CodeSecurityDeleteConfigurationForEnterpriseParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityDeleteConfigurationForEnterprise(
    params: github.CodeSecurityDeleteConfigurationForEnterpriseParams
  ): Promise<github.CodeSecurityDeleteConfigurationForEnterpriseResponse> {
    return this.ky
      .delete(
        `/enterprises/${params.enterprise}/code-security/configurations/${params.configuration_id}`,
        {}
      )
      .json<github.CodeSecurityDeleteConfigurationForEnterpriseResponse>()
  }

  /**
 * Updates a code security configuration in an enterprise.

The authenticated user must be an administrator of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_update_enterprise_configuration',
    description: `Updates a code security configuration in an enterprise.

The authenticated user must be an administrator of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:enterprise\` scope to use this endpoint.`,
    inputSchema: github.CodeSecurityUpdateEnterpriseConfigurationParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityUpdateEnterpriseConfiguration(
    params: github.CodeSecurityUpdateEnterpriseConfigurationParams
  ): Promise<github.CodeSecurityUpdateEnterpriseConfigurationResponse> {
    return this.ky
      .patch(
        `/enterprises/${params.enterprise}/code-security/configurations/${params.configuration_id}`,
        {
          json: pick(
            params,
            'name',
            'description',
            'advanced_security',
            'dependency_graph',
            'dependency_graph_autosubmit_action',
            'dependency_graph_autosubmit_action_options',
            'dependabot_alerts',
            'dependabot_security_updates',
            'code_scanning_default_setup',
            'code_scanning_default_setup_options',
            'code_scanning_delegated_alert_dismissal',
            'secret_scanning',
            'secret_scanning_push_protection',
            'secret_scanning_validity_checks',
            'secret_scanning_non_provider_patterns',
            'secret_scanning_generic_secrets',
            'secret_scanning_delegated_alert_dismissal',
            'private_vulnerability_reporting',
            'enforcement'
          )
        }
      )
      .json<github.CodeSecurityUpdateEnterpriseConfigurationResponse>()
  }

  /**
 * Attaches an enterprise code security configuration to repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration.

If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled.

The authenticated user must be an administrator for the enterprise to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_attach_enterprise_configuration',
    description: `Attaches an enterprise code security configuration to repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration.

If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled.

The authenticated user must be an administrator for the enterprise to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:enterprise\` scope to use this endpoint.`,
    inputSchema: github.CodeSecurityAttachEnterpriseConfigurationParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityAttachEnterpriseConfiguration(
    params: github.CodeSecurityAttachEnterpriseConfigurationParams
  ): Promise<github.CodeSecurityAttachEnterpriseConfigurationResponse> {
    return this.ky
      .post(
        `/enterprises/${params.enterprise}/code-security/configurations/${params.configuration_id}/attach`,
        {
          json: pick(params, 'scope')
        }
      )
      .json<github.CodeSecurityAttachEnterpriseConfigurationResponse>()
  }

  /**
 * Sets a code security configuration as a default to be applied to new repositories in your enterprise.

This configuration will be applied by default to the matching repository type when created, but only for organizations within the enterprise that do not already have a default code security configuration set.

The authenticated user must be an administrator for the enterprise to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_set_configuration_as_default_for_enterprise',
    description: `Sets a code security configuration as a default to be applied to new repositories in your enterprise.

This configuration will be applied by default to the matching repository type when created, but only for organizations within the enterprise that do not already have a default code security configuration set.

The authenticated user must be an administrator for the enterprise to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:enterprise\` scope to use this endpoint.`,
    inputSchema:
      github.CodeSecuritySetConfigurationAsDefaultForEnterpriseParamsSchema,
    tags: ['code-security']
  })
  async codeSecuritySetConfigurationAsDefaultForEnterprise(
    params: github.CodeSecuritySetConfigurationAsDefaultForEnterpriseParams
  ): Promise<github.CodeSecuritySetConfigurationAsDefaultForEnterpriseResponse> {
    return this.ky
      .put(
        `/enterprises/${params.enterprise}/code-security/configurations/${params.configuration_id}/defaults`,
        {
          json: pick(params, 'default_for_new_repos')
        }
      )
      .json<github.CodeSecuritySetConfigurationAsDefaultForEnterpriseResponse>()
  }

  /**
 * Lists the repositories associated with an enterprise code security configuration in an organization.

The authenticated user must be an administrator of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_get_repositories_for_enterprise_configuration',
    description: `Lists the repositories associated with an enterprise code security configuration in an organization.

The authenticated user must be an administrator of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`read:enterprise\` scope to use this endpoint.`,
    inputSchema:
      github.CodeSecurityGetRepositoriesForEnterpriseConfigurationParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityGetRepositoriesForEnterpriseConfiguration(
    params: github.CodeSecurityGetRepositoriesForEnterpriseConfigurationParams
  ): Promise<github.CodeSecurityGetRepositoriesForEnterpriseConfigurationResponse> {
    return this.ky
      .get(
        `/enterprises/${params.enterprise}/code-security/configurations/${params.configuration_id}/repositories`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'per_page', 'before', 'after', 'status')
          )
        }
      )
      .json<github.CodeSecurityGetRepositoriesForEnterpriseConfigurationResponse>()
  }

  /**
 * Lists Dependabot alerts for repositories that are owned by the specified enterprise.

The authenticated user must be a member of the enterprise to use this endpoint.

Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. For more information about security managers, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."

OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_dependabot_list_alerts_for_enterprise',
    description: `Lists Dependabot alerts for repositories that are owned by the specified enterprise.

The authenticated user must be a member of the enterprise to use this endpoint.

Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. For more information about security managers, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`security_events\` scope to use this endpoint.`,
    inputSchema: github.DependabotListAlertsForEnterpriseParamsSchema,
    tags: ['dependabot']
  })
  async dependabotListAlertsForEnterprise(
    params: github.DependabotListAlertsForEnterpriseParams
  ): Promise<github.DependabotListAlertsForEnterpriseResponse> {
    return this.ky
      .get(`/enterprises/${params.enterprise}/dependabot/alerts`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'state',
            'severity',
            'ecosystem',
            'package',
            'epss_percentage',
            'scope',
            'sort',
            'direction',
            'before',
            'after',
            'first',
            'last',
            'per_page'
          )
        )
      })
      .json<github.DependabotListAlertsForEnterpriseResponse>()
  }

  /**
 * Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.

Alerts are only returned for organizations in the enterprise for which the authenticated user is an organization owner or a [security manager](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).

The authenticated user must be a member of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope or `security_events` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_secret_scanning_list_alerts_for_enterprise',
    description: `Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.

Alerts are only returned for organizations in the enterprise for which the authenticated user is an organization owner or a [security manager](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).

The authenticated user must be a member of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope or \`security_events\` scope to use this endpoint.`,
    inputSchema: github.SecretScanningListAlertsForEnterpriseParamsSchema,
    tags: ['secret-scanning']
  })
  async secretScanningListAlertsForEnterprise(
    params: github.SecretScanningListAlertsForEnterpriseParams
  ): Promise<github.SecretScanningListAlertsForEnterpriseResponse> {
    return this.ky
      .get(`/enterprises/${params.enterprise}/secret-scanning/alerts`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'state',
            'secret_type',
            'resolution',
            'sort',
            'direction',
            'per_page',
            'before',
            'after',
            'validity',
            'is_publicly_leaked',
            'is_multi_repo'
          )
        )
      })
      .json<github.SecretScanningListAlertsForEnterpriseResponse>()
  }

  /**
 * > [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
 */
  @aiFunction({
    name: 'github_activity_list_public_events',
    description: `> [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.`,
    inputSchema: github.ActivityListPublicEventsParamsSchema,
    tags: ['activity']
  })
  async activityListPublicEvents(
    params: github.ActivityListPublicEventsParams
  ): Promise<github.ActivityListPublicEventsResponse> {
    return this.ky
      .get('/events', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActivityListPublicEventsResponse>()
  }

  /**
 * Lists the feeds available to the authenticated user. The response provides a URL for each feed. You can then get a specific feed by sending a request to one of the feed URLs.

*   **Timeline**: The GitHub global public timeline
*   **User**: The public timeline for any user, using `uri_template`. For more information, see "[Hypermedia](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia)."
*   **Current user public**: The public timeline for the authenticated user
*   **Current user**: The private timeline for the authenticated user
*   **Current user actor**: The private timeline for activity created by the authenticated user
*   **Current user organizations**: The private timeline for the organizations the authenticated user is a member of.
*   **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub.

By default, timeline resources are returned in JSON. You can specify the `application/atom+xml` type in the `Accept` header to return timeline resources in Atom format. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

> [!NOTE]
> Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) since current feed URIs use the older, non revocable auth tokens.
 */
  @aiFunction({
    name: 'github_activity_get_feeds',
    description: `Lists the feeds available to the authenticated user. The response provides a URL for each feed. You can then get a specific feed by sending a request to one of the feed URLs.

*   **Timeline**: The GitHub global public timeline
*   **User**: The public timeline for any user, using \`uri_template\`. For more information, see "[Hypermedia](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia)."
*   **Current user public**: The public timeline for the authenticated user
*   **Current user**: The private timeline for the authenticated user
*   **Current user actor**: The private timeline for activity created by the authenticated user
*   **Current user organizations**: The private timeline for the organizations the authenticated user is a member of.
*   **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub.

By default, timeline resources are returned in JSON. You can specify the \`application/atom+xml\` type in the \`Accept\` header to return timeline resources in Atom format. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

> [!NOTE]
> Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) since current feed URIs use the older, non revocable auth tokens.`,
    inputSchema: github.ActivityGetFeedsParamsSchema,
    tags: ['activity']
  })
  async activityGetFeeds(
    _params: github.ActivityGetFeedsParams
  ): Promise<github.ActivityGetFeedsResponse> {
    return this.ky.get('/feeds').json<github.ActivityGetFeedsResponse>()
  }

  /**
   * Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists:.
   */
  @aiFunction({
    name: 'github_gists_list',
    description: `Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists:.`,
    inputSchema: github.GistsListParamsSchema,
    tags: ['gists']
  })
  async gistsList(
    params: github.GistsListParams
  ): Promise<github.GistsListResponse> {
    return this.ky
      .get('/gists', {
        searchParams: sanitizeSearchParams(
          pick(params, 'since', 'per_page', 'page')
        )
      })
      .json<github.GistsListResponse>()
  }

  /**
 * Allows you to add a new gist with one or more files.

> [!NOTE]
> Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally.
 */
  @aiFunction({
    name: 'github_gists_create',
    description: `Allows you to add a new gist with one or more files.

> [!NOTE]
> Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally.`,
    inputSchema: github.GistsCreateParamsSchema,
    tags: ['gists']
  })
  async gistsCreate(
    params: github.GistsCreateParams
  ): Promise<github.GistsCreateResponse> {
    return this.ky
      .post('/gists', {
        json: pick(params, 'description', 'files', 'public')
      })
      .json<github.GistsCreateResponse>()
  }

  /**
 * List public gists sorted by most recently updated to least recently updated.

Note: With [pagination](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page.
 */
  @aiFunction({
    name: 'github_gists_list_public',
    description: `List public gists sorted by most recently updated to least recently updated.

Note: With [pagination](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page.`,
    inputSchema: github.GistsListPublicParamsSchema,
    tags: ['gists']
  })
  async gistsListPublic(
    params: github.GistsListPublicParams
  ): Promise<github.GistsListPublicResponse> {
    return this.ky
      .get('/gists/public', {
        searchParams: sanitizeSearchParams(
          pick(params, 'since', 'per_page', 'page')
        )
      })
      .json<github.GistsListPublicResponse>()
  }

  /**
   * List the authenticated user's starred gists:.
   */
  @aiFunction({
    name: 'github_gists_list_starred',
    description: `List the authenticated user's starred gists:.`,
    inputSchema: github.GistsListStarredParamsSchema,
    tags: ['gists']
  })
  async gistsListStarred(
    params: github.GistsListStarredParams
  ): Promise<github.GistsListStarredResponse> {
    return this.ky
      .get('/gists/starred', {
        searchParams: sanitizeSearchParams(
          pick(params, 'since', 'per_page', 'page')
        )
      })
      .json<github.GistsListStarredResponse>()
  }

  /**
 * Gets a specified gist.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.
- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences.
 */
  @aiFunction({
    name: 'github_gists_get',
    description: `Gets a specified gist.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.base64+json\`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences.`,
    inputSchema: github.GistsGetParamsSchema,
    tags: ['gists']
  })
  async gistsGet(
    params: github.GistsGetParams
  ): Promise<github.GistsGetResponse> {
    return this.ky
      .get(`/gists/${params.gist_id}`)
      .json<github.GistsGetResponse>()
  }

  /**
   * Delete a gist.
   */
  @aiFunction({
    name: 'github_gists_delete',
    description: `Delete a gist.`,
    inputSchema: github.GistsDeleteParamsSchema,
    tags: ['gists']
  })
  async gistsDelete(
    params: github.GistsDeleteParams
  ): Promise<github.GistsDeleteResponse> {
    return this.ky
      .delete(`/gists/${params.gist_id}`)
      .json<github.GistsDeleteResponse>()
  }

  /**
 * Allows you to update a gist's description and to update, delete, or rename gist files. Files
from the previous version of the gist that aren't explicitly changed during an edit
are unchanged.

At least one of `description` or `files` is required.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.
- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences.
 */
  @aiFunction({
    name: 'github_gists_update',
    description: `Allows you to update a gist's description and to update, delete, or rename gist files. Files
from the previous version of the gist that aren't explicitly changed during an edit
are unchanged.

At least one of \`description\` or \`files\` is required.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.base64+json\`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences.`,
    inputSchema: github.GistsUpdateParamsSchema,
    tags: ['gists']
  })
  async gistsUpdate(
    params: github.GistsUpdateParams
  ): Promise<github.GistsUpdateResponse> {
    return this.ky
      .patch(`/gists/${params.gist_id}`, {
        json: pick(params, 'description', 'files')
      })
      .json<github.GistsUpdateResponse>()
  }

  /**
 * Lists the comments on a gist.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.
- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences.
 */
  @aiFunction({
    name: 'github_gists_list_comments',
    description: `Lists the comments on a gist.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.base64+json\`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences.`,
    inputSchema: github.GistsListCommentsParamsSchema,
    tags: ['gists']
  })
  async gistsListComments(
    params: github.GistsListCommentsParams
  ): Promise<github.GistsListCommentsResponse> {
    return this.ky
      .get(`/gists/${params.gist_id}/comments`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.GistsListCommentsResponse>()
  }

  /**
 * Creates a comment on a gist.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.
- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences.
 */
  @aiFunction({
    name: 'github_gists_create_comment',
    description: `Creates a comment on a gist.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.base64+json\`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences.`,
    inputSchema: github.GistsCreateCommentParamsSchema,
    tags: ['gists']
  })
  async gistsCreateComment(
    params: github.GistsCreateCommentParams
  ): Promise<github.GistsCreateCommentResponse> {
    return this.ky
      .post(`/gists/${params.gist_id}/comments`, {
        json: pick(params, 'body')
      })
      .json<github.GistsCreateCommentResponse>()
  }

  /**
 * Gets a comment on a gist.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.
- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences.
 */
  @aiFunction({
    name: 'github_gists_get_comment',
    description: `Gets a comment on a gist.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.base64+json\`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences.`,
    inputSchema: github.GistsGetCommentParamsSchema,
    tags: ['gists']
  })
  async gistsGetComment(
    params: github.GistsGetCommentParams
  ): Promise<github.GistsGetCommentResponse> {
    return this.ky
      .get(`/gists/${params.gist_id}/comments/${params.comment_id}`, {})
      .json<github.GistsGetCommentResponse>()
  }

  /**
   * Delete a gist comment.
   */
  @aiFunction({
    name: 'github_gists_delete_comment',
    description: `Delete a gist comment.`,
    inputSchema: github.GistsDeleteCommentParamsSchema,
    tags: ['gists']
  })
  async gistsDeleteComment(
    params: github.GistsDeleteCommentParams
  ): Promise<github.GistsDeleteCommentResponse> {
    return this.ky
      .delete(
        `/gists/${params.gist_id}/comments/${params.comment_id}`,
        {}
      )
      .json<github.GistsDeleteCommentResponse>()
  }

  /**
 * Updates a comment on a gist.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.
- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences.
 */
  @aiFunction({
    name: 'github_gists_update_comment',
    description: `Updates a comment on a gist.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.base64+json\`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences.`,
    inputSchema: github.GistsUpdateCommentParamsSchema,
    tags: ['gists']
  })
  async gistsUpdateComment(
    params: github.GistsUpdateCommentParams
  ): Promise<github.GistsUpdateCommentResponse> {
    return this.ky
      .patch(`/gists/${params.gist_id}/comments/${params.comment_id}`, {
        json: pick(params, 'body')
      })
      .json<github.GistsUpdateCommentResponse>()
  }

  /**
   * List gist commits.
   */
  @aiFunction({
    name: 'github_gists_list_commits',
    description: `List gist commits.`,
    inputSchema: github.GistsListCommitsParamsSchema,
    tags: ['gists']
  })
  async gistsListCommits(
    params: github.GistsListCommitsParams
  ): Promise<github.GistsListCommitsResponse> {
    return this.ky
      .get(`/gists/${params.gist_id}/commits`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.GistsListCommitsResponse>()
  }

  /**
   * List gist forks.
   */
  @aiFunction({
    name: 'github_gists_list_forks',
    description: `List gist forks.`,
    inputSchema: github.GistsListForksParamsSchema,
    tags: ['gists']
  })
  async gistsListForks(
    params: github.GistsListForksParams
  ): Promise<github.GistsListForksResponse> {
    return this.ky
      .get(`/gists/${params.gist_id}/forks`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.GistsListForksResponse>()
  }

  /**
   * Fork a gist.
   */
  @aiFunction({
    name: 'github_gists_fork',
    description: `Fork a gist.`,
    inputSchema: github.GistsForkParamsSchema,
    tags: ['gists']
  })
  async gistsFork(
    params: github.GistsForkParams
  ): Promise<github.GistsForkResponse> {
    return this.ky
      .post(`/gists/${params.gist_id}/forks`)
      .json<github.GistsForkResponse>()
  }

  /**
   * Check if a gist is starred.
   */
  @aiFunction({
    name: 'github_gists_check_is_starred',
    description: `Check if a gist is starred.`,
    inputSchema: github.GistsCheckIsStarredParamsSchema,
    tags: ['gists']
  })
  async gistsCheckIsStarred(
    params: github.GistsCheckIsStarredParams
  ): Promise<github.GistsCheckIsStarredResponse> {
    return this.ky
      .get(`/gists/${params.gist_id}/star`)
      .json<github.GistsCheckIsStarredResponse>()
  }

  /**
   * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method).".
   */
  @aiFunction({
    name: 'github_gists_star',
    description: `Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method).".`,
    inputSchema: github.GistsStarParamsSchema,
    tags: ['gists']
  })
  async gistsStar(
    params: github.GistsStarParams
  ): Promise<github.GistsStarResponse> {
    return this.ky
      .put(`/gists/${params.gist_id}/star`)
      .json<github.GistsStarResponse>()
  }

  /**
   * Unstar a gist.
   */
  @aiFunction({
    name: 'github_gists_unstar',
    description: `Unstar a gist.`,
    inputSchema: github.GistsUnstarParamsSchema,
    tags: ['gists']
  })
  async gistsUnstar(
    params: github.GistsUnstarParams
  ): Promise<github.GistsUnstarResponse> {
    return this.ky
      .delete(`/gists/${params.gist_id}/star`)
      .json<github.GistsUnstarResponse>()
  }

  /**
 * Gets a specified gist revision.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.
- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences.
 */
  @aiFunction({
    name: 'github_gists_get_revision',
    description: `Gets a specified gist revision.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.base64+json\`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences.`,
    inputSchema: github.GistsGetRevisionParamsSchema,
    tags: ['gists']
  })
  async gistsGetRevision(
    params: github.GistsGetRevisionParams
  ): Promise<github.GistsGetRevisionResponse> {
    return this.ky
      .get(`/gists/${params.gist_id}/${params.sha}`, {})
      .json<github.GistsGetRevisionResponse>()
  }

  /**
   * List all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user).
   */
  @aiFunction({
    name: 'github_gitignore_get_all_templates',
    description: `List all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user).`,
    inputSchema: github.GitignoreGetAllTemplatesParamsSchema,
    tags: ['gitignore']
  })
  async gitignoreGetAllTemplates(
    _params: github.GitignoreGetAllTemplatesParams
  ): Promise<github.GitignoreGetAllTemplatesResponse> {
    return this.ky
      .get('/gitignore/templates')
      .json<github.GitignoreGetAllTemplatesResponse>()
  }

  /**
 * Get the content of a gitignore template.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw .gitignore contents.
 */
  @aiFunction({
    name: 'github_gitignore_get_template',
    description: `Get the content of a gitignore template.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw .gitignore contents.`,
    inputSchema: github.GitignoreGetTemplateParamsSchema,
    tags: ['gitignore']
  })
  async gitignoreGetTemplate(
    params: github.GitignoreGetTemplateParams
  ): Promise<github.GitignoreGetTemplateResponse> {
    return this.ky
      .get(`/gitignore/templates/${params.name}`)
      .json<github.GitignoreGetTemplateResponse>()
  }

  /**
   * List repositories that an app installation can access.
   */
  @aiFunction({
    name: 'github_apps_list_repos_accessible_to_installation',
    description: `List repositories that an app installation can access.`,
    inputSchema: github.AppsListReposAccessibleToInstallationParamsSchema,
    tags: ['apps']
  })
  async appsListReposAccessibleToInstallation(
    params: github.AppsListReposAccessibleToInstallationParams
  ): Promise<github.AppsListReposAccessibleToInstallationResponse> {
    return this.ky
      .get('/installation/repositories', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.AppsListReposAccessibleToInstallationResponse>()
  }

  /**
 * Revokes the installation token you're using to authenticate as an installation and access this endpoint.

Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app)" endpoint.
 */
  @aiFunction({
    name: 'github_apps_revoke_installation_access_token',
    description: `Revokes the installation token you're using to authenticate as an installation and access this endpoint.

Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app)" endpoint.`,
    inputSchema: github.AppsRevokeInstallationAccessTokenParamsSchema,
    tags: ['apps']
  })
  async appsRevokeInstallationAccessToken(
    _params: github.AppsRevokeInstallationAccessTokenParams
  ): Promise<github.AppsRevokeInstallationAccessTokenResponse> {
    return this.ky
      .delete('/installation/token')
      .json<github.AppsRevokeInstallationAccessTokenResponse>()
  }

  /**
 * List issues assigned to the authenticated user across all visible repositories including owned repositories, member
repositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are not
necessarily assigned to you.

> [!NOTE]
> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_issues_list',
    description: `List issues assigned to the authenticated user across all visible repositories including owned repositories, member
repositories, and organization repositories. You can use the \`filter\` query parameter to fetch issues that are not
necessarily assigned to you.

> [!NOTE]
> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.IssuesListParamsSchema,
    tags: ['issues']
  })
  async issuesList(
    params: github.IssuesListParams
  ): Promise<github.IssuesListResponse> {
    return this.ky
      .get('/issues', {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'filter',
            'state',
            'labels',
            'sort',
            'direction',
            'since',
            'collab',
            'orgs',
            'owned',
            'pulls',
            'per_page',
            'page'
          )
        )
      })
      .json<github.IssuesListResponse>()
  }

  /**
   * Lists the most commonly used licenses on GitHub. For more information, see "[Licensing a repository ](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository).".
   */
  @aiFunction({
    name: 'github_licenses_get_all_commonly_used',
    description: `Lists the most commonly used licenses on GitHub. For more information, see "[Licensing a repository ](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository).".`,
    inputSchema: github.LicensesGetAllCommonlyUsedParamsSchema,
    tags: ['licenses']
  })
  async licensesGetAllCommonlyUsed(
    params: github.LicensesGetAllCommonlyUsedParams
  ): Promise<github.LicensesGetAllCommonlyUsedResponse> {
    return this.ky
      .get('/licenses', {
        searchParams: sanitizeSearchParams(
          pick(params, 'featured', 'per_page', 'page')
        )
      })
      .json<github.LicensesGetAllCommonlyUsedResponse>()
  }

  /**
   * Gets information about a specific license. For more information, see "[Licensing a repository ](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository).".
   */
  @aiFunction({
    name: 'github_licenses_get',
    description: `Gets information about a specific license. For more information, see "[Licensing a repository ](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository).".`,
    inputSchema: github.LicensesGetParamsSchema,
    tags: ['licenses']
  })
  async licensesGet(
    params: github.LicensesGetParams
  ): Promise<github.LicensesGetResponse> {
    return this.ky
      .get(`/licenses/${params.license}`)
      .json<github.LicensesGetResponse>()
  }

  /**
   * Render a Markdown document.
   */
  @aiFunction({
    name: 'github_markdown_render',
    description: `Render a Markdown document.`,
    inputSchema: github.MarkdownRenderParamsSchema,
    tags: ['markdown']
  })
  async markdownRender(
    params: github.MarkdownRenderParams
  ): Promise<github.MarkdownRenderResponse> {
    return this.ky
      .post('/markdown', {
        json: pick(params, 'text', 'mode', 'context')
      })
      .json<github.MarkdownRenderResponse>()
  }

  /**
   * You must send Markdown as plain text (using a `Content-Type` header of `text/plain` or `text/x-markdown`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less.
   */
  @aiFunction({
    name: 'github_markdown_render_raw',
    description: `You must send Markdown as plain text (using a \`Content-Type\` header of \`text/plain\` or \`text/x-markdown\`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less.`,
    inputSchema: github.MarkdownRenderRawParamsSchema,
    tags: ['markdown']
  })
  async markdownRenderRaw(
    _params: github.MarkdownRenderRawParams
  ): Promise<github.MarkdownRenderRawResponse> {
    return this.ky
      .post('/markdown/raw')
      .json<github.MarkdownRenderRawResponse>()
  }

  /**
 * Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_get_subscription_plan_for_account',
    description: `Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint.`,
    inputSchema: github.AppsGetSubscriptionPlanForAccountParamsSchema,
    tags: ['apps']
  })
  async appsGetSubscriptionPlanForAccount(
    params: github.AppsGetSubscriptionPlanForAccountParams
  ): Promise<github.AppsGetSubscriptionPlanForAccountResponse> {
    return this.ky
      .get(`/marketplace_listing/accounts/${params.account_id}`)
      .json<github.AppsGetSubscriptionPlanForAccountResponse>()
  }

  /**
 * Lists all plans that are part of your GitHub Marketplace listing.

GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_list_plans',
    description: `Lists all plans that are part of your GitHub Marketplace listing.

GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint.`,
    inputSchema: github.AppsListPlansParamsSchema,
    tags: ['apps']
  })
  async appsListPlans(
    params: github.AppsListPlansParams
  ): Promise<github.AppsListPlansResponse> {
    return this.ky
      .get('/marketplace_listing/plans', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.AppsListPlansResponse>()
  }

  /**
 * Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_list_accounts_for_plan',
    description: `Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint.`,
    inputSchema: github.AppsListAccountsForPlanParamsSchema,
    tags: ['apps']
  })
  async appsListAccountsForPlan(
    params: github.AppsListAccountsForPlanParams
  ): Promise<github.AppsListAccountsForPlanResponse> {
    return this.ky
      .get(`/marketplace_listing/plans/${params.plan_id}/accounts`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'sort', 'direction', 'per_page', 'page')
        )
      })
      .json<github.AppsListAccountsForPlanResponse>()
  }

  /**
 * Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_get_subscription_plan_for_account_stubbed',
    description: `Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint.`,
    inputSchema: github.AppsGetSubscriptionPlanForAccountStubbedParamsSchema,
    tags: ['apps']
  })
  async appsGetSubscriptionPlanForAccountStubbed(
    params: github.AppsGetSubscriptionPlanForAccountStubbedParams
  ): Promise<github.AppsGetSubscriptionPlanForAccountStubbedResponse> {
    return this.ky
      .get(`/marketplace_listing/stubbed/accounts/${params.account_id}`)
      .json<github.AppsGetSubscriptionPlanForAccountStubbedResponse>()
  }

  /**
 * Lists all plans that are part of your GitHub Marketplace listing.

GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_list_plans_stubbed',
    description: `Lists all plans that are part of your GitHub Marketplace listing.

GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint.`,
    inputSchema: github.AppsListPlansStubbedParamsSchema,
    tags: ['apps']
  })
  async appsListPlansStubbed(
    params: github.AppsListPlansStubbedParams
  ): Promise<github.AppsListPlansStubbedResponse> {
    return this.ky
      .get('/marketplace_listing/stubbed/plans', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.AppsListPlansStubbedResponse>()
  }

  /**
 * Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_list_accounts_for_plan_stubbed',
    description: `Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) with their client ID and client secret to access this endpoint.`,
    inputSchema: github.AppsListAccountsForPlanStubbedParamsSchema,
    tags: ['apps']
  })
  async appsListAccountsForPlanStubbed(
    params: github.AppsListAccountsForPlanStubbedParams
  ): Promise<github.AppsListAccountsForPlanStubbedResponse> {
    return this.ky
      .get(`/marketplace_listing/stubbed/plans/${params.plan_id}/accounts`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'sort', 'direction', 'per_page', 'page')
        )
      })
      .json<github.AppsListAccountsForPlanStubbedResponse>()
  }

  /**
 * Returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://docs.github.com/articles/about-github-s-ip-addresses/)."

The API's response also includes a list of GitHub's domain names.

The values shown in the documentation's response are example values. You must always query the API directly to get the latest values.

> [!NOTE]
> This endpoint returns both IPv4 and IPv6 addresses. However, not all features support IPv6. You should refer to the specific documentation for each feature to determine if IPv6 is supported.
 */
  @aiFunction({
    name: 'github_meta_get',
    description: `Returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://docs.github.com/articles/about-github-s-ip-addresses/)."

The API's response also includes a list of GitHub's domain names.

The values shown in the documentation's response are example values. You must always query the API directly to get the latest values.

> [!NOTE]
> This endpoint returns both IPv4 and IPv6 addresses. However, not all features support IPv6. You should refer to the specific documentation for each feature to determine if IPv6 is supported.`,
    inputSchema: github.MetaGetParamsSchema,
    tags: ['meta']
  })
  async metaGet(
    _params: github.MetaGetParams
  ): Promise<github.MetaGetResponse> {
    return this.ky.get('/meta').json<github.MetaGetResponse>()
  }

  /**
 * > [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
 */
  @aiFunction({
    name: 'github_activity_list_public_events_for_repo_network',
    description: `> [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.`,
    inputSchema: github.ActivityListPublicEventsForRepoNetworkParamsSchema,
    tags: ['activity']
  })
  async activityListPublicEventsForRepoNetwork(
    params: github.ActivityListPublicEventsForRepoNetworkParams
  ): Promise<github.ActivityListPublicEventsForRepoNetworkResponse> {
    return this.ky
      .get(`/networks/${params.owner}/${params.repo}/events`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActivityListPublicEventsForRepoNetworkResponse>()
  }

  /**
   * List all notifications for the current user, sorted by most recently updated.
   */
  @aiFunction({
    name: 'github_activity_list_notifications_for_authenticated_user',
    description: `List all notifications for the current user, sorted by most recently updated.`,
    inputSchema:
      github.ActivityListNotificationsForAuthenticatedUserParamsSchema,
    tags: ['activity']
  })
  async activityListNotificationsForAuthenticatedUser(
    params: github.ActivityListNotificationsForAuthenticatedUserParams
  ): Promise<github.ActivityListNotificationsForAuthenticatedUserResponse> {
    return this.ky
      .get('/notifications', {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'all',
            'participating',
            'since',
            'before',
            'page',
            'per_page'
          )
        )
      })
      .json<github.ActivityListNotificationsForAuthenticatedUserResponse>()
  }

  /**
   * Marks all notifications as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`.
   */
  @aiFunction({
    name: 'github_activity_mark_notifications_as_read',
    description: `Marks all notifications as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a \`202 Accepted\` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter \`all=false\`.`,
    inputSchema: github.ActivityMarkNotificationsAsReadParamsSchema,
    tags: ['activity']
  })
  async activityMarkNotificationsAsRead(
    params: github.ActivityMarkNotificationsAsReadParams
  ): Promise<github.ActivityMarkNotificationsAsReadResponse> {
    return this.ky
      .put('/notifications', {
        json: pick(params, 'last_read_at', 'read')
      })
      .json<github.ActivityMarkNotificationsAsReadResponse>()
  }

  /**
   * Gets information about a notification thread.
   */
  @aiFunction({
    name: 'github_activity_get_thread',
    description: `Gets information about a notification thread.`,
    inputSchema: github.ActivityGetThreadParamsSchema,
    tags: ['activity']
  })
  async activityGetThread(
    params: github.ActivityGetThreadParams
  ): Promise<github.ActivityGetThreadResponse> {
    return this.ky
      .get(`/notifications/threads/${params.thread_id}`)
      .json<github.ActivityGetThreadResponse>()
  }

  /**
   * Marks a thread as "done." Marking a thread as "done" is equivalent to marking a notification in your notification inbox on GitHub as done: https://github.com/notifications.
   */
  @aiFunction({
    name: 'github_activity_mark_thread_as_done',
    description: `Marks a thread as "done." Marking a thread as "done" is equivalent to marking a notification in your notification inbox on GitHub as done: https://github.com/notifications.`,
    inputSchema: github.ActivityMarkThreadAsDoneParamsSchema,
    tags: ['activity']
  })
  async activityMarkThreadAsDone(
    params: github.ActivityMarkThreadAsDoneParams
  ): Promise<github.ActivityMarkThreadAsDoneResponse> {
    return this.ky
      .delete(`/notifications/threads/${params.thread_id}`)
      .json<github.ActivityMarkThreadAsDoneResponse>()
  }

  /**
   * Marks a thread as "read." Marking a thread as "read" is equivalent to clicking a notification in your notification inbox on GitHub: https://github.com/notifications.
   */
  @aiFunction({
    name: 'github_activity_mark_thread_as_read',
    description: `Marks a thread as "read." Marking a thread as "read" is equivalent to clicking a notification in your notification inbox on GitHub: https://github.com/notifications.`,
    inputSchema: github.ActivityMarkThreadAsReadParamsSchema,
    tags: ['activity']
  })
  async activityMarkThreadAsRead(
    params: github.ActivityMarkThreadAsReadParams
  ): Promise<github.ActivityMarkThreadAsReadResponse> {
    return this.ky
      .patch(`/notifications/threads/${params.thread_id}`)
      .json<github.ActivityMarkThreadAsReadResponse>()
  }

  /**
 * This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/activity/watching#get-a-repository-subscription).

Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread.
 */
  @aiFunction({
    name: 'github_activity_get_thread_subscription_for_authenticated_user',
    description: `This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/activity/watching#get-a-repository-subscription).

Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread.`,
    inputSchema:
      github.ActivityGetThreadSubscriptionForAuthenticatedUserParamsSchema,
    tags: ['activity']
  })
  async activityGetThreadSubscriptionForAuthenticatedUser(
    params: github.ActivityGetThreadSubscriptionForAuthenticatedUserParams
  ): Promise<github.ActivityGetThreadSubscriptionForAuthenticatedUserResponse> {
    return this.ky
      .get(`/notifications/threads/${params.thread_id}/subscription`)
      .json<github.ActivityGetThreadSubscriptionForAuthenticatedUserResponse>()
  }

  /**
 * If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**.

You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.

Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription) endpoint.
 */
  @aiFunction({
    name: 'github_activity_set_thread_subscription',
    description: `If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**.

You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.

Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription) endpoint.`,
    inputSchema: github.ActivitySetThreadSubscriptionParamsSchema,
    tags: ['activity']
  })
  async activitySetThreadSubscription(
    params: github.ActivitySetThreadSubscriptionParams
  ): Promise<github.ActivitySetThreadSubscriptionResponse> {
    return this.ky
      .put(`/notifications/threads/${params.thread_id}/subscription`, {
        json: pick(params, 'ignored')
      })
      .json<github.ActivitySetThreadSubscriptionResponse>()
  }

  /**
   * Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/activity/notifications#set-a-thread-subscription) endpoint and set `ignore` to `true`.
   */
  @aiFunction({
    name: 'github_activity_delete_thread_subscription',
    description: `Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/activity/notifications#set-a-thread-subscription) endpoint and set \`ignore\` to \`true\`.`,
    inputSchema: github.ActivityDeleteThreadSubscriptionParamsSchema,
    tags: ['activity']
  })
  async activityDeleteThreadSubscription(
    params: github.ActivityDeleteThreadSubscriptionParams
  ): Promise<github.ActivityDeleteThreadSubscriptionResponse> {
    return this.ky
      .delete(`/notifications/threads/${params.thread_id}/subscription`)
      .json<github.ActivityDeleteThreadSubscriptionResponse>()
  }

  /**
   * Get the octocat as ASCII art.
   */
  @aiFunction({
    name: 'github_meta_get_octocat',
    description: `Get the octocat as ASCII art.`,
    inputSchema: github.MetaGetOctocatParamsSchema,
    tags: ['meta']
  })
  async metaGetOctocat(
    params: github.MetaGetOctocatParams
  ): Promise<github.MetaGetOctocatResponse> {
    return this.ky
      .get('/octocat', {
        searchParams: sanitizeSearchParams(params)
      })
      .json<github.MetaGetOctocatResponse>()
  }

  /**
 * Lists all organizations, in the order that they were created.

> [!NOTE]
> Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of organizations.
 */
  @aiFunction({
    name: 'github_orgs_list',
    description: `Lists all organizations, in the order that they were created.

> [!NOTE]
> Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of organizations.`,
    inputSchema: github.OrgsListParamsSchema,
    tags: ['orgs']
  })
  async orgsList(
    params: github.OrgsListParams
  ): Promise<github.OrgsListResponse> {
    return this.ky
      .get('/organizations', {
        searchParams: sanitizeSearchParams(pick(params, 'since', 'per_page'))
      })
      .json<github.OrgsListResponse>()
  }

  /**
 * Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account.

**Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform).".
 */
  @aiFunction({
    name: 'github_billing_get_github_billing_usage_report_org',
    description: `Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account.

**Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform).".`,
    inputSchema: github.BillingGetGithubBillingUsageReportOrgParamsSchema,
    tags: ['billing']
  })
  async billingGetGithubBillingUsageReportOrg(
    params: github.BillingGetGithubBillingUsageReportOrgParams
  ): Promise<github.BillingGetGithubBillingUsageReportOrgResponse> {
    return this.ky
      .get(`/organizations/${params.org}/settings/billing/usage`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'year', 'month', 'day', 'hour')
        )
      })
      .json<github.BillingGetGithubBillingUsageReportOrgResponse>()
  }

  /**
 * Gets information about an organization.

When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, outside collaborators, guest collaborators, repository collaborators, or everyone with access to any repository within the organization to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/).

To see the full details about an organization, the authenticated user must be an organization owner.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization.

To see information about an organization's GitHub plan, GitHub Apps need the `Organization plan` permission.
 */
  @aiFunction({
    name: 'github_orgs_get',
    description: `Gets information about an organization.

When the value of \`two_factor_requirement_enabled\` is \`true\`, the organization requires all members, billing managers, outside collaborators, guest collaborators, repository collaborators, or everyone with access to any repository within the organization to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/).

To see the full details about an organization, the authenticated user must be an organization owner.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to see the full details about an organization.

To see information about an organization's GitHub plan, GitHub Apps need the \`Organization plan\` permission.`,
    inputSchema: github.OrgsGetParamsSchema,
    tags: ['orgs']
  })
  async orgsGet(params: github.OrgsGetParams): Promise<github.OrgsGetResponse> {
    return this.ky.get(`/orgs/${params.org}`).json<github.OrgsGetResponse>()
  }

  /**
 * Deletes an organization and all its repositories.

The organization login will be unavailable for 90 days after deletion.

Please review the Terms of Service regarding account deletion before using this endpoint:

https://docs.github.com/site-policy/github-terms/github-terms-of-service.
 */
  @aiFunction({
    name: 'github_orgs_delete',
    description: `Deletes an organization and all its repositories.

The organization login will be unavailable for 90 days after deletion.

Please review the Terms of Service regarding account deletion before using this endpoint:

https://docs.github.com/site-policy/github-terms/github-terms-of-service.`,
    inputSchema: github.OrgsDeleteParamsSchema,
    tags: ['orgs']
  })
  async orgsDelete(
    params: github.OrgsDeleteParams
  ): Promise<github.OrgsDeleteResponse> {
    return this.ky
      .delete(`/orgs/${params.org}`)
      .json<github.OrgsDeleteResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes).

> [!WARNING]
> **Closing down notice:** Code security product enablement for new repositories through the organization API is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/).

Updates the organization's profile and member privileges.

The authenticated user must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_update',
    description: `> [!WARNING]
> **Closing down notice:** GitHub will replace and discontinue \`members_allowed_repository_creation_type\` in favor of more granular permissions. The new input parameters are \`members_can_create_public_repositories\`, \`members_can_create_private_repositories\` for all organizations and \`members_can_create_internal_repositories\` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes).

> [!WARNING]
> **Closing down notice:** Code security product enablement for new repositories through the organization API is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/).

Updates the organization's profile and member privileges.

The authenticated user must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` or \`repo\` scope to use this endpoint.`,
    inputSchema: github.OrgsUpdateParamsSchema,
    tags: ['orgs']
  })
  async orgsUpdate(
    params: github.OrgsUpdateParams
  ): Promise<github.OrgsUpdateResponse> {
    return this.ky
      .patch(`/orgs/${params.org}`, {
        json: pick(
          params,
          'billing_email',
          'company',
          'email',
          'twitter_username',
          'location',
          'name',
          'description',
          'has_organization_projects',
          'has_repository_projects',
          'default_repository_permission',
          'members_can_create_repositories',
          'members_can_create_internal_repositories',
          'members_can_create_private_repositories',
          'members_can_create_public_repositories',
          'members_allowed_repository_creation_type',
          'members_can_create_pages',
          'members_can_create_public_pages',
          'members_can_create_private_pages',
          'members_can_fork_private_repositories',
          'web_commit_signoff_required',
          'blog',
          'advanced_security_enabled_for_new_repositories',
          'dependabot_alerts_enabled_for_new_repositories',
          'dependabot_security_updates_enabled_for_new_repositories',
          'dependency_graph_enabled_for_new_repositories',
          'secret_scanning_enabled_for_new_repositories',
          'secret_scanning_push_protection_enabled_for_new_repositories',
          'secret_scanning_push_protection_custom_link_enabled',
          'secret_scanning_push_protection_custom_link',
          'deploy_keys_enabled_for_repositories'
        )
      })
      .json<github.OrgsUpdateResponse>()
  }

  /**
 * Gets the total GitHub Actions cache usage for an organization.
The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.

OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_actions_cache_usage_for_org',
    description: `Gets the total GitHub Actions cache usage for an organization.
The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.

OAuth tokens and personal access tokens (classic) need the \`read:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetActionsCacheUsageForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsGetActionsCacheUsageForOrg(
    params: github.ActionsGetActionsCacheUsageForOrgParams
  ): Promise<github.ActionsGetActionsCacheUsageForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/cache/usage`)
      .json<github.ActionsGetActionsCacheUsageForOrgResponse>()
  }

  /**
 * Lists repositories and their GitHub Actions cache usage for an organization.
The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.

OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_actions_cache_usage_by_repo_for_org',
    description: `Lists repositories and their GitHub Actions cache usage for an organization.
The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.

OAuth tokens and personal access tokens (classic) need the \`read:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetActionsCacheUsageByRepoForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsGetActionsCacheUsageByRepoForOrg(
    params: github.ActionsGetActionsCacheUsageByRepoForOrgParams
  ): Promise<github.ActionsGetActionsCacheUsageByRepoForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/cache/usage-by-repository`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActionsGetActionsCacheUsageByRepoForOrgResponse>()
  }

  /**
 * Lists all GitHub-hosted runners configured in an organization.

OAuth app tokens and personal access tokens (classic) need the `manage_runner:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_list_hosted_runners_for_org',
    description: `Lists all GitHub-hosted runners configured in an organization.

OAuth app tokens and personal access tokens (classic) need the \`manage_runner:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsListHostedRunnersForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsListHostedRunnersForOrg(
    params: github.ActionsListHostedRunnersForOrgParams
  ): Promise<github.ActionsListHostedRunnersForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/hosted-runners`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActionsListHostedRunnersForOrgResponse>()
  }

  /**
 * Creates a GitHub-hosted runner for an organization.
OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_create_hosted_runner_for_org',
    description: `Creates a GitHub-hosted runner for an organization.
OAuth tokens and personal access tokens (classic) need the \`manage_runners:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsCreateHostedRunnerForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsCreateHostedRunnerForOrg(
    params: github.ActionsCreateHostedRunnerForOrgParams
  ): Promise<github.ActionsCreateHostedRunnerForOrgResponse> {
    return this.ky
      .post(`/orgs/${params.org}/actions/hosted-runners`, {
        json: pick(
          params,
          'name',
          'image',
          'size',
          'runner_group_id',
          'maximum_runners',
          'enable_static_ip'
        )
      })
      .json<github.ActionsCreateHostedRunnerForOrgResponse>()
  }

  /**
   * Get the list of GitHub-owned images available for GitHub-hosted runners for an organization.
   */
  @aiFunction({
    name: 'github_actions_get_hosted_runners_github_owned_images_for_org',
    description: `Get the list of GitHub-owned images available for GitHub-hosted runners for an organization.`,
    inputSchema:
      github.ActionsGetHostedRunnersGithubOwnedImagesForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsGetHostedRunnersGithubOwnedImagesForOrg(
    params: github.ActionsGetHostedRunnersGithubOwnedImagesForOrgParams
  ): Promise<github.ActionsGetHostedRunnersGithubOwnedImagesForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/hosted-runners/images/github-owned`)
      .json<github.ActionsGetHostedRunnersGithubOwnedImagesForOrgResponse>()
  }

  /**
   * Get the list of partner images available for GitHub-hosted runners for an organization.
   */
  @aiFunction({
    name: 'github_actions_get_hosted_runners_partner_images_for_org',
    description: `Get the list of partner images available for GitHub-hosted runners for an organization.`,
    inputSchema: github.ActionsGetHostedRunnersPartnerImagesForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsGetHostedRunnersPartnerImagesForOrg(
    params: github.ActionsGetHostedRunnersPartnerImagesForOrgParams
  ): Promise<github.ActionsGetHostedRunnersPartnerImagesForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/hosted-runners/images/partner`)
      .json<github.ActionsGetHostedRunnersPartnerImagesForOrgResponse>()
  }

  /**
   * Get the GitHub-hosted runners limits for an organization.
   */
  @aiFunction({
    name: 'github_actions_get_hosted_runners_limits_for_org',
    description: `Get the GitHub-hosted runners limits for an organization.`,
    inputSchema: github.ActionsGetHostedRunnersLimitsForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsGetHostedRunnersLimitsForOrg(
    params: github.ActionsGetHostedRunnersLimitsForOrgParams
  ): Promise<github.ActionsGetHostedRunnersLimitsForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/hosted-runners/limits`)
      .json<github.ActionsGetHostedRunnersLimitsForOrgResponse>()
  }

  /**
   * Get the list of machine specs available for GitHub-hosted runners for an organization.
   */
  @aiFunction({
    name: 'github_actions_get_hosted_runners_machine_specs_for_org',
    description: `Get the list of machine specs available for GitHub-hosted runners for an organization.`,
    inputSchema: github.ActionsGetHostedRunnersMachineSpecsForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsGetHostedRunnersMachineSpecsForOrg(
    params: github.ActionsGetHostedRunnersMachineSpecsForOrgParams
  ): Promise<github.ActionsGetHostedRunnersMachineSpecsForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/hosted-runners/machine-sizes`)
      .json<github.ActionsGetHostedRunnersMachineSpecsForOrgResponse>()
  }

  /**
   * Get the list of platforms available for GitHub-hosted runners for an organization.
   */
  @aiFunction({
    name: 'github_actions_get_hosted_runners_platforms_for_org',
    description: `Get the list of platforms available for GitHub-hosted runners for an organization.`,
    inputSchema: github.ActionsGetHostedRunnersPlatformsForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsGetHostedRunnersPlatformsForOrg(
    params: github.ActionsGetHostedRunnersPlatformsForOrgParams
  ): Promise<github.ActionsGetHostedRunnersPlatformsForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/hosted-runners/platforms`)
      .json<github.ActionsGetHostedRunnersPlatformsForOrgResponse>()
  }

  /**
 * Gets a GitHub-hosted runner configured in an organization.

OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_hosted_runner_for_org',
    description: `Gets a GitHub-hosted runner configured in an organization.

OAuth app tokens and personal access tokens (classic) need the \`manage_runners:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetHostedRunnerForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsGetHostedRunnerForOrg(
    params: github.ActionsGetHostedRunnerForOrgParams
  ): Promise<github.ActionsGetHostedRunnerForOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/actions/hosted-runners/${params.hosted_runner_id}`,
        {}
      )
      .json<github.ActionsGetHostedRunnerForOrgResponse>()
  }

  /**
   * Deletes a GitHub-hosted runner for an organization.
   */
  @aiFunction({
    name: 'github_actions_delete_hosted_runner_for_org',
    description: `Deletes a GitHub-hosted runner for an organization.`,
    inputSchema: github.ActionsDeleteHostedRunnerForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsDeleteHostedRunnerForOrg(
    params: github.ActionsDeleteHostedRunnerForOrgParams
  ): Promise<github.ActionsDeleteHostedRunnerForOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/actions/hosted-runners/${params.hosted_runner_id}`,
        {}
      )
      .json<github.ActionsDeleteHostedRunnerForOrgResponse>()
  }

  /**
 * Updates a GitHub-hosted runner for an organization.
OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_update_hosted_runner_for_org',
    description: `Updates a GitHub-hosted runner for an organization.
OAuth app tokens and personal access tokens (classic) need the \`manage_runners:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsUpdateHostedRunnerForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsUpdateHostedRunnerForOrg(
    params: github.ActionsUpdateHostedRunnerForOrgParams
  ): Promise<github.ActionsUpdateHostedRunnerForOrgResponse> {
    return this.ky
      .patch(
        `/orgs/${params.org}/actions/hosted-runners/${params.hosted_runner_id}`,
        {
          json: pick(
            params,
            'name',
            'runner_group_id',
            'maximum_runners',
            'enable_static_ip'
          )
        }
      )
      .json<github.ActionsUpdateHostedRunnerForOrgResponse>()
  }

  /**
 * Gets the customization template for an OpenID Connect (OIDC) subject claim.

OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_oidc_get_oidc_custom_sub_template_for_org',
    description: `Gets the customization template for an OpenID Connect (OIDC) subject claim.

OAuth app tokens and personal access tokens (classic) need the \`read:org\` scope to use this endpoint.`,
    inputSchema: github.OidcGetOidcCustomSubTemplateForOrgParamsSchema,
    tags: ['oidc']
  })
  async oidcGetOidcCustomSubTemplateForOrg(
    params: github.OidcGetOidcCustomSubTemplateForOrgParams
  ): Promise<github.OidcGetOidcCustomSubTemplateForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/oidc/customization/sub`)
      .json<github.OidcGetOidcCustomSubTemplateForOrgResponse>()
  }

  /**
 * Creates or updates the customization template for an OpenID Connect (OIDC) subject claim.

OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_oidc_update_oidc_custom_sub_template_for_org',
    description: `Creates or updates the customization template for an OpenID Connect (OIDC) subject claim.

OAuth app tokens and personal access tokens (classic) need the \`write:org\` scope to use this endpoint.`,
    inputSchema: github.OidcUpdateOidcCustomSubTemplateForOrgParamsSchema,
    tags: ['oidc']
  })
  async oidcUpdateOidcCustomSubTemplateForOrg(
    params: github.OidcUpdateOidcCustomSubTemplateForOrgParams
  ): Promise<github.OidcUpdateOidcCustomSubTemplateForOrgResponse> {
    return this.ky
      .put(`/orgs/${params.org}/actions/oidc/customization/sub`, {
        json: pick(params, 'include_claim_keys')
      })
      .json<github.OidcUpdateOidcCustomSubTemplateForOrgResponse>()
  }

  /**
 * Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.

OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_github_actions_permissions_organization',
    description: `Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.

OAuth tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsGetGithubActionsPermissionsOrganizationParamsSchema,
    tags: ['actions']
  })
  async actionsGetGithubActionsPermissionsOrganization(
    params: github.ActionsGetGithubActionsPermissionsOrganizationParams
  ): Promise<github.ActionsGetGithubActionsPermissionsOrganizationResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/permissions`)
      .json<github.ActionsGetGithubActionsPermissionsOrganizationResponse>()
  }

  /**
 * Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_set_github_actions_permissions_organization',
    description: `Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsSetGithubActionsPermissionsOrganizationParamsSchema,
    tags: ['actions']
  })
  async actionsSetGithubActionsPermissionsOrganization(
    params: github.ActionsSetGithubActionsPermissionsOrganizationParams
  ): Promise<github.ActionsSetGithubActionsPermissionsOrganizationResponse> {
    return this.ky
      .put(`/orgs/${params.org}/actions/permissions`, {
        json: pick(params, 'enabled_repositories', 'allowed_actions')
      })
      .json<github.ActionsSetGithubActionsPermissionsOrganizationResponse>()
  }

  /**
 * Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_list_selected_repositories_enabled_github_actions_organization',
    description: `Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationParamsSchema,
    tags: ['actions']
  })
  async actionsListSelectedRepositoriesEnabledGithubActionsOrganization(
    params: github.ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationParams
  ): Promise<github.ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/permissions/repositories`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActionsListSelectedRepositoriesEnabledGithubActionsOrganizationResponse>()
  }

  /**
 * Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."


OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_set_selected_repositories_enabled_github_actions_organization',
    description: `Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."


OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationParamsSchema,
    tags: ['actions']
  })
  async actionsSetSelectedRepositoriesEnabledGithubActionsOrganization(
    params: github.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationParams
  ): Promise<github.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationResponse> {
    return this.ky
      .put(`/orgs/${params.org}/actions/permissions/repositories`, {
        json: pick(params, 'selected_repository_ids')
      })
      .json<github.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationResponse>()
  }

  /**
 * Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."

OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_enable_selected_repository_github_actions_organization',
    description: `Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."

OAuth tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsEnableSelectedRepositoryGithubActionsOrganizationParamsSchema,
    tags: ['actions']
  })
  async actionsEnableSelectedRepositoryGithubActionsOrganization(
    params: github.ActionsEnableSelectedRepositoryGithubActionsOrganizationParams
  ): Promise<github.ActionsEnableSelectedRepositoryGithubActionsOrganizationResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/actions/permissions/repositories/${params.repository_id}`,
        {}
      )
      .json<github.ActionsEnableSelectedRepositoryGithubActionsOrganizationResponse>()
  }

  /**
 * Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."

OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_disable_selected_repository_github_actions_organization',
    description: `Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for \`enabled_repositories\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."

OAuth tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsDisableSelectedRepositoryGithubActionsOrganizationParamsSchema,
    tags: ['actions']
  })
  async actionsDisableSelectedRepositoryGithubActionsOrganization(
    params: github.ActionsDisableSelectedRepositoryGithubActionsOrganizationParams
  ): Promise<github.ActionsDisableSelectedRepositoryGithubActionsOrganizationResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/actions/permissions/repositories/${params.repository_id}`,
        {}
      )
      .json<github.ActionsDisableSelectedRepositoryGithubActionsOrganizationResponse>()
  }

  /**
 * Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."

OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_allowed_actions_organization',
    description: `Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."

OAuth tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetAllowedActionsOrganizationParamsSchema,
    tags: ['actions']
  })
  async actionsGetAllowedActionsOrganization(
    params: github.ActionsGetAllowedActionsOrganizationParams
  ): Promise<github.ActionsGetAllowedActionsOrganizationResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/permissions/selected-actions`)
      .json<github.ActionsGetAllowedActionsOrganizationResponse>()
  }

  /**
 * Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_set_allowed_actions_organization',
    description: `Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsSetAllowedActionsOrganizationParamsSchema,
    tags: ['actions']
  })
  async actionsSetAllowedActionsOrganization(
    params: github.ActionsSetAllowedActionsOrganizationParams
  ): Promise<github.ActionsSetAllowedActionsOrganizationResponse> {
    return this.ky
      .put(`/orgs/${params.org}/actions/permissions/selected-actions`, {
        json: pick(
          params,
          'github_owned_allowed',
          'verified_allowed',
          'patterns_allowed'
        )
      })
      .json<github.ActionsSetAllowedActionsOrganizationResponse>()
  }

  /**
 * Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization,
as well as whether GitHub Actions can submit approving pull request reviews. For more information, see
"[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)."

OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_github_actions_default_workflow_permissions_organization',
    description: `Gets the default workflow permissions granted to the \`GITHUB_TOKEN\` when running workflows in an organization,
as well as whether GitHub Actions can submit approving pull request reviews. For more information, see
"[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)."

OAuth tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganizationParamsSchema,
    tags: ['actions']
  })
  async actionsGetGithubActionsDefaultWorkflowPermissionsOrganization(
    params: github.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganizationParams
  ): Promise<github.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganizationResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/permissions/workflow`)
      .json<github.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganizationResponse>()
  }

  /**
 * Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actions
can submit approving pull request reviews. For more information, see
"[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)."

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_set_github_actions_default_workflow_permissions_organization',
    description: `Sets the default workflow permissions granted to the \`GITHUB_TOKEN\` when running workflows in an organization, and sets if GitHub Actions
can submit approving pull request reviews. For more information, see
"[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)."

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganizationParamsSchema,
    tags: ['actions']
  })
  async actionsSetGithubActionsDefaultWorkflowPermissionsOrganization(
    params: github.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganizationParams
  ): Promise<github.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganizationResponse> {
    return this.ky
      .put(`/orgs/${params.org}/actions/permissions/workflow`, {
        json: pick(
          params,
          'default_workflow_permissions',
          'can_approve_pull_request_reviews'
        )
      })
      .json<github.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganizationResponse>()
  }

  /**
 * Lists all self-hosted runner groups configured in an organization and inherited from an enterprise.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_list_self_hosted_runner_groups_for_org',
    description: `Lists all self-hosted runner groups configured in an organization and inherited from an enterprise.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsListSelfHostedRunnerGroupsForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsListSelfHostedRunnerGroupsForOrg(
    params: github.ActionsListSelfHostedRunnerGroupsForOrgParams
  ): Promise<github.ActionsListSelfHostedRunnerGroupsForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/runner-groups`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'per_page', 'page', 'visible_to_repository')
        )
      })
      .json<github.ActionsListSelfHostedRunnerGroupsForOrgResponse>()
  }

  /**
 * Creates a new self-hosted runner group for an organization.

OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_create_self_hosted_runner_group_for_org',
    description: `Creates a new self-hosted runner group for an organization.

OAuth tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsCreateSelfHostedRunnerGroupForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsCreateSelfHostedRunnerGroupForOrg(
    params: github.ActionsCreateSelfHostedRunnerGroupForOrgParams
  ): Promise<github.ActionsCreateSelfHostedRunnerGroupForOrgResponse> {
    return this.ky
      .post(`/orgs/${params.org}/actions/runner-groups`, {
        json: pick(
          params,
          'name',
          'visibility',
          'selected_repository_ids',
          'runners',
          'allows_public_repositories',
          'restricted_to_workflows',
          'selected_workflows',
          'network_configuration_id'
        )
      })
      .json<github.ActionsCreateSelfHostedRunnerGroupForOrgResponse>()
  }

  /**
 * Gets a specific self-hosted runner group for an organization.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_self_hosted_runner_group_for_org',
    description: `Gets a specific self-hosted runner group for an organization.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetSelfHostedRunnerGroupForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsGetSelfHostedRunnerGroupForOrg(
    params: github.ActionsGetSelfHostedRunnerGroupForOrgParams
  ): Promise<github.ActionsGetSelfHostedRunnerGroupForOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/actions/runner-groups/${params.runner_group_id}`,
        {}
      )
      .json<github.ActionsGetSelfHostedRunnerGroupForOrgResponse>()
  }

  /**
 * Deletes a self-hosted runner group for an organization.

OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_delete_self_hosted_runner_group_from_org',
    description: `Deletes a self-hosted runner group for an organization.

OAuth tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsDeleteSelfHostedRunnerGroupFromOrgParamsSchema,
    tags: ['actions']
  })
  async actionsDeleteSelfHostedRunnerGroupFromOrg(
    params: github.ActionsDeleteSelfHostedRunnerGroupFromOrgParams
  ): Promise<github.ActionsDeleteSelfHostedRunnerGroupFromOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/actions/runner-groups/${params.runner_group_id}`,
        {}
      )
      .json<github.ActionsDeleteSelfHostedRunnerGroupFromOrgResponse>()
  }

  /**
 * Updates the `name` and `visibility` of a self-hosted runner group in an organization.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_update_self_hosted_runner_group_for_org',
    description: `Updates the \`name\` and \`visibility\` of a self-hosted runner group in an organization.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsUpdateSelfHostedRunnerGroupForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsUpdateSelfHostedRunnerGroupForOrg(
    params: github.ActionsUpdateSelfHostedRunnerGroupForOrgParams
  ): Promise<github.ActionsUpdateSelfHostedRunnerGroupForOrgResponse> {
    return this.ky
      .patch(
        `/orgs/${params.org}/actions/runner-groups/${params.runner_group_id}`,
        {
          json: pick(
            params,
            'name',
            'visibility',
            'allows_public_repositories',
            'restricted_to_workflows',
            'selected_workflows',
            'network_configuration_id'
          )
        }
      )
      .json<github.ActionsUpdateSelfHostedRunnerGroupForOrgResponse>()
  }

  /**
 * Lists the GitHub-hosted runners in an organization group.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_list_github_hosted_runners_in_group_for_org',
    description: `Lists the GitHub-hosted runners in an organization group.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsListGithubHostedRunnersInGroupForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsListGithubHostedRunnersInGroupForOrg(
    params: github.ActionsListGithubHostedRunnersInGroupForOrgParams
  ): Promise<github.ActionsListGithubHostedRunnersInGroupForOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/actions/runner-groups/${params.runner_group_id}/hosted-runners`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ActionsListGithubHostedRunnersInGroupForOrgResponse>()
  }

  /**
 * Lists the repositories with access to a self-hosted runner group configured in an organization.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_list_repo_access_to_self_hosted_runner_group_in_org',
    description: `Lists the repositories with access to a self-hosted runner group configured in an organization.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsListRepoAccessToSelfHostedRunnerGroupInOrgParamsSchema,
    tags: ['actions']
  })
  async actionsListRepoAccessToSelfHostedRunnerGroupInOrg(
    params: github.ActionsListRepoAccessToSelfHostedRunnerGroupInOrgParams
  ): Promise<github.ActionsListRepoAccessToSelfHostedRunnerGroupInOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/actions/runner-groups/${params.runner_group_id}/repositories`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'page', 'per_page'))
        }
      )
      .json<github.ActionsListRepoAccessToSelfHostedRunnerGroupInOrgResponse>()
  }

  /**
 * Replaces the list of repositories that have access to a self-hosted runner group configured in an organization.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_set_repo_access_to_self_hosted_runner_group_in_org',
    description: `Replaces the list of repositories that have access to a self-hosted runner group configured in an organization.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgParamsSchema,
    tags: ['actions']
  })
  async actionsSetRepoAccessToSelfHostedRunnerGroupInOrg(
    params: github.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgParams
  ): Promise<github.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/actions/runner-groups/${params.runner_group_id}/repositories`,
        {
          json: pick(params, 'selected_repository_ids')
        }
      )
      .json<github.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgResponse>()
  }

  /**
 * Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)."

OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_add_repo_access_to_self_hosted_runner_group_in_org',
    description: `Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)."

OAuth tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgParamsSchema,
    tags: ['actions']
  })
  async actionsAddRepoAccessToSelfHostedRunnerGroupInOrg(
    params: github.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgParams
  ): Promise<github.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/actions/runner-groups/${params.runner_group_id}/repositories/${params.repository_id}`,
        {}
      )
      .json<github.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgResponse>()
  }

  /**
 * Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)."

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_remove_repo_access_to_self_hosted_runner_group_in_org',
    description: `Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have \`visibility\` set to \`selected\`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)."

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgParamsSchema,
    tags: ['actions']
  })
  async actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg(
    params: github.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgParams
  ): Promise<github.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/actions/runner-groups/${params.runner_group_id}/repositories/${params.repository_id}`,
        {}
      )
      .json<github.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgResponse>()
  }

  /**
 * Lists self-hosted runners that are in a specific organization group.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_list_self_hosted_runners_in_group_for_org',
    description: `Lists self-hosted runners that are in a specific organization group.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsListSelfHostedRunnersInGroupForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsListSelfHostedRunnersInGroupForOrg(
    params: github.ActionsListSelfHostedRunnersInGroupForOrgParams
  ): Promise<github.ActionsListSelfHostedRunnersInGroupForOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/actions/runner-groups/${params.runner_group_id}/runners`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ActionsListSelfHostedRunnersInGroupForOrgResponse>()
  }

  /**
 * Replaces the list of self-hosted runners that are part of an organization runner group.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_set_self_hosted_runners_in_group_for_org',
    description: `Replaces the list of self-hosted runners that are part of an organization runner group.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsSetSelfHostedRunnersInGroupForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsSetSelfHostedRunnersInGroupForOrg(
    params: github.ActionsSetSelfHostedRunnersInGroupForOrgParams
  ): Promise<github.ActionsSetSelfHostedRunnersInGroupForOrgResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/actions/runner-groups/${params.runner_group_id}/runners`,
        {
          json: pick(params, 'runners')
        }
      )
      .json<github.ActionsSetSelfHostedRunnersInGroupForOrgResponse>()
  }

  /**
 * Adds a self-hosted runner to a runner group configured in an organization.

OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_add_self_hosted_runner_to_group_for_org',
    description: `Adds a self-hosted runner to a runner group configured in an organization.

OAuth tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.ActionsAddSelfHostedRunnerToGroupForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsAddSelfHostedRunnerToGroupForOrg(
    params: github.ActionsAddSelfHostedRunnerToGroupForOrgParams
  ): Promise<github.ActionsAddSelfHostedRunnerToGroupForOrgResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/actions/runner-groups/${params.runner_group_id}/runners/${params.runner_id}`,
        {}
      )
      .json<github.ActionsAddSelfHostedRunnerToGroupForOrgResponse>()
  }

  /**
 * Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_remove_self_hosted_runner_from_group_for_org',
    description: `Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsRemoveSelfHostedRunnerFromGroupForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsRemoveSelfHostedRunnerFromGroupForOrg(
    params: github.ActionsRemoveSelfHostedRunnerFromGroupForOrgParams
  ): Promise<github.ActionsRemoveSelfHostedRunnerFromGroupForOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/actions/runner-groups/${params.runner_group_id}/runners/${params.runner_id}`,
        {}
      )
      .json<github.ActionsRemoveSelfHostedRunnerFromGroupForOrgResponse>()
  }

  /**
 * Lists all self-hosted runners configured in an organization.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_list_self_hosted_runners_for_org',
    description: `Lists all self-hosted runners configured in an organization.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, the \`repo\` scope is also required.`,
    inputSchema: github.ActionsListSelfHostedRunnersForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsListSelfHostedRunnersForOrg(
    params: github.ActionsListSelfHostedRunnersForOrgParams
  ): Promise<github.ActionsListSelfHostedRunnersForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/runners`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'name', 'per_page', 'page')
        )
      })
      .json<github.ActionsListSelfHostedRunnersForOrgResponse>()
  }

  /**
 * Lists binaries for the runner application that you can download and run.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.  If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_list_runner_applications_for_org',
    description: `Lists binaries for the runner application that you can download and run.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.  If the repository is private, the \`repo\` scope is also required.`,
    inputSchema: github.ActionsListRunnerApplicationsForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsListRunnerApplicationsForOrg(
    params: github.ActionsListRunnerApplicationsForOrgParams
  ): Promise<github.ActionsListRunnerApplicationsForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/runners/downloads`)
      .json<github.ActionsListRunnerApplicationsForOrgResponse>()
  }

  /**
 * Generates a configuration that can be passed to the runner application at startup.

The authenticated user must have admin access to the organization.

OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_generate_runner_jitconfig_for_org',
    description: `Generates a configuration that can be passed to the runner application at startup.

The authenticated user must have admin access to the organization.

OAuth tokens and personal access tokens (classic) need the\`admin:org\` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGenerateRunnerJitconfigForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsGenerateRunnerJitconfigForOrg(
    params: github.ActionsGenerateRunnerJitconfigForOrgParams
  ): Promise<github.ActionsGenerateRunnerJitconfigForOrgResponse> {
    return this.ky
      .post(`/orgs/${params.org}/actions/runners/generate-jitconfig`, {
        json: pick(params, 'name', 'runner_group_id', 'labels', 'work_folder')
      })
      .json<github.ActionsGenerateRunnerJitconfigForOrgResponse>()
  }

  /**
 * Returns a token that you can pass to the `config` script. The token expires after one hour.

For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner:

```
./config.sh --url https://github.com/octo-org --token TOKEN
```

Authenticated users must have admin access to the organization to use this endpoint.

OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_create_registration_token_for_org',
    description: `Returns a token that you can pass to the \`config\` script. The token expires after one hour.

For example, you can replace \`TOKEN\` in the following example with the registration token provided by this endpoint to configure your self-hosted runner:

\`\`\`
./config.sh --url https://github.com/octo-org --token TOKEN
\`\`\`

Authenticated users must have admin access to the organization to use this endpoint.

OAuth tokens and personal access tokens (classic) need the\`admin:org\` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsCreateRegistrationTokenForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsCreateRegistrationTokenForOrg(
    params: github.ActionsCreateRegistrationTokenForOrgParams
  ): Promise<github.ActionsCreateRegistrationTokenForOrgResponse> {
    return this.ky
      .post(`/orgs/${params.org}/actions/runners/registration-token`)
      .json<github.ActionsCreateRegistrationTokenForOrgResponse>()
  }

  /**
 * Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour.

For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization:

```
./config.sh remove --token TOKEN
```

Authenticated users must have admin access to the organization to use this endpoint.

OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_create_remove_token_for_org',
    description: `Returns a token that you can pass to the \`config\` script to remove a self-hosted runner from an organization. The token expires after one hour.

For example, you can replace \`TOKEN\` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization:

\`\`\`
./config.sh remove --token TOKEN
\`\`\`

Authenticated users must have admin access to the organization to use this endpoint.

OAuth tokens and personal access tokens (classic) need the\`admin:org\` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsCreateRemoveTokenForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsCreateRemoveTokenForOrg(
    params: github.ActionsCreateRemoveTokenForOrgParams
  ): Promise<github.ActionsCreateRemoveTokenForOrgResponse> {
    return this.ky
      .post(`/orgs/${params.org}/actions/runners/remove-token`)
      .json<github.ActionsCreateRemoveTokenForOrgResponse>()
  }

  /**
 * Gets a specific self-hosted runner configured in an organization.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_get_self_hosted_runner_for_org',
    description: `Gets a specific self-hosted runner configured in an organization.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, the \`repo\` scope is also required.`,
    inputSchema: github.ActionsGetSelfHostedRunnerForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsGetSelfHostedRunnerForOrg(
    params: github.ActionsGetSelfHostedRunnerForOrgParams
  ): Promise<github.ActionsGetSelfHostedRunnerForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/runners/${params.runner_id}`, {})
      .json<github.ActionsGetSelfHostedRunnerForOrgResponse>()
  }

  /**
 * Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_delete_self_hosted_runner_from_org',
    description: `Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth tokens and personal access tokens (classic) need the\`admin:org\` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDeleteSelfHostedRunnerFromOrgParamsSchema,
    tags: ['actions']
  })
  async actionsDeleteSelfHostedRunnerFromOrg(
    params: github.ActionsDeleteSelfHostedRunnerFromOrgParams
  ): Promise<github.ActionsDeleteSelfHostedRunnerFromOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/actions/runners/${params.runner_id}`,
        {}
      )
      .json<github.ActionsDeleteSelfHostedRunnerFromOrgResponse>()
  }

  /**
 * Lists all labels for a self-hosted runner configured in an organization.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_list_labels_for_self_hosted_runner_for_org',
    description: `Lists all labels for a self-hosted runner configured in an organization.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, the \`repo\` scope is also required.`,
    inputSchema: github.ActionsListLabelsForSelfHostedRunnerForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsListLabelsForSelfHostedRunnerForOrg(
    params: github.ActionsListLabelsForSelfHostedRunnerForOrgParams
  ): Promise<github.ActionsListLabelsForSelfHostedRunnerForOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/actions/runners/${params.runner_id}/labels`,
        {}
      )
      .json<github.ActionsListLabelsForSelfHostedRunnerForOrgResponse>()
  }

  /**
 * Adds custom labels to a self-hosted runner configured in an organization.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_add_custom_labels_to_self_hosted_runner_for_org',
    description: `Adds custom labels to a self-hosted runner configured in an organization.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsAddCustomLabelsToSelfHostedRunnerForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsAddCustomLabelsToSelfHostedRunnerForOrg(
    params: github.ActionsAddCustomLabelsToSelfHostedRunnerForOrgParams
  ): Promise<github.ActionsAddCustomLabelsToSelfHostedRunnerForOrgResponse> {
    return this.ky
      .post(
        `/orgs/${params.org}/actions/runners/${params.runner_id}/labels`,
        {
          json: pick(params, 'labels')
        }
      )
      .json<github.ActionsAddCustomLabelsToSelfHostedRunnerForOrgResponse>()
  }

  /**
 * Remove all previous custom labels and set the new custom labels for a specific
self-hosted runner configured in an organization.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_set_custom_labels_for_self_hosted_runner_for_org',
    description: `Remove all previous custom labels and set the new custom labels for a specific
self-hosted runner configured in an organization.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, the \`repo\` scope is also required.`,
    inputSchema:
      github.ActionsSetCustomLabelsForSelfHostedRunnerForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsSetCustomLabelsForSelfHostedRunnerForOrg(
    params: github.ActionsSetCustomLabelsForSelfHostedRunnerForOrgParams
  ): Promise<github.ActionsSetCustomLabelsForSelfHostedRunnerForOrgResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/actions/runners/${params.runner_id}/labels`,
        {
          json: pick(params, 'labels')
        }
      )
      .json<github.ActionsSetCustomLabelsForSelfHostedRunnerForOrgResponse>()
  }

  /**
 * Remove all custom labels from a self-hosted runner configured in an
organization. Returns the remaining read-only labels from the runner.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_remove_all_custom_labels_from_self_hosted_runner_for_org',
    description: `Remove all custom labels from a self-hosted runner configured in an
organization. Returns the remaining read-only labels from the runner.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, the \`repo\` scope is also required.`,
    inputSchema:
      github.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg(
    params: github.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrgParams
  ): Promise<github.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/actions/runners/${params.runner_id}/labels`,
        {}
      )
      .json<github.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrgResponse>()
  }

  /**
 * Remove a custom label from a self-hosted runner configured
in an organization. Returns the remaining labels from the runner.

This endpoint returns a `404 Not Found` status if the custom label is not
present on the runner.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_remove_custom_label_from_self_hosted_runner_for_org',
    description: `Remove a custom label from a self-hosted runner configured
in an organization. Returns the remaining labels from the runner.

This endpoint returns a \`404 Not Found\` status if the custom label is not
present on the runner.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, the \`repo\` scope is also required.`,
    inputSchema:
      github.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrgParamsSchema,
    tags: ['actions']
  })
  async actionsRemoveCustomLabelFromSelfHostedRunnerForOrg(
    params: github.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrgParams
  ): Promise<github.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/actions/runners/${params.runner_id}/labels/${params.name}`,
        {}
      )
      .json<github.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrgResponse>()
  }

  /**
 * Lists all secrets available in an organization without revealing their
encrypted values.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_list_org_secrets',
    description: `Lists all secrets available in an organization without revealing their
encrypted values.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, the \`repo\` scope is also required.`,
    inputSchema: github.ActionsListOrgSecretsParamsSchema,
    tags: ['actions']
  })
  async actionsListOrgSecrets(
    params: github.ActionsListOrgSecretsParams
  ): Promise<github.ActionsListOrgSecretsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/secrets`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActionsListOrgSecretsResponse>()
  }

  /**
 * Gets your public key, which you need to encrypt secrets. You need to
encrypt a secret before you can create or update secrets.

The authenticated user must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_org_public_key',
    description: `Gets your public key, which you need to encrypt secrets. You need to
encrypt a secret before you can create or update secrets.

The authenticated user must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the\`admin:org\` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetOrgPublicKeyParamsSchema,
    tags: ['actions']
  })
  async actionsGetOrgPublicKey(
    params: github.ActionsGetOrgPublicKeyParams
  ): Promise<github.ActionsGetOrgPublicKeyResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/secrets/public-key`)
      .json<github.ActionsGetOrgPublicKeyResponse>()
  }

  /**
 * Gets a single organization secret without revealing its encrypted value.

The authenticated user must have collaborator access to a repository to create, update, or read secrets

OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_org_secret',
    description: `Gets a single organization secret without revealing its encrypted value.

The authenticated user must have collaborator access to a repository to create, update, or read secrets

OAuth tokens and personal access tokens (classic) need the\`admin:org\` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetOrgSecretParamsSchema,
    tags: ['actions']
  })
  async actionsGetOrgSecret(
    params: github.ActionsGetOrgSecretParams
  ): Promise<github.ActionsGetOrgSecretResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/actions/secrets/${params.secret_name}`,
        {}
      )
      .json<github.ActionsGetOrgSecretResponse>()
  }

  /**
 * Creates or updates an organization secret with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_create_or_update_org_secret',
    description: `Creates or updates an organization secret with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the\`admin:org\` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsCreateOrUpdateOrgSecretParamsSchema,
    tags: ['actions']
  })
  async actionsCreateOrUpdateOrgSecret(
    params: github.ActionsCreateOrUpdateOrgSecretParams
  ): Promise<github.ActionsCreateOrUpdateOrgSecretResponse> {
    return this.ky
      .put(`/orgs/${params.org}/actions/secrets/${params.secret_name}`, {
        json: pick(
          params,
          'encrypted_value',
          'key_id',
          'visibility',
          'selected_repository_ids'
        )
      })
      .json<github.ActionsCreateOrUpdateOrgSecretResponse>()
  }

  /**
 * Deletes a secret in an organization using the secret name.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_delete_org_secret',
    description: `Deletes a secret in an organization using the secret name.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the\`admin:org\` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDeleteOrgSecretParamsSchema,
    tags: ['actions']
  })
  async actionsDeleteOrgSecret(
    params: github.ActionsDeleteOrgSecretParams
  ): Promise<github.ActionsDeleteOrgSecretResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/actions/secrets/${params.secret_name}`,
        {}
      )
      .json<github.ActionsDeleteOrgSecretResponse>()
  }

  /**
 * Lists all repositories that have been selected when the `visibility`
for repository access to a secret is set to `selected`.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_list_selected_repos_for_org_secret',
    description: `Lists all repositories that have been selected when the \`visibility\`
for repository access to a secret is set to \`selected\`.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, the \`repo\` scope is also required.`,
    inputSchema: github.ActionsListSelectedReposForOrgSecretParamsSchema,
    tags: ['actions']
  })
  async actionsListSelectedReposForOrgSecret(
    params: github.ActionsListSelectedReposForOrgSecretParams
  ): Promise<github.ActionsListSelectedReposForOrgSecretResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/actions/secrets/${params.secret_name}/repositories`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'page', 'per_page'))
        }
      )
      .json<github.ActionsListSelectedReposForOrgSecretResponse>()
  }

  /**
 * 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](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret).

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_set_selected_repos_for_org_secret',
    description: `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](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret).

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, the \`repo\` scope is also required.`,
    inputSchema: github.ActionsSetSelectedReposForOrgSecretParamsSchema,
    tags: ['actions']
  })
  async actionsSetSelectedReposForOrgSecret(
    params: github.ActionsSetSelectedReposForOrgSecretParams
  ): Promise<github.ActionsSetSelectedReposForOrgSecretResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/actions/secrets/${params.secret_name}/repositories`,
        {
          json: pick(params, 'selected_repository_ids')
        }
      )
      .json<github.ActionsSetSelectedReposForOrgSecretResponse>()
  }

  /**
 * Adds a repository to an organization secret when the `visibility` for
repository access is set to `selected`. For more information about setting the visibility, see [Create or
update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret).

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_add_selected_repo_to_org_secret',
    description: `Adds a repository to an organization secret when the \`visibility\` for
repository access is set to \`selected\`. For more information about setting the visibility, see [Create or
update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret).

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsAddSelectedRepoToOrgSecretParamsSchema,
    tags: ['actions']
  })
  async actionsAddSelectedRepoToOrgSecret(
    params: github.ActionsAddSelectedRepoToOrgSecretParams
  ): Promise<github.ActionsAddSelectedRepoToOrgSecretResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/actions/secrets/${params.secret_name}/repositories/${params.repository_id}`,
        {}
      )
      .json<github.ActionsAddSelectedRepoToOrgSecretResponse>()
  }

  /**
 * 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](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret).

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_remove_selected_repo_from_org_secret',
    description: `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](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret).

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, the \`repo\` scope is also required.`,
    inputSchema: github.ActionsRemoveSelectedRepoFromOrgSecretParamsSchema,
    tags: ['actions']
  })
  async actionsRemoveSelectedRepoFromOrgSecret(
    params: github.ActionsRemoveSelectedRepoFromOrgSecretParams
  ): Promise<github.ActionsRemoveSelectedRepoFromOrgSecretResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/actions/secrets/${params.secret_name}/repositories/${params.repository_id}`,
        {}
      )
      .json<github.ActionsRemoveSelectedRepoFromOrgSecretResponse>()
  }

  /**
 * Lists all organization variables.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_list_org_variables',
    description: `Lists all organization variables.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, the \`repo\` scope is also required.`,
    inputSchema: github.ActionsListOrgVariablesParamsSchema,
    tags: ['actions']
  })
  async actionsListOrgVariables(
    params: github.ActionsListOrgVariablesParams
  ): Promise<github.ActionsListOrgVariablesResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/variables`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActionsListOrgVariablesResponse>()
  }

  /**
 * Creates an organization variable that you can reference in a GitHub Actions workflow.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_create_org_variable',
    description: `Creates an organization variable that you can reference in a GitHub Actions workflow.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the\`admin:org\` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsCreateOrgVariableParamsSchema,
    tags: ['actions']
  })
  async actionsCreateOrgVariable(
    params: github.ActionsCreateOrgVariableParams
  ): Promise<github.ActionsCreateOrgVariableResponse> {
    return this.ky
      .post(`/orgs/${params.org}/actions/variables`, {
        json: pick(
          params,
          'name',
          'value',
          'visibility',
          'selected_repository_ids'
        )
      })
      .json<github.ActionsCreateOrgVariableResponse>()
  }

  /**
 * Gets a specific variable in an organization.

The authenticated user must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_org_variable',
    description: `Gets a specific variable in an organization.

The authenticated user must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the\`admin:org\` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetOrgVariableParamsSchema,
    tags: ['actions']
  })
  async actionsGetOrgVariable(
    params: github.ActionsGetOrgVariableParams
  ): Promise<github.ActionsGetOrgVariableResponse> {
    return this.ky
      .get(`/orgs/${params.org}/actions/variables/${params.name}`, {})
      .json<github.ActionsGetOrgVariableResponse>()
  }

  /**
 * Deletes an organization variable using the variable name.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_delete_org_variable',
    description: `Deletes an organization variable using the variable name.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the\`admin:org\` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDeleteOrgVariableParamsSchema,
    tags: ['actions']
  })
  async actionsDeleteOrgVariable(
    params: github.ActionsDeleteOrgVariableParams
  ): Promise<github.ActionsDeleteOrgVariableResponse> {
    return this.ky
      .delete(`/orgs/${params.org}/actions/variables/${params.name}`, {})
      .json<github.ActionsDeleteOrgVariableResponse>()
  }

  /**
 * Updates an organization variable that you can reference in a GitHub Actions workflow.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_update_org_variable',
    description: `Updates an organization variable that you can reference in a GitHub Actions workflow.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, the \`repo\` scope is also required.`,
    inputSchema: github.ActionsUpdateOrgVariableParamsSchema,
    tags: ['actions']
  })
  async actionsUpdateOrgVariable(
    params: github.ActionsUpdateOrgVariableParams
  ): Promise<github.ActionsUpdateOrgVariableResponse> {
    return this.ky
      .patch(`/orgs/${params.org}/actions/variables/${params.name}`, {
        json: pick(
          params,
          'name',
          'value',
          'visibility',
          'selected_repository_ids'
        )
      })
      .json<github.ActionsUpdateOrgVariableResponse>()
  }

  /**
 * Lists all repositories that can access an organization variable
that is available to selected repositories.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_list_selected_repos_for_org_variable',
    description: `Lists all repositories that can access an organization variable
that is available to selected repositories.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, the \`repo\` scope is also required.`,
    inputSchema: github.ActionsListSelectedReposForOrgVariableParamsSchema,
    tags: ['actions']
  })
  async actionsListSelectedReposForOrgVariable(
    params: github.ActionsListSelectedReposForOrgVariableParams
  ): Promise<github.ActionsListSelectedReposForOrgVariableResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/actions/variables/${params.name}/repositories`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'page', 'per_page'))
        }
      )
      .json<github.ActionsListSelectedReposForOrgVariableResponse>()
  }

  /**
 * Replaces all repositories for an organization variable that is available
to selected repositories. Organization variables that are available to selected
repositories have their `visibility` field set to `selected`.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_set_selected_repos_for_org_variable',
    description: `Replaces all repositories for an organization variable that is available
to selected repositories. Organization variables that are available to selected
repositories have their \`visibility\` field set to \`selected\`.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, the \`repo\` scope is also required.`,
    inputSchema: github.ActionsSetSelectedReposForOrgVariableParamsSchema,
    tags: ['actions']
  })
  async actionsSetSelectedReposForOrgVariable(
    params: github.ActionsSetSelectedReposForOrgVariableParams
  ): Promise<github.ActionsSetSelectedReposForOrgVariableResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/actions/variables/${params.name}/repositories`,
        {
          json: pick(params, 'selected_repository_ids')
        }
      )
      .json<github.ActionsSetSelectedReposForOrgVariableResponse>()
  }

  /**
 * Adds a repository to an organization variable that is available to selected repositories.
Organization variables that are available to selected repositories have their `visibility` field set to `selected`.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_add_selected_repo_to_org_variable',
    description: `Adds a repository to an organization variable that is available to selected repositories.
Organization variables that are available to selected repositories have their \`visibility\` field set to \`selected\`.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsAddSelectedRepoToOrgVariableParamsSchema,
    tags: ['actions']
  })
  async actionsAddSelectedRepoToOrgVariable(
    params: github.ActionsAddSelectedRepoToOrgVariableParams
  ): Promise<github.ActionsAddSelectedRepoToOrgVariableResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/actions/variables/${params.name}/repositories/${params.repository_id}`,
        {}
      )
      .json<github.ActionsAddSelectedRepoToOrgVariableResponse>()
  }

  /**
 * Removes a repository from an organization variable that is
available to selected repositories. Organization variables that are available to
selected repositories have their `visibility` field set to `selected`.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
 */
  @aiFunction({
    name: 'github_actions_remove_selected_repo_from_org_variable',
    description: `Removes a repository from an organization variable that is
available to selected repositories. Organization variables that are available to
selected repositories have their \`visibility\` field set to \`selected\`.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint. If the repository is private, the \`repo\` scope is also required.`,
    inputSchema: github.ActionsRemoveSelectedRepoFromOrgVariableParamsSchema,
    tags: ['actions']
  })
  async actionsRemoveSelectedRepoFromOrgVariable(
    params: github.ActionsRemoveSelectedRepoFromOrgVariableParams
  ): Promise<github.ActionsRemoveSelectedRepoFromOrgVariableResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/actions/variables/${params.name}/repositories/${params.repository_id}`,
        {}
      )
      .json<github.ActionsRemoveSelectedRepoFromOrgVariableResponse>()
  }

  /**
 * List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization.

The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required.

**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
 */
  @aiFunction({
    name: 'github_orgs_list_attestations',
    description: `List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization.

The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the \`attestations:read\` permission is required.

**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI \`attestation verify\` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).`,
    inputSchema: github.OrgsListAttestationsParamsSchema,
    tags: ['orgs']
  })
  async orgsListAttestations(
    params: github.OrgsListAttestationsParams
  ): Promise<github.OrgsListAttestationsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/attestations/${params.subject_digest}`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'per_page', 'before', 'after', 'predicate_type')
        )
      })
      .json<github.OrgsListAttestationsResponse>()
  }

  /**
   * List the users blocked by an organization.
   */
  @aiFunction({
    name: 'github_orgs_list_blocked_users',
    description: `List the users blocked by an organization.`,
    inputSchema: github.OrgsListBlockedUsersParamsSchema,
    tags: ['orgs']
  })
  async orgsListBlockedUsers(
    params: github.OrgsListBlockedUsersParams
  ): Promise<github.OrgsListBlockedUsersResponse> {
    return this.ky
      .get(`/orgs/${params.org}/blocks`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.OrgsListBlockedUsersResponse>()
  }

  /**
   * Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub.
   */
  @aiFunction({
    name: 'github_orgs_check_blocked_user',
    description: `Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub.`,
    inputSchema: github.OrgsCheckBlockedUserParamsSchema,
    tags: ['orgs']
  })
  async orgsCheckBlockedUser(
    params: github.OrgsCheckBlockedUserParams
  ): Promise<github.OrgsCheckBlockedUserResponse> {
    return this.ky
      .get(`/orgs/${params.org}/blocks/${params.username}`, {})
      .json<github.OrgsCheckBlockedUserResponse>()
  }

  /**
   * Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned.
   */
  @aiFunction({
    name: 'github_orgs_block_user',
    description: `Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned.`,
    inputSchema: github.OrgsBlockUserParamsSchema,
    tags: ['orgs']
  })
  async orgsBlockUser(
    params: github.OrgsBlockUserParams
  ): Promise<github.OrgsBlockUserResponse> {
    return this.ky
      .put(`/orgs/${params.org}/blocks/${params.username}`, {})
      .json<github.OrgsBlockUserResponse>()
  }

  /**
   * Unblocks the given user on behalf of the specified organization.
   */
  @aiFunction({
    name: 'github_orgs_unblock_user',
    description: `Unblocks the given user on behalf of the specified organization.`,
    inputSchema: github.OrgsUnblockUserParamsSchema,
    tags: ['orgs']
  })
  async orgsUnblockUser(
    params: github.OrgsUnblockUserParams
  ): Promise<github.OrgsUnblockUserResponse> {
    return this.ky
      .delete(`/orgs/${params.org}/blocks/${params.username}`, {})
      .json<github.OrgsUnblockUserResponse>()
  }

  /**
 * Lists code scanning alerts for the default branch for all eligible repositories in an organization. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."

The authenticated user must be an owner or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `security_events` or `repo`s cope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_list_alerts_for_org',
    description: `Lists code scanning alerts for the default branch for all eligible repositories in an organization. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."

The authenticated user must be an owner or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`security_events\` or \`repo\`s cope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningListAlertsForOrgParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningListAlertsForOrg(
    params: github.CodeScanningListAlertsForOrgParams
  ): Promise<github.CodeScanningListAlertsForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/code-scanning/alerts`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'tool_name',
            'tool_guid',
            'before',
            'after',
            'page',
            'per_page',
            'direction',
            'state',
            'sort',
            'severity'
          )
        )
      })
      .json<github.CodeScanningListAlertsForOrgResponse>()
  }

  /**
 * Lists all code security configurations available in an organization.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_get_configurations_for_org',
    description: `Lists all code security configurations available in an organization.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`write:org\` scope to use this endpoint.`,
    inputSchema: github.CodeSecurityGetConfigurationsForOrgParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityGetConfigurationsForOrg(
    params: github.CodeSecurityGetConfigurationsForOrgParams
  ): Promise<github.CodeSecurityGetConfigurationsForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/code-security/configurations`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'target_type', 'per_page', 'before', 'after')
        )
      })
      .json<github.CodeSecurityGetConfigurationsForOrgResponse>()
  }

  /**
 * Creates a code security configuration in an organization.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_create_configuration',
    description: `Creates a code security configuration in an organization.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`write:org\` scope to use this endpoint.`,
    inputSchema: github.CodeSecurityCreateConfigurationParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityCreateConfiguration(
    params: github.CodeSecurityCreateConfigurationParams
  ): Promise<github.CodeSecurityCreateConfigurationResponse> {
    return this.ky
      .post(`/orgs/${params.org}/code-security/configurations`, {
        json: pick(
          params,
          'name',
          'description',
          'advanced_security',
          'dependency_graph',
          'dependency_graph_autosubmit_action',
          'dependency_graph_autosubmit_action_options',
          'dependabot_alerts',
          'dependabot_security_updates',
          'code_scanning_default_setup',
          'code_scanning_default_setup_options',
          'code_scanning_delegated_alert_dismissal',
          'secret_scanning',
          'secret_scanning_push_protection',
          'secret_scanning_delegated_bypass',
          'secret_scanning_delegated_bypass_options',
          'secret_scanning_validity_checks',
          'secret_scanning_non_provider_patterns',
          'secret_scanning_generic_secrets',
          'secret_scanning_delegated_alert_dismissal',
          'private_vulnerability_reporting',
          'enforcement'
        )
      })
      .json<github.CodeSecurityCreateConfigurationResponse>()
  }

  /**
 * Lists the default code security configurations for an organization.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_get_default_configurations',
    description: `Lists the default code security configurations for an organization.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`write:org\` scope to use this endpoint.`,
    inputSchema: github.CodeSecurityGetDefaultConfigurationsParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityGetDefaultConfigurations(
    params: github.CodeSecurityGetDefaultConfigurationsParams
  ): Promise<github.CodeSecurityGetDefaultConfigurationsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/code-security/configurations/defaults`)
      .json<github.CodeSecurityGetDefaultConfigurationsResponse>()
  }

  /**
 * Detach code security configuration(s) from a set of repositories.
Repositories will retain their settings but will no longer be associated with the configuration.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_detach_configuration',
    description: `Detach code security configuration(s) from a set of repositories.
Repositories will retain their settings but will no longer be associated with the configuration.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`write:org\` scope to use this endpoint.`,
    inputSchema: github.CodeSecurityDetachConfigurationParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityDetachConfiguration(
    params: github.CodeSecurityDetachConfigurationParams
  ): Promise<github.CodeSecurityDetachConfigurationResponse> {
    return this.ky
      .delete(`/orgs/${params.org}/code-security/configurations/detach`, {
        json: pick(params, 'selected_repository_ids')
      })
      .json<github.CodeSecurityDetachConfigurationResponse>()
  }

  /**
 * Gets a code security configuration available in an organization.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_get_configuration',
    description: `Gets a code security configuration available in an organization.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`write:org\` scope to use this endpoint.`,
    inputSchema: github.CodeSecurityGetConfigurationParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityGetConfiguration(
    params: github.CodeSecurityGetConfigurationParams
  ): Promise<github.CodeSecurityGetConfigurationResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/code-security/configurations/${params.configuration_id}`,
        {}
      )
      .json<github.CodeSecurityGetConfigurationResponse>()
  }

  /**
 * Deletes the desired code security configuration from an organization.
Repositories attached to the configuration will retain their settings but will no longer be associated with
the configuration.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_delete_configuration',
    description: `Deletes the desired code security configuration from an organization.
Repositories attached to the configuration will retain their settings but will no longer be associated with
the configuration.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`write:org\` scope to use this endpoint.`,
    inputSchema: github.CodeSecurityDeleteConfigurationParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityDeleteConfiguration(
    params: github.CodeSecurityDeleteConfigurationParams
  ): Promise<github.CodeSecurityDeleteConfigurationResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/code-security/configurations/${params.configuration_id}`,
        {}
      )
      .json<github.CodeSecurityDeleteConfigurationResponse>()
  }

  /**
 * Updates a code security configuration in an organization.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_update_configuration',
    description: `Updates a code security configuration in an organization.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`write:org\` scope to use this endpoint.`,
    inputSchema: github.CodeSecurityUpdateConfigurationParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityUpdateConfiguration(
    params: github.CodeSecurityUpdateConfigurationParams
  ): Promise<github.CodeSecurityUpdateConfigurationResponse> {
    return this.ky
      .patch(
        `/orgs/${params.org}/code-security/configurations/${params.configuration_id}`,
        {
          json: pick(
            params,
            'name',
            'description',
            'advanced_security',
            'dependency_graph',
            'dependency_graph_autosubmit_action',
            'dependency_graph_autosubmit_action_options',
            'dependabot_alerts',
            'dependabot_security_updates',
            'code_scanning_default_setup',
            'code_scanning_default_setup_options',
            'code_scanning_delegated_alert_dismissal',
            'secret_scanning',
            'secret_scanning_push_protection',
            'secret_scanning_delegated_bypass',
            'secret_scanning_delegated_bypass_options',
            'secret_scanning_validity_checks',
            'secret_scanning_non_provider_patterns',
            'secret_scanning_generic_secrets',
            'secret_scanning_delegated_alert_dismissal',
            'private_vulnerability_reporting',
            'enforcement'
          )
        }
      )
      .json<github.CodeSecurityUpdateConfigurationResponse>()
  }

  /**
 * Attach a code security configuration to a set of repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration.

If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_attach_configuration',
    description: `Attach a code security configuration to a set of repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration.

If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`write:org\` scope to use this endpoint.`,
    inputSchema: github.CodeSecurityAttachConfigurationParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityAttachConfiguration(
    params: github.CodeSecurityAttachConfigurationParams
  ): Promise<github.CodeSecurityAttachConfigurationResponse> {
    return this.ky
      .post(
        `/orgs/${params.org}/code-security/configurations/${params.configuration_id}/attach`,
        {
          json: pick(params, 'scope', 'selected_repository_ids')
        }
      )
      .json<github.CodeSecurityAttachConfigurationResponse>()
  }

  /**
 * Sets a code security configuration as a default to be applied to new repositories in your organization.

This configuration will be applied to the matching repository type (all, none, public, private and internal) by default when they are created.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_set_configuration_as_default',
    description: `Sets a code security configuration as a default to be applied to new repositories in your organization.

This configuration will be applied to the matching repository type (all, none, public, private and internal) by default when they are created.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`write:org\` scope to use this endpoint.`,
    inputSchema: github.CodeSecuritySetConfigurationAsDefaultParamsSchema,
    tags: ['code-security']
  })
  async codeSecuritySetConfigurationAsDefault(
    params: github.CodeSecuritySetConfigurationAsDefaultParams
  ): Promise<github.CodeSecuritySetConfigurationAsDefaultResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/code-security/configurations/${params.configuration_id}/defaults`,
        {
          json: pick(params, 'default_for_new_repos')
        }
      )
      .json<github.CodeSecuritySetConfigurationAsDefaultResponse>()
  }

  /**
 * Lists the repositories associated with a code security configuration in an organization.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_get_repositories_for_configuration',
    description: `Lists the repositories associated with a code security configuration in an organization.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`write:org\` scope to use this endpoint.`,
    inputSchema: github.CodeSecurityGetRepositoriesForConfigurationParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityGetRepositoriesForConfiguration(
    params: github.CodeSecurityGetRepositoriesForConfigurationParams
  ): Promise<github.CodeSecurityGetRepositoriesForConfigurationResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/code-security/configurations/${params.configuration_id}/repositories`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'per_page', 'before', 'after', 'status')
          )
        }
      )
      .json<github.CodeSecurityGetRepositoriesForConfigurationResponse>()
  }

  /**
 * Lists the codespaces associated to a specified organization.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_list_in_organization',
    description: `Lists the codespaces associated to a specified organization.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesListInOrganizationParamsSchema,
    tags: ['codespaces']
  })
  async codespacesListInOrganization(
    params: github.CodespacesListInOrganizationParams
  ): Promise<github.CodespacesListInOrganizationResponse> {
    return this.ky
      .get(`/orgs/${params.org}/codespaces`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.CodespacesListInOrganizationResponse>()
  }

  /**
 * Sets which users can access codespaces in an organization. This is synonymous with granting or revoking codespaces access permissions for users according to the visibility.
OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_set_codespaces_access',
    description: `Sets which users can access codespaces in an organization. This is synonymous with granting or revoking codespaces access permissions for users according to the visibility.
OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesSetCodespacesAccessParamsSchema,
    tags: ['codespaces']
  })
  async codespacesSetCodespacesAccess(
    params: github.CodespacesSetCodespacesAccessParams
  ): Promise<github.CodespacesSetCodespacesAccessResponse> {
    return this.ky
      .put(`/orgs/${params.org}/codespaces/access`, {
        json: pick(params, 'visibility', 'selected_usernames')
      })
      .json<github.CodespacesSetCodespacesAccessResponse>()
  }

  /**
 * Codespaces for the specified users will be billed to the organization.

To use this endpoint, the access settings for the organization must be set to `selected_members`.
For information on how to change this setting, see "[Manage access control for organization codespaces](https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces)."

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_set_codespaces_access_users',
    description: `Codespaces for the specified users will be billed to the organization.

To use this endpoint, the access settings for the organization must be set to \`selected_members\`.
For information on how to change this setting, see "[Manage access control for organization codespaces](https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces)."

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesSetCodespacesAccessUsersParamsSchema,
    tags: ['codespaces']
  })
  async codespacesSetCodespacesAccessUsers(
    params: github.CodespacesSetCodespacesAccessUsersParams
  ): Promise<github.CodespacesSetCodespacesAccessUsersResponse> {
    return this.ky
      .post(`/orgs/${params.org}/codespaces/access/selected_users`, {
        json: pick(params, 'selected_usernames')
      })
      .json<github.CodespacesSetCodespacesAccessUsersResponse>()
  }

  /**
 * Codespaces for the specified users will no longer be billed to the organization.

To use this endpoint, the access settings for the organization must be set to `selected_members`.
For information on how to change this setting, see "[Manage access control for organization codespaces](https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces)."

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_delete_codespaces_access_users',
    description: `Codespaces for the specified users will no longer be billed to the organization.

To use this endpoint, the access settings for the organization must be set to \`selected_members\`.
For information on how to change this setting, see "[Manage access control for organization codespaces](https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces)."

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesDeleteCodespacesAccessUsersParamsSchema,
    tags: ['codespaces']
  })
  async codespacesDeleteCodespacesAccessUsers(
    params: github.CodespacesDeleteCodespacesAccessUsersParams
  ): Promise<github.CodespacesDeleteCodespacesAccessUsersResponse> {
    return this.ky
      .delete(`/orgs/${params.org}/codespaces/access/selected_users`, {
        json: pick(params, 'selected_usernames')
      })
      .json<github.CodespacesDeleteCodespacesAccessUsersResponse>()
  }

  /**
 * Lists all Codespaces development environment secrets available at the organization-level without revealing their encrypted
values.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_list_org_secrets',
    description: `Lists all Codespaces development environment secrets available at the organization-level without revealing their encrypted
values.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesListOrgSecretsParamsSchema,
    tags: ['codespaces']
  })
  async codespacesListOrgSecrets(
    params: github.CodespacesListOrgSecretsParams
  ): Promise<github.CodespacesListOrgSecretsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/codespaces/secrets`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.CodespacesListOrgSecretsResponse>()
  }

  /**
 * 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.
OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_get_org_public_key',
    description: `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.
OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesGetOrgPublicKeyParamsSchema,
    tags: ['codespaces']
  })
  async codespacesGetOrgPublicKey(
    params: github.CodespacesGetOrgPublicKeyParams
  ): Promise<github.CodespacesGetOrgPublicKeyResponse> {
    return this.ky
      .get(`/orgs/${params.org}/codespaces/secrets/public-key`)
      .json<github.CodespacesGetOrgPublicKeyResponse>()
  }

  /**
 * Gets an organization development environment secret without revealing its encrypted value.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_get_org_secret',
    description: `Gets an organization development environment secret without revealing its encrypted value.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesGetOrgSecretParamsSchema,
    tags: ['codespaces']
  })
  async codespacesGetOrgSecret(
    params: github.CodespacesGetOrgSecretParams
  ): Promise<github.CodespacesGetOrgSecretResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/codespaces/secrets/${params.secret_name}`,
        {}
      )
      .json<github.CodespacesGetOrgSecretResponse>()
  }

  /**
 * Creates or updates an organization development environment secret with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_create_or_update_org_secret',
    description: `Creates or updates an organization development environment secret with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesCreateOrUpdateOrgSecretParamsSchema,
    tags: ['codespaces']
  })
  async codespacesCreateOrUpdateOrgSecret(
    params: github.CodespacesCreateOrUpdateOrgSecretParams
  ): Promise<github.CodespacesCreateOrUpdateOrgSecretResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/codespaces/secrets/${params.secret_name}`,
        {
          json: pick(
            params,
            'encrypted_value',
            'key_id',
            'visibility',
            'selected_repository_ids'
          )
        }
      )
      .json<github.CodespacesCreateOrUpdateOrgSecretResponse>()
  }

  /**
 * Deletes an organization development environment secret using the secret name.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_delete_org_secret',
    description: `Deletes an organization development environment secret using the secret name.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesDeleteOrgSecretParamsSchema,
    tags: ['codespaces']
  })
  async codespacesDeleteOrgSecret(
    params: github.CodespacesDeleteOrgSecretParams
  ): Promise<github.CodespacesDeleteOrgSecretResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/codespaces/secrets/${params.secret_name}`,
        {}
      )
      .json<github.CodespacesDeleteOrgSecretResponse>()
  }

  /**
 * Lists all repositories that have been selected when the `visibility`
for repository access to a secret is set to `selected`.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_list_selected_repos_for_org_secret',
    description: `Lists all repositories that have been selected when the \`visibility\`
for repository access to a secret is set to \`selected\`.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesListSelectedReposForOrgSecretParamsSchema,
    tags: ['codespaces']
  })
  async codespacesListSelectedReposForOrgSecret(
    params: github.CodespacesListSelectedReposForOrgSecretParams
  ): Promise<github.CodespacesListSelectedReposForOrgSecretResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/codespaces/secrets/${params.secret_name}/repositories`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'page', 'per_page'))
        }
      )
      .json<github.CodespacesListSelectedReposForOrgSecretResponse>()
  }

  /**
 * Replaces all repositories for an organization development environment secret when the `visibility`
for repository access is set to `selected`. The visibility is set when you [Create
or update an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret).

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_set_selected_repos_for_org_secret',
    description: `Replaces all repositories for an organization development environment secret when the \`visibility\`
for repository access is set to \`selected\`. The visibility is set when you [Create
or update an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret).

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesSetSelectedReposForOrgSecretParamsSchema,
    tags: ['codespaces']
  })
  async codespacesSetSelectedReposForOrgSecret(
    params: github.CodespacesSetSelectedReposForOrgSecretParams
  ): Promise<github.CodespacesSetSelectedReposForOrgSecretResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/codespaces/secrets/${params.secret_name}/repositories`,
        {
          json: pick(params, 'selected_repository_ids')
        }
      )
      .json<github.CodespacesSetSelectedReposForOrgSecretResponse>()
  }

  /**
 * Adds a repository to an organization development environment secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret).
OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_add_selected_repo_to_org_secret',
    description: `Adds a repository to an organization development environment secret when the \`visibility\` for repository access is set to \`selected\`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret).
OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesAddSelectedRepoToOrgSecretParamsSchema,
    tags: ['codespaces']
  })
  async codespacesAddSelectedRepoToOrgSecret(
    params: github.CodespacesAddSelectedRepoToOrgSecretParams
  ): Promise<github.CodespacesAddSelectedRepoToOrgSecretResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/codespaces/secrets/${params.secret_name}/repositories/${params.repository_id}`,
        {}
      )
      .json<github.CodespacesAddSelectedRepoToOrgSecretResponse>()
  }

  /**
 * Removes a repository from an organization development environment secret when the `visibility`
for repository access is set to `selected`. The visibility is set when you [Create
or update an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret).

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_remove_selected_repo_from_org_secret',
    description: `Removes a repository from an organization development environment secret when the \`visibility\`
for repository access is set to \`selected\`. The visibility is set when you [Create
or update an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret).

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesRemoveSelectedRepoFromOrgSecretParamsSchema,
    tags: ['codespaces']
  })
  async codespacesRemoveSelectedRepoFromOrgSecret(
    params: github.CodespacesRemoveSelectedRepoFromOrgSecretParams
  ): Promise<github.CodespacesRemoveSelectedRepoFromOrgSecretResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/codespaces/secrets/${params.secret_name}/repositories/${params.repository_id}`,
        {}
      )
      .json<github.CodespacesRemoveSelectedRepoFromOrgSecretResponse>()
  }

  /**
 * > [!NOTE]
> This endpoint is in public preview and is subject to change.

Gets information about an organization's Copilot subscription, including seat breakdown
and feature policies. To configure these settings, go to your organization's settings on GitHub.com.
For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)."

Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription.

OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint.
 */
  @aiFunction({
    name: 'github_copilot_get_copilot_organization_details',
    description: `> [!NOTE]
> This endpoint is in public preview and is subject to change.

Gets information about an organization's Copilot subscription, including seat breakdown
and feature policies. To configure these settings, go to your organization's settings on GitHub.com.
For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)."

Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription.

OAuth app tokens and personal access tokens (classic) need either the \`manage_billing:copilot\` or \`read:org\` scopes to use this endpoint.`,
    inputSchema: github.CopilotGetCopilotOrganizationDetailsParamsSchema,
    tags: ['copilot']
  })
  async copilotGetCopilotOrganizationDetails(
    params: github.CopilotGetCopilotOrganizationDetailsParams
  ): Promise<github.CopilotGetCopilotOrganizationDetailsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/copilot/billing`)
      .json<github.CopilotGetCopilotOrganizationDetailsResponse>()
  }

  /**
 * > [!NOTE]
> This endpoint is in public preview and is subject to change.

Lists all Copilot seats for which an organization with a Copilot Business or Copilot Enterprise subscription is currently being billed.
Only organization owners can view assigned seats.

Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`.
For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)."

OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint.
 */
  @aiFunction({
    name: 'github_copilot_list_copilot_seats',
    description: `> [!NOTE]
> This endpoint is in public preview and is subject to change.

Lists all Copilot seats for which an organization with a Copilot Business or Copilot Enterprise subscription is currently being billed.
Only organization owners can view assigned seats.

Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in \`last_activity_at\`.
For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)."

OAuth app tokens and personal access tokens (classic) need either the \`manage_billing:copilot\` or \`read:org\` scopes to use this endpoint.`,
    inputSchema: github.CopilotListCopilotSeatsParamsSchema,
    tags: ['copilot']
  })
  async copilotListCopilotSeats(
    params: github.CopilotListCopilotSeatsParams
  ): Promise<github.CopilotListCopilotSeatsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/copilot/billing/seats`, {
        searchParams: sanitizeSearchParams(pick(params, 'page', 'per_page'))
      })
      .json<github.CopilotListCopilotSeatsResponse>()
  }

  /**
 * > [!NOTE]
> This endpoint is in public preview and is subject to change.

Purchases a GitHub Copilot seat for all users within each specified team.
The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)."

Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy.
For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)."
For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)."

The response contains the total number of new seats that were created and existing seats that were refreshed.

OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint.
 */
  @aiFunction({
    name: 'github_copilot_add_copilot_seats_for_teams',
    description: `> [!NOTE]
> This endpoint is in public preview and is subject to change.

Purchases a GitHub Copilot seat for all users within each specified team.
The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)."

Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy.
For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)."
For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)."

The response contains the total number of new seats that were created and existing seats that were refreshed.

OAuth app tokens and personal access tokens (classic) need either the \`manage_billing:copilot\` or \`admin:org\` scopes to use this endpoint.`,
    inputSchema: github.CopilotAddCopilotSeatsForTeamsParamsSchema,
    tags: ['copilot']
  })
  async copilotAddCopilotSeatsForTeams(
    params: github.CopilotAddCopilotSeatsForTeamsParams
  ): Promise<github.CopilotAddCopilotSeatsForTeamsResponse> {
    return this.ky
      .post(`/orgs/${params.org}/copilot/billing/selected_teams`, {
        json: pick(params, 'selected_teams')
      })
      .json<github.CopilotAddCopilotSeatsForTeamsResponse>()
  }

  /**
 * > [!NOTE]
> This endpoint is in public preview and is subject to change.

Sets seats for all members of each team specified to "pending cancellation".
This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through another team.
For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)."

Only organization owners can cancel Copilot seats for their organization members.

The response contains the total number of seats set to "pending cancellation".

OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint.
 */
  @aiFunction({
    name: 'github_copilot_cancel_copilot_seat_assignment_for_teams',
    description: `> [!NOTE]
> This endpoint is in public preview and is subject to change.

Sets seats for all members of each team specified to "pending cancellation".
This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through another team.
For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)."

Only organization owners can cancel Copilot seats for their organization members.

The response contains the total number of seats set to "pending cancellation".

OAuth app tokens and personal access tokens (classic) need either the \`manage_billing:copilot\` or \`admin:org\` scopes to use this endpoint.`,
    inputSchema: github.CopilotCancelCopilotSeatAssignmentForTeamsParamsSchema,
    tags: ['copilot']
  })
  async copilotCancelCopilotSeatAssignmentForTeams(
    params: github.CopilotCancelCopilotSeatAssignmentForTeamsParams
  ): Promise<github.CopilotCancelCopilotSeatAssignmentForTeamsResponse> {
    return this.ky
      .delete(`/orgs/${params.org}/copilot/billing/selected_teams`, {
        json: pick(params, 'selected_teams')
      })
      .json<github.CopilotCancelCopilotSeatAssignmentForTeamsResponse>()
  }

  /**
 * > [!NOTE]
> This endpoint is in public preview and is subject to change.

Purchases a GitHub Copilot seat for each user specified.
The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)."

Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy.
For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)."
For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)."

The response contains the total number of new seats that were created and existing seats that were refreshed.

OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint.
 */
  @aiFunction({
    name: 'github_copilot_add_copilot_seats_for_users',
    description: `> [!NOTE]
> This endpoint is in public preview and is subject to change.

Purchases a GitHub Copilot seat for each user specified.
The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)."

Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy.
For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)."
For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)."

The response contains the total number of new seats that were created and existing seats that were refreshed.

OAuth app tokens and personal access tokens (classic) need either the \`manage_billing:copilot\` or \`admin:org\` scopes to use this endpoint.`,
    inputSchema: github.CopilotAddCopilotSeatsForUsersParamsSchema,
    tags: ['copilot']
  })
  async copilotAddCopilotSeatsForUsers(
    params: github.CopilotAddCopilotSeatsForUsersParams
  ): Promise<github.CopilotAddCopilotSeatsForUsersResponse> {
    return this.ky
      .post(`/orgs/${params.org}/copilot/billing/selected_users`, {
        json: pick(params, 'selected_usernames')
      })
      .json<github.CopilotAddCopilotSeatsForUsersResponse>()
  }

  /**
 * > [!NOTE]
> This endpoint is in public preview and is subject to change.

Sets seats for all users specified to "pending cancellation".
This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership.
For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)."

Only organization owners can cancel Copilot seats for their organization members.

The response contains the total number of seats set to "pending cancellation".

OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint.
 */
  @aiFunction({
    name: 'github_copilot_cancel_copilot_seat_assignment_for_users',
    description: `> [!NOTE]
> This endpoint is in public preview and is subject to change.

Sets seats for all users specified to "pending cancellation".
This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership.
For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)."

Only organization owners can cancel Copilot seats for their organization members.

The response contains the total number of seats set to "pending cancellation".

OAuth app tokens and personal access tokens (classic) need either the \`manage_billing:copilot\` or \`admin:org\` scopes to use this endpoint.`,
    inputSchema: github.CopilotCancelCopilotSeatAssignmentForUsersParamsSchema,
    tags: ['copilot']
  })
  async copilotCancelCopilotSeatAssignmentForUsers(
    params: github.CopilotCancelCopilotSeatAssignmentForUsersParams
  ): Promise<github.CopilotCancelCopilotSeatAssignmentForUsersResponse> {
    return this.ky
      .delete(`/orgs/${params.org}/copilot/billing/selected_users`, {
        json: pick(params, 'selected_usernames')
      })
      .json<github.CopilotCancelCopilotSeatAssignmentForUsersResponse>()
  }

  /**
 * Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.

> [!NOTE]
> This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day.

The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,
and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
they must have telemetry enabled in their IDE.

To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization.
Only organization owners and owners and billing managers of the parent enterprise can view Copilot metrics.

OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint.
 */
  @aiFunction({
    name: 'github_copilot_copilot_metrics_for_organization',
    description: `Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.

> [!NOTE]
> This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day.

The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,
and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
they must have telemetry enabled in their IDE.

To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization.
Only organization owners and owners and billing managers of the parent enterprise can view Copilot metrics.

OAuth app tokens and personal access tokens (classic) need either the \`manage_billing:copilot\`, \`read:org\`, or \`read:enterprise\` scopes to use this endpoint.`,
    inputSchema: github.CopilotCopilotMetricsForOrganizationParamsSchema,
    tags: ['copilot']
  })
  async copilotCopilotMetricsForOrganization(
    params: github.CopilotCopilotMetricsForOrganizationParams
  ): Promise<github.CopilotCopilotMetricsForOrganizationResponse> {
    return this.ky
      .get(`/orgs/${params.org}/copilot/metrics`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'since', 'until', 'page', 'per_page')
        )
      })
      .json<github.CopilotCopilotMetricsForOrganizationResponse>()
  }

  /**
 * > [!NOTE]
> This endpoint is closing down. It will be accessible throughout February 2025, but will not return any new data after February 1st.

You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE
across an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.
See the response schema tab for detailed metrics definitions.

The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day,
and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
they must have telemetry enabled in their IDE.

Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics.

OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint.
 */
  @aiFunction({
    name: 'github_copilot_usage_metrics_for_org',
    description: `> [!NOTE]
> This endpoint is closing down. It will be accessible throughout February 2025, but will not return any new data after February 1st.

You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE
across an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.
See the response schema tab for detailed metrics definitions.

The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day,
and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
they must have telemetry enabled in their IDE.

Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics.

OAuth app tokens and personal access tokens (classic) need either the \`manage_billing:copilot\`, \`read:org\`, or \`read:enterprise\` scopes to use this endpoint.`,
    inputSchema: github.CopilotUsageMetricsForOrgParamsSchema,
    tags: ['copilot']
  })
  async copilotUsageMetricsForOrg(
    params: github.CopilotUsageMetricsForOrgParams
  ): Promise<github.CopilotUsageMetricsForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/copilot/usage`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'since', 'until', 'page', 'per_page')
        )
      })
      .json<github.CopilotUsageMetricsForOrgResponse>()
  }

  /**
 * Lists Dependabot alerts for an organization.

The authenticated user must be an owner or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
 */
  @aiFunction({
    name: 'github_dependabot_list_alerts_for_org',
    description: `Lists Dependabot alerts for an organization.

The authenticated user must be an owner or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the \`public_repo\` scope instead.`,
    inputSchema: github.DependabotListAlertsForOrgParamsSchema,
    tags: ['dependabot']
  })
  async dependabotListAlertsForOrg(
    params: github.DependabotListAlertsForOrgParams
  ): Promise<github.DependabotListAlertsForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/dependabot/alerts`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'state',
            'severity',
            'ecosystem',
            'package',
            'epss_percentage',
            'scope',
            'sort',
            'direction',
            'before',
            'after',
            'first',
            'last',
            'per_page'
          )
        )
      })
      .json<github.DependabotListAlertsForOrgResponse>()
  }

  /**
 * Lists all secrets available in an organization without revealing their
encrypted values.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_dependabot_list_org_secrets',
    description: `Lists all secrets available in an organization without revealing their
encrypted values.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.DependabotListOrgSecretsParamsSchema,
    tags: ['dependabot']
  })
  async dependabotListOrgSecrets(
    params: github.DependabotListOrgSecretsParams
  ): Promise<github.DependabotListOrgSecretsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/dependabot/secrets`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.DependabotListOrgSecretsResponse>()
  }

  /**
 * Gets your public key, which you need to encrypt secrets. You need to
encrypt a secret before you can create or update secrets.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_dependabot_get_org_public_key',
    description: `Gets your public key, which you need to encrypt secrets. You need to
encrypt a secret before you can create or update secrets.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.DependabotGetOrgPublicKeyParamsSchema,
    tags: ['dependabot']
  })
  async dependabotGetOrgPublicKey(
    params: github.DependabotGetOrgPublicKeyParams
  ): Promise<github.DependabotGetOrgPublicKeyResponse> {
    return this.ky
      .get(`/orgs/${params.org}/dependabot/secrets/public-key`)
      .json<github.DependabotGetOrgPublicKeyResponse>()
  }

  /**
 * Gets a single organization secret without revealing its encrypted value.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_dependabot_get_org_secret',
    description: `Gets a single organization secret without revealing its encrypted value.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.DependabotGetOrgSecretParamsSchema,
    tags: ['dependabot']
  })
  async dependabotGetOrgSecret(
    params: github.DependabotGetOrgSecretParams
  ): Promise<github.DependabotGetOrgSecretResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/dependabot/secrets/${params.secret_name}`,
        {}
      )
      .json<github.DependabotGetOrgSecretResponse>()
  }

  /**
 * Creates or updates an organization secret with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_dependabot_create_or_update_org_secret',
    description: `Creates or updates an organization secret with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.DependabotCreateOrUpdateOrgSecretParamsSchema,
    tags: ['dependabot']
  })
  async dependabotCreateOrUpdateOrgSecret(
    params: github.DependabotCreateOrUpdateOrgSecretParams
  ): Promise<github.DependabotCreateOrUpdateOrgSecretResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/dependabot/secrets/${params.secret_name}`,
        {
          json: pick(
            params,
            'encrypted_value',
            'key_id',
            'visibility',
            'selected_repository_ids'
          )
        }
      )
      .json<github.DependabotCreateOrUpdateOrgSecretResponse>()
  }

  /**
 * Deletes a secret in an organization using the secret name.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_dependabot_delete_org_secret',
    description: `Deletes a secret in an organization using the secret name.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.DependabotDeleteOrgSecretParamsSchema,
    tags: ['dependabot']
  })
  async dependabotDeleteOrgSecret(
    params: github.DependabotDeleteOrgSecretParams
  ): Promise<github.DependabotDeleteOrgSecretResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/dependabot/secrets/${params.secret_name}`,
        {}
      )
      .json<github.DependabotDeleteOrgSecretResponse>()
  }

  /**
 * Lists all repositories that have been selected when the `visibility`
for repository access to a secret is set to `selected`.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_dependabot_list_selected_repos_for_org_secret',
    description: `Lists all repositories that have been selected when the \`visibility\`
for repository access to a secret is set to \`selected\`.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.DependabotListSelectedReposForOrgSecretParamsSchema,
    tags: ['dependabot']
  })
  async dependabotListSelectedReposForOrgSecret(
    params: github.DependabotListSelectedReposForOrgSecretParams
  ): Promise<github.DependabotListSelectedReposForOrgSecretResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/dependabot/secrets/${params.secret_name}/repositories`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'page', 'per_page'))
        }
      )
      .json<github.DependabotListSelectedReposForOrgSecretResponse>()
  }

  /**
 * 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](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_dependabot_set_selected_repos_for_org_secret',
    description: `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](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.DependabotSetSelectedReposForOrgSecretParamsSchema,
    tags: ['dependabot']
  })
  async dependabotSetSelectedReposForOrgSecret(
    params: github.DependabotSetSelectedReposForOrgSecretParams
  ): Promise<github.DependabotSetSelectedReposForOrgSecretResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/dependabot/secrets/${params.secret_name}/repositories`,
        {
          json: pick(params, 'selected_repository_ids')
        }
      )
      .json<github.DependabotSetSelectedReposForOrgSecretResponse>()
  }

  /**
 * 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](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_dependabot_add_selected_repo_to_org_secret',
    description: `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](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.DependabotAddSelectedRepoToOrgSecretParamsSchema,
    tags: ['dependabot']
  })
  async dependabotAddSelectedRepoToOrgSecret(
    params: github.DependabotAddSelectedRepoToOrgSecretParams
  ): Promise<github.DependabotAddSelectedRepoToOrgSecretResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/dependabot/secrets/${params.secret_name}/repositories/${params.repository_id}`,
        {}
      )
      .json<github.DependabotAddSelectedRepoToOrgSecretResponse>()
  }

  /**
 * 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](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_dependabot_remove_selected_repo_from_org_secret',
    description: `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](https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret).

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.DependabotRemoveSelectedRepoFromOrgSecretParamsSchema,
    tags: ['dependabot']
  })
  async dependabotRemoveSelectedRepoFromOrgSecret(
    params: github.DependabotRemoveSelectedRepoFromOrgSecretParams
  ): Promise<github.DependabotRemoveSelectedRepoFromOrgSecretResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/dependabot/secrets/${params.secret_name}/repositories/${params.repository_id}`,
        {}
      )
      .json<github.DependabotRemoveSelectedRepoFromOrgSecretResponse>()
  }

  /**
 * Lists all packages that are in a specific organization, are readable by the requesting user, and that encountered a conflict during a Docker migration.

OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_packages_list_docker_migration_conflicting_packages_for_organization',
    description: `Lists all packages that are in a specific organization, are readable by the requesting user, and that encountered a conflict during a Docker migration.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` scope to use this endpoint.`,
    inputSchema:
      github.PackagesListDockerMigrationConflictingPackagesForOrganizationParamsSchema,
    tags: ['packages']
  })
  async packagesListDockerMigrationConflictingPackagesForOrganization(
    params: github.PackagesListDockerMigrationConflictingPackagesForOrganizationParams
  ): Promise<github.PackagesListDockerMigrationConflictingPackagesForOrganizationResponse> {
    return this.ky
      .get(`/orgs/${params.org}/docker/conflicts`)
      .json<github.PackagesListDockerMigrationConflictingPackagesForOrganizationResponse>()
  }

  /**
 * > [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
 */
  @aiFunction({
    name: 'github_activity_list_public_org_events',
    description: `> [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.`,
    inputSchema: github.ActivityListPublicOrgEventsParamsSchema,
    tags: ['activity']
  })
  async activityListPublicOrgEvents(
    params: github.ActivityListPublicOrgEventsParams
  ): Promise<github.ActivityListPublicOrgEventsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/events`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActivityListPublicOrgEventsResponse>()
  }

  /**
   * The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure.
   */
  @aiFunction({
    name: 'github_orgs_list_failed_invitations',
    description: `The return hash contains \`failed_at\` and \`failed_reason\` fields which represent the time at which the invitation failed and the reason for the failure.`,
    inputSchema: github.OrgsListFailedInvitationsParamsSchema,
    tags: ['orgs']
  })
  async orgsListFailedInvitations(
    params: github.OrgsListFailedInvitationsParams
  ): Promise<github.OrgsListFailedInvitationsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/failed_invitations`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.OrgsListFailedInvitationsResponse>()
  }

  /**
 * List webhooks for an organization.

The authenticated user must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
 */
  @aiFunction({
    name: 'github_orgs_list_webhooks',
    description: `List webhooks for an organization.

The authenticated user must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need \`admin:org_hook\` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.`,
    inputSchema: github.OrgsListWebhooksParamsSchema,
    tags: ['orgs']
  })
  async orgsListWebhooks(
    params: github.OrgsListWebhooksParams
  ): Promise<github.OrgsListWebhooksResponse> {
    return this.ky
      .get(`/orgs/${params.org}/hooks`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.OrgsListWebhooksResponse>()
  }

  /**
 * Create a hook that posts payloads in JSON format.

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or
edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
 */
  @aiFunction({
    name: 'github_orgs_create_webhook',
    description: `Create a hook that posts payloads in JSON format.

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need \`admin:org_hook\` scope. OAuth apps cannot list, view, or
edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.`,
    inputSchema: github.OrgsCreateWebhookParamsSchema,
    tags: ['orgs']
  })
  async orgsCreateWebhook(
    params: github.OrgsCreateWebhookParams
  ): Promise<github.OrgsCreateWebhookResponse> {
    return this.ky
      .post(`/orgs/${params.org}/hooks`, {
        json: pick(params, 'name', 'config', 'events', 'active')
      })
      .json<github.OrgsCreateWebhookResponse>()
  }

  /**
 * Returns a webhook configured in an organization. To get only the webhook
`config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization).

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
 */
  @aiFunction({
    name: 'github_orgs_get_webhook',
    description: `Returns a webhook configured in an organization. To get only the webhook
\`config\` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization).

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need \`admin:org_hook\` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.`,
    inputSchema: github.OrgsGetWebhookParamsSchema,
    tags: ['orgs']
  })
  async orgsGetWebhook(
    params: github.OrgsGetWebhookParams
  ): Promise<github.OrgsGetWebhookResponse> {
    return this.ky
      .get(`/orgs/${params.org}/hooks/${params.hook_id}`, {})
      .json<github.OrgsGetWebhookResponse>()
  }

  /**
 * Delete a webhook for an organization.

The authenticated user must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
 */
  @aiFunction({
    name: 'github_orgs_delete_webhook',
    description: `Delete a webhook for an organization.

The authenticated user must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need \`admin:org_hook\` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.`,
    inputSchema: github.OrgsDeleteWebhookParamsSchema,
    tags: ['orgs']
  })
  async orgsDeleteWebhook(
    params: github.OrgsDeleteWebhookParams
  ): Promise<github.OrgsDeleteWebhookResponse> {
    return this.ky
      .delete(`/orgs/${params.org}/hooks/${params.hook_id}`, {})
      .json<github.OrgsDeleteWebhookResponse>()
  }

  /**
 * Updates a webhook configured in an organization. When you update a webhook,
the `secret` will be overwritten. If you previously had a `secret` set, you must
provide the same `secret` or set a new `secret` or the secret will be removed. If
you are only updating individual webhook `config` properties, use "[Update a webhook
configuration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)".

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
 */
  @aiFunction({
    name: 'github_orgs_update_webhook',
    description: `Updates a webhook configured in an organization. When you update a webhook,
the \`secret\` will be overwritten. If you previously had a \`secret\` set, you must
provide the same \`secret\` or set a new \`secret\` or the secret will be removed. If
you are only updating individual webhook \`config\` properties, use "[Update a webhook
configuration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)".

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need \`admin:org_hook\` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.`,
    inputSchema: github.OrgsUpdateWebhookParamsSchema,
    tags: ['orgs']
  })
  async orgsUpdateWebhook(
    params: github.OrgsUpdateWebhookParams
  ): Promise<github.OrgsUpdateWebhookResponse> {
    return this.ky
      .patch(`/orgs/${params.org}/hooks/${params.hook_id}`, {
        json: pick(params, 'config', 'events', 'active', 'name')
      })
      .json<github.OrgsUpdateWebhookResponse>()
  }

  /**
 * Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)."

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
 */
  @aiFunction({
    name: 'github_orgs_get_webhook_config_for_org',
    description: `Returns the webhook configuration for an organization. To get more information about the webhook, including the \`active\` state and \`events\`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)."

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need \`admin:org_hook\` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.`,
    inputSchema: github.OrgsGetWebhookConfigForOrgParamsSchema,
    tags: ['orgs']
  })
  async orgsGetWebhookConfigForOrg(
    params: github.OrgsGetWebhookConfigForOrgParams
  ): Promise<github.OrgsGetWebhookConfigForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/hooks/${params.hook_id}/config`, {})
      .json<github.OrgsGetWebhookConfigForOrgResponse>()
  }

  /**
 * Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)."

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
 */
  @aiFunction({
    name: 'github_orgs_update_webhook_config_for_org',
    description: `Updates the webhook configuration for an organization. To update more information about the webhook, including the \`active\` state and \`events\`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)."

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need \`admin:org_hook\` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.`,
    inputSchema: github.OrgsUpdateWebhookConfigForOrgParamsSchema,
    tags: ['orgs']
  })
  async orgsUpdateWebhookConfigForOrg(
    params: github.OrgsUpdateWebhookConfigForOrgParams
  ): Promise<github.OrgsUpdateWebhookConfigForOrgResponse> {
    return this.ky
      .patch(`/orgs/${params.org}/hooks/${params.hook_id}/config`, {
        json: pick(params, 'url', 'content_type', 'secret', 'insecure_ssl')
      })
      .json<github.OrgsUpdateWebhookConfigForOrgResponse>()
  }

  /**
 * Returns a list of webhook deliveries for a webhook configured in an organization.

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
 */
  @aiFunction({
    name: 'github_orgs_list_webhook_deliveries',
    description: `Returns a list of webhook deliveries for a webhook configured in an organization.

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need \`admin:org_hook\` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.`,
    inputSchema: github.OrgsListWebhookDeliveriesParamsSchema,
    tags: ['orgs']
  })
  async orgsListWebhookDeliveries(
    params: github.OrgsListWebhookDeliveriesParams
  ): Promise<github.OrgsListWebhookDeliveriesResponse> {
    return this.ky
      .get(`/orgs/${params.org}/hooks/${params.hook_id}/deliveries`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'cursor'))
      })
      .json<github.OrgsListWebhookDeliveriesResponse>()
  }

  /**
 * Returns a delivery for a webhook configured in an organization.

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
 */
  @aiFunction({
    name: 'github_orgs_get_webhook_delivery',
    description: `Returns a delivery for a webhook configured in an organization.

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need \`admin:org_hook\` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.`,
    inputSchema: github.OrgsGetWebhookDeliveryParamsSchema,
    tags: ['orgs']
  })
  async orgsGetWebhookDelivery(
    params: github.OrgsGetWebhookDeliveryParams
  ): Promise<github.OrgsGetWebhookDeliveryResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/hooks/${params.hook_id}/deliveries/${params.delivery_id}`,
        {}
      )
      .json<github.OrgsGetWebhookDeliveryResponse>()
  }

  /**
 * Redeliver a delivery for a webhook configured in an organization.

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
 */
  @aiFunction({
    name: 'github_orgs_redeliver_webhook_delivery',
    description: `Redeliver a delivery for a webhook configured in an organization.

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need \`admin:org_hook\` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.`,
    inputSchema: github.OrgsRedeliverWebhookDeliveryParamsSchema,
    tags: ['orgs']
  })
  async orgsRedeliverWebhookDelivery(
    params: github.OrgsRedeliverWebhookDeliveryParams
  ): Promise<github.OrgsRedeliverWebhookDeliveryResponse> {
    return this.ky
      .post(
        `/orgs/${params.org}/hooks/${params.hook_id}/deliveries/${params.delivery_id}/attempts`,
        {}
      )
      .json<github.OrgsRedeliverWebhookDeliveryResponse>()
  }

  /**
 * This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event)
to be sent to the hook.

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
 */
  @aiFunction({
    name: 'github_orgs_ping_webhook',
    description: `This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event)
to be sent to the hook.

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need \`admin:org_hook\` scope. OAuth apps cannot list, view, or edit
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.`,
    inputSchema: github.OrgsPingWebhookParamsSchema,
    tags: ['orgs']
  })
  async orgsPingWebhook(
    params: github.OrgsPingWebhookParams
  ): Promise<github.OrgsPingWebhookResponse> {
    return this.ky
      .post(`/orgs/${params.org}/hooks/${params.hook_id}/pings`, {})
      .json<github.OrgsPingWebhookResponse>()
  }

  /**
   * Get API request count statistics for an actor broken down by route within a specified time frame.
   */
  @aiFunction({
    name: 'github_api_insights_get_route_stats_by_actor',
    description: `Get API request count statistics for an actor broken down by route within a specified time frame.`,
    inputSchema: github.ApiInsightsGetRouteStatsByActorParamsSchema,
    tags: ['orgs']
  })
  async apiInsightsGetRouteStatsByActor(
    params: github.ApiInsightsGetRouteStatsByActorParams
  ): Promise<github.ApiInsightsGetRouteStatsByActorResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/insights/api/route-stats/${params.actor_type}/${params.actor_id}`,
        {
          searchParams: sanitizeSearchParams(
            pick(
              params,
              'min_timestamp',
              'max_timestamp',
              'page',
              'per_page',
              'direction',
              'sort',
              'api_route_substring'
            )
          )
        }
      )
      .json<github.ApiInsightsGetRouteStatsByActorResponse>()
  }

  /**
   * Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps.
   */
  @aiFunction({
    name: 'github_api_insights_get_subject_stats',
    description: `Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps.`,
    inputSchema: github.ApiInsightsGetSubjectStatsParamsSchema,
    tags: ['orgs']
  })
  async apiInsightsGetSubjectStats(
    params: github.ApiInsightsGetSubjectStatsParams
  ): Promise<github.ApiInsightsGetSubjectStatsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/insights/api/subject-stats`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'min_timestamp',
            'max_timestamp',
            'page',
            'per_page',
            'direction',
            'sort',
            'subject_name_substring'
          )
        )
      })
      .json<github.ApiInsightsGetSubjectStatsResponse>()
  }

  /**
   * Get overall statistics of API requests made within an organization by all users and apps within a specified time frame.
   */
  @aiFunction({
    name: 'github_api_insights_get_summary_stats',
    description: `Get overall statistics of API requests made within an organization by all users and apps within a specified time frame.`,
    inputSchema: github.ApiInsightsGetSummaryStatsParamsSchema,
    tags: ['orgs']
  })
  async apiInsightsGetSummaryStats(
    params: github.ApiInsightsGetSummaryStatsParams
  ): Promise<github.ApiInsightsGetSummaryStatsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/insights/api/summary-stats`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'min_timestamp', 'max_timestamp')
        )
      })
      .json<github.ApiInsightsGetSummaryStatsResponse>()
  }

  /**
   * Get overall statistics of API requests within the organization for a user.
   */
  @aiFunction({
    name: 'github_api_insights_get_summary_stats_by_user',
    description: `Get overall statistics of API requests within the organization for a user.`,
    inputSchema: github.ApiInsightsGetSummaryStatsByUserParamsSchema,
    tags: ['orgs']
  })
  async apiInsightsGetSummaryStatsByUser(
    params: github.ApiInsightsGetSummaryStatsByUserParams
  ): Promise<github.ApiInsightsGetSummaryStatsByUserResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/insights/api/summary-stats/users/${params.user_id}`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'min_timestamp', 'max_timestamp')
          )
        }
      )
      .json<github.ApiInsightsGetSummaryStatsByUserResponse>()
  }

  /**
   * Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user.
   */
  @aiFunction({
    name: 'github_api_insights_get_summary_stats_by_actor',
    description: `Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user.`,
    inputSchema: github.ApiInsightsGetSummaryStatsByActorParamsSchema,
    tags: ['orgs']
  })
  async apiInsightsGetSummaryStatsByActor(
    params: github.ApiInsightsGetSummaryStatsByActorParams
  ): Promise<github.ApiInsightsGetSummaryStatsByActorResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/insights/api/summary-stats/${params.actor_type}/${params.actor_id}`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'min_timestamp', 'max_timestamp')
          )
        }
      )
      .json<github.ApiInsightsGetSummaryStatsByActorResponse>()
  }

  /**
   * Get the number of API requests and rate-limited requests made within an organization over a specified time period.
   */
  @aiFunction({
    name: 'github_api_insights_get_time_stats',
    description: `Get the number of API requests and rate-limited requests made within an organization over a specified time period.`,
    inputSchema: github.ApiInsightsGetTimeStatsParamsSchema,
    tags: ['orgs']
  })
  async apiInsightsGetTimeStats(
    params: github.ApiInsightsGetTimeStatsParams
  ): Promise<github.ApiInsightsGetTimeStatsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/insights/api/time-stats`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'min_timestamp', 'max_timestamp', 'timestamp_increment')
        )
      })
      .json<github.ApiInsightsGetTimeStatsResponse>()
  }

  /**
   * Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period.
   */
  @aiFunction({
    name: 'github_api_insights_get_time_stats_by_user',
    description: `Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period.`,
    inputSchema: github.ApiInsightsGetTimeStatsByUserParamsSchema,
    tags: ['orgs']
  })
  async apiInsightsGetTimeStatsByUser(
    params: github.ApiInsightsGetTimeStatsByUserParams
  ): Promise<github.ApiInsightsGetTimeStatsByUserResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/insights/api/time-stats/users/${params.user_id}`,
        {
          searchParams: sanitizeSearchParams(
            pick(
              params,
              'min_timestamp',
              'max_timestamp',
              'timestamp_increment'
            )
          )
        }
      )
      .json<github.ApiInsightsGetTimeStatsByUserResponse>()
  }

  /**
   * Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period.
   */
  @aiFunction({
    name: 'github_api_insights_get_time_stats_by_actor',
    description: `Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period.`,
    inputSchema: github.ApiInsightsGetTimeStatsByActorParamsSchema,
    tags: ['orgs']
  })
  async apiInsightsGetTimeStatsByActor(
    params: github.ApiInsightsGetTimeStatsByActorParams
  ): Promise<github.ApiInsightsGetTimeStatsByActorResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/insights/api/time-stats/${params.actor_type}/${params.actor_id}`,
        {
          searchParams: sanitizeSearchParams(
            pick(
              params,
              'min_timestamp',
              'max_timestamp',
              'timestamp_increment'
            )
          )
        }
      )
      .json<github.ApiInsightsGetTimeStatsByActorResponse>()
  }

  /**
   * Get API usage statistics within an organization for a user broken down by the type of access.
   */
  @aiFunction({
    name: 'github_api_insights_get_user_stats',
    description: `Get API usage statistics within an organization for a user broken down by the type of access.`,
    inputSchema: github.ApiInsightsGetUserStatsParamsSchema,
    tags: ['orgs']
  })
  async apiInsightsGetUserStats(
    params: github.ApiInsightsGetUserStatsParams
  ): Promise<github.ApiInsightsGetUserStatsResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/insights/api/user-stats/${params.user_id}`,
        {
          searchParams: sanitizeSearchParams(
            pick(
              params,
              'min_timestamp',
              'max_timestamp',
              'page',
              'per_page',
              'direction',
              'sort',
              'actor_name_substring'
            )
          )
        }
      )
      .json<github.ApiInsightsGetUserStatsResponse>()
  }

  /**
 * Enables an authenticated GitHub App to find the organization's installation information.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_get_org_installation',
    description: `Enables an authenticated GitHub App to find the organization's installation information.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.`,
    inputSchema: github.AppsGetOrgInstallationParamsSchema,
    tags: ['apps']
  })
  async appsGetOrgInstallation(
    params: github.AppsGetOrgInstallationParams
  ): Promise<github.AppsGetOrgInstallationResponse> {
    return this.ky
      .get(`/orgs/${params.org}/installation`)
      .json<github.AppsGetOrgInstallationResponse>()
  }

  /**
 * Lists all GitHub Apps in an organization. The installation count includes
all GitHub Apps installed on repositories in the organization.

The authenticated user must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_list_app_installations',
    description: `Lists all GitHub Apps in an organization. The installation count includes
all GitHub Apps installed on repositories in the organization.

The authenticated user must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:read\` scope to use this endpoint.`,
    inputSchema: github.OrgsListAppInstallationsParamsSchema,
    tags: ['orgs']
  })
  async orgsListAppInstallations(
    params: github.OrgsListAppInstallationsParams
  ): Promise<github.OrgsListAppInstallationsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/installations`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.OrgsListAppInstallationsResponse>()
  }

  /**
   * Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response.
   */
  @aiFunction({
    name: 'github_interactions_get_restrictions_for_org',
    description: `Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response.`,
    inputSchema: github.InteractionsGetRestrictionsForOrgParamsSchema,
    tags: ['interactions']
  })
  async interactionsGetRestrictionsForOrg(
    params: github.InteractionsGetRestrictionsForOrgParams
  ): Promise<github.InteractionsGetRestrictionsForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/interaction-limits`)
      .json<github.InteractionsGetRestrictionsForOrgResponse>()
  }

  /**
   * Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization.
   */
  @aiFunction({
    name: 'github_interactions_set_restrictions_for_org',
    description: `Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization.`,
    inputSchema: github.InteractionsSetRestrictionsForOrgParamsSchema,
    tags: ['interactions']
  })
  async interactionsSetRestrictionsForOrg(
    params: github.InteractionsSetRestrictionsForOrgParams
  ): Promise<github.InteractionsSetRestrictionsForOrgResponse> {
    return this.ky
      .put(`/orgs/${params.org}/interaction-limits`, {
        json: pick(params, 'limit', 'expiry')
      })
      .json<github.InteractionsSetRestrictionsForOrgResponse>()
  }

  /**
   * Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions.
   */
  @aiFunction({
    name: 'github_interactions_remove_restrictions_for_org',
    description: `Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions.`,
    inputSchema: github.InteractionsRemoveRestrictionsForOrgParamsSchema,
    tags: ['interactions']
  })
  async interactionsRemoveRestrictionsForOrg(
    params: github.InteractionsRemoveRestrictionsForOrgParams
  ): Promise<github.InteractionsRemoveRestrictionsForOrgResponse> {
    return this.ky
      .delete(`/orgs/${params.org}/interaction-limits`)
      .json<github.InteractionsRemoveRestrictionsForOrgResponse>()
  }

  /**
 * The return hash contains a `role` field which refers to the Organization
Invitation role and will be one of the following values: `direct_member`, `admin`,
`billing_manager`, or `hiring_manager`. If the invitee is not a GitHub
member, the `login` field in the return hash will be `null`.
 */
  @aiFunction({
    name: 'github_orgs_list_pending_invitations',
    description: `The return hash contains a \`role\` field which refers to the Organization
Invitation role and will be one of the following values: \`direct_member\`, \`admin\`,
\`billing_manager\`, or \`hiring_manager\`. If the invitee is not a GitHub
member, the \`login\` field in the return hash will be \`null\`.`,
    inputSchema: github.OrgsListPendingInvitationsParamsSchema,
    tags: ['orgs']
  })
  async orgsListPendingInvitations(
    params: github.OrgsListPendingInvitationsParams
  ): Promise<github.OrgsListPendingInvitationsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/invitations`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'per_page', 'page', 'role', 'invitation_source')
        )
      })
      .json<github.OrgsListPendingInvitationsResponse>()
  }

  /**
 * Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api).".
 */
  @aiFunction({
    name: 'github_orgs_create_invitation',
    description: `Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api).".`,
    inputSchema: github.OrgsCreateInvitationParamsSchema,
    tags: ['orgs']
  })
  async orgsCreateInvitation(
    params: github.OrgsCreateInvitationParams
  ): Promise<github.OrgsCreateInvitationResponse> {
    return this.ky
      .post(`/orgs/${params.org}/invitations`, {
        json: pick(params, 'invitee_id', 'email', 'role', 'team_ids')
      })
      .json<github.OrgsCreateInvitationResponse>()
  }

  /**
 * Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications).
 */
  @aiFunction({
    name: 'github_orgs_cancel_invitation',
    description: `Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications).`,
    inputSchema: github.OrgsCancelInvitationParamsSchema,
    tags: ['orgs']
  })
  async orgsCancelInvitation(
    params: github.OrgsCancelInvitationParams
  ): Promise<github.OrgsCancelInvitationResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/invitations/${params.invitation_id}`,
        {}
      )
      .json<github.OrgsCancelInvitationResponse>()
  }

  /**
   * List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner.
   */
  @aiFunction({
    name: 'github_orgs_list_invitation_teams',
    description: `List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner.`,
    inputSchema: github.OrgsListInvitationTeamsParamsSchema,
    tags: ['orgs']
  })
  async orgsListInvitationTeams(
    params: github.OrgsListInvitationTeamsParams
  ): Promise<github.OrgsListInvitationTeamsResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/invitations/${params.invitation_id}/teams`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.OrgsListInvitationTeamsResponse>()
  }

  /**
   * Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.
   */
  @aiFunction({
    name: 'github_orgs_list_issue_types',
    description: `Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.`,
    inputSchema: github.OrgsListIssueTypesParamsSchema,
    tags: ['orgs']
  })
  async orgsListIssueTypes(
    params: github.OrgsListIssueTypesParams
  ): Promise<github.OrgsListIssueTypesResponse> {
    return this.ky
      .get(`/orgs/${params.org}/issue-types`)
      .json<github.OrgsListIssueTypesResponse>()
  }

  /**
 * Create a new issue type for an organization.

You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).

To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_create_issue_type',
    description: `Create a new issue type for an organization.

You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).

To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.OrgsCreateIssueTypeParamsSchema,
    tags: ['orgs']
  })
  async orgsCreateIssueType(
    params: github.OrgsCreateIssueTypeParams
  ): Promise<github.OrgsCreateIssueTypeResponse> {
    return this.ky
      .post(`/orgs/${params.org}/issue-types`, {
        json: pick(
          params,
          'name',
          'is_enabled',
          'is_private',
          'description',
          'color'
        )
      })
      .json<github.OrgsCreateIssueTypeResponse>()
  }

  /**
 * Updates an issue type for an organization.

You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).

To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_update_issue_type',
    description: `Updates an issue type for an organization.

You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).

To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.OrgsUpdateIssueTypeParamsSchema,
    tags: ['orgs']
  })
  async orgsUpdateIssueType(
    params: github.OrgsUpdateIssueTypeParams
  ): Promise<github.OrgsUpdateIssueTypeResponse> {
    return this.ky
      .put(`/orgs/${params.org}/issue-types/${params.issue_type_id}`, {
        json: pick(
          params,
          'name',
          'is_enabled',
          'is_private',
          'description',
          'color'
        )
      })
      .json<github.OrgsUpdateIssueTypeResponse>()
  }

  /**
 * Deletes an issue type for an organization.

You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).

To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_delete_issue_type',
    description: `Deletes an issue type for an organization.

You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).

To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.OrgsDeleteIssueTypeParamsSchema,
    tags: ['orgs']
  })
  async orgsDeleteIssueType(
    params: github.OrgsDeleteIssueTypeParams
  ): Promise<github.OrgsDeleteIssueTypeResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/issue-types/${params.issue_type_id}`,
        {}
      )
      .json<github.OrgsDeleteIssueTypeResponse>()
  }

  /**
 * List issues in an organization assigned to the authenticated user.

> [!NOTE]
> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_issues_list_for_org',
    description: `List issues in an organization assigned to the authenticated user.

> [!NOTE]
> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.IssuesListForOrgParamsSchema,
    tags: ['issues']
  })
  async issuesListForOrg(
    params: github.IssuesListForOrgParams
  ): Promise<github.IssuesListForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/issues`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'filter',
            'state',
            'labels',
            'type',
            'sort',
            'direction',
            'since',
            'per_page',
            'page'
          )
        )
      })
      .json<github.IssuesListForOrgResponse>()
  }

  /**
   * List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.
   */
  @aiFunction({
    name: 'github_orgs_list_members',
    description: `List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.`,
    inputSchema: github.OrgsListMembersParamsSchema,
    tags: ['orgs']
  })
  async orgsListMembers(
    params: github.OrgsListMembersParams
  ): Promise<github.OrgsListMembersResponse> {
    return this.ky
      .get(`/orgs/${params.org}/members`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'filter', 'role', 'per_page', 'page')
        )
      })
      .json<github.OrgsListMembersResponse>()
  }

  /**
   * Check if a user is, publicly or privately, a member of the organization.
   */
  @aiFunction({
    name: 'github_orgs_check_membership_for_user',
    description: `Check if a user is, publicly or privately, a member of the organization.`,
    inputSchema: github.OrgsCheckMembershipForUserParamsSchema,
    tags: ['orgs']
  })
  async orgsCheckMembershipForUser(
    params: github.OrgsCheckMembershipForUserParams
  ): Promise<github.OrgsCheckMembershipForUserResponse> {
    return this.ky
      .get(`/orgs/${params.org}/members/${params.username}`, {})
      .json<github.OrgsCheckMembershipForUserResponse>()
  }

  /**
   * Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories.
   */
  @aiFunction({
    name: 'github_orgs_remove_member',
    description: `Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories.`,
    inputSchema: github.OrgsRemoveMemberParamsSchema,
    tags: ['orgs']
  })
  async orgsRemoveMember(
    params: github.OrgsRemoveMemberParams
  ): Promise<github.OrgsRemoveMemberResponse> {
    return this.ky
      .delete(`/orgs/${params.org}/members/${params.username}`, {})
      .json<github.OrgsRemoveMemberResponse>()
  }

  /**
 * Lists the codespaces that a member of an organization has for repositories in that organization.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_get_codespaces_for_user_in_org',
    description: `Lists the codespaces that a member of an organization has for repositories in that organization.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesGetCodespacesForUserInOrgParamsSchema,
    tags: ['codespaces']
  })
  async codespacesGetCodespacesForUserInOrg(
    params: github.CodespacesGetCodespacesForUserInOrgParams
  ): Promise<github.CodespacesGetCodespacesForUserInOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/members/${params.username}/codespaces`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.CodespacesGetCodespacesForUserInOrgResponse>()
  }

  /**
 * Deletes a user's codespace.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_delete_from_organization',
    description: `Deletes a user's codespace.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesDeleteFromOrganizationParamsSchema,
    tags: ['codespaces']
  })
  async codespacesDeleteFromOrganization(
    params: github.CodespacesDeleteFromOrganizationParams
  ): Promise<github.CodespacesDeleteFromOrganizationResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/members/${params.username}/codespaces/${params.codespace_name}`,
        {}
      )
      .json<github.CodespacesDeleteFromOrganizationResponse>()
  }

  /**
 * Stops a user's codespace.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_stop_in_organization',
    description: `Stops a user's codespace.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.CodespacesStopInOrganizationParamsSchema,
    tags: ['codespaces']
  })
  async codespacesStopInOrganization(
    params: github.CodespacesStopInOrganizationParams
  ): Promise<github.CodespacesStopInOrganizationResponse> {
    return this.ky
      .post(
        `/orgs/${params.org}/members/${params.username}/codespaces/${params.codespace_name}/stop`,
        {}
      )
      .json<github.CodespacesStopInOrganizationResponse>()
  }

  /**
 * > [!NOTE]
> This endpoint is in public preview and is subject to change.

Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot.

The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`.
For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)."

Only organization owners can view Copilot seat assignment details for members of their organization.

OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint.
 */
  @aiFunction({
    name: 'github_copilot_get_copilot_seat_details_for_user',
    description: `> [!NOTE]
> This endpoint is in public preview and is subject to change.

Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot.

The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in \`last_activity_at\`.
For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)."

Only organization owners can view Copilot seat assignment details for members of their organization.

OAuth app tokens and personal access tokens (classic) need either the \`manage_billing:copilot\` or \`read:org\` scopes to use this endpoint.`,
    inputSchema: github.CopilotGetCopilotSeatDetailsForUserParamsSchema,
    tags: ['copilot']
  })
  async copilotGetCopilotSeatDetailsForUser(
    params: github.CopilotGetCopilotSeatDetailsForUserParams
  ): Promise<github.CopilotGetCopilotSeatDetailsForUserResponse> {
    return this.ky
      .get(`/orgs/${params.org}/members/${params.username}/copilot`, {})
      .json<github.CopilotGetCopilotSeatDetailsForUserResponse>()
  }

  /**
   * In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status.
   */
  @aiFunction({
    name: 'github_orgs_get_membership_for_user',
    description: `In order to get a user's membership with an organization, the authenticated user must be an organization member. The \`state\` parameter in the response can be used to identify the user's membership status.`,
    inputSchema: github.OrgsGetMembershipForUserParamsSchema,
    tags: ['orgs']
  })
  async orgsGetMembershipForUser(
    params: github.OrgsGetMembershipForUserParams
  ): Promise<github.OrgsGetMembershipForUserResponse> {
    return this.ky
      .get(`/orgs/${params.org}/memberships/${params.username}`, {})
      .json<github.OrgsGetMembershipForUserResponse>()
  }

  /**
 * Only authenticated organization owners can add a member to the organization or update the member's role.

*   If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user) will be `pending` until they accept the invitation.

*   Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent.

**Rate limits**

To prevent abuse, organization owners are limited to creating 50 organization invitations for an organization within a 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period.
 */
  @aiFunction({
    name: 'github_orgs_set_membership_for_user',
    description: `Only authenticated organization owners can add a member to the organization or update the member's role.

*   If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user) will be \`pending\` until they accept the invitation.

*   Authenticated users can _update_ a user's membership by passing the \`role\` parameter. If the authenticated user changes a member's role to \`admin\`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to \`member\`, no email will be sent.

**Rate limits**

To prevent abuse, organization owners are limited to creating 50 organization invitations for an organization within a 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period.`,
    inputSchema: github.OrgsSetMembershipForUserParamsSchema,
    tags: ['orgs']
  })
  async orgsSetMembershipForUser(
    params: github.OrgsSetMembershipForUserParams
  ): Promise<github.OrgsSetMembershipForUserResponse> {
    return this.ky
      .put(`/orgs/${params.org}/memberships/${params.username}`, {
        json: pick(params, 'role')
      })
      .json<github.OrgsSetMembershipForUserResponse>()
  }

  /**
 * In order to remove a user's membership with an organization, the authenticated user must be an organization owner.

If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases.
 */
  @aiFunction({
    name: 'github_orgs_remove_membership_for_user',
    description: `In order to remove a user's membership with an organization, the authenticated user must be an organization owner.

If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases.`,
    inputSchema: github.OrgsRemoveMembershipForUserParamsSchema,
    tags: ['orgs']
  })
  async orgsRemoveMembershipForUser(
    params: github.OrgsRemoveMembershipForUserParams
  ): Promise<github.OrgsRemoveMembershipForUserResponse> {
    return this.ky
      .delete(`/orgs/${params.org}/memberships/${params.username}`, {})
      .json<github.OrgsRemoveMembershipForUserResponse>()
  }

  /**
 * Lists the most recent migrations, including both exports (which can be started through the REST API) and imports (which cannot be started using the REST API).

A list of `repositories` is only returned for export migrations.
 */
  @aiFunction({
    name: 'github_migrations_list_for_org',
    description: `Lists the most recent migrations, including both exports (which can be started through the REST API) and imports (which cannot be started using the REST API).

A list of \`repositories\` is only returned for export migrations.`,
    inputSchema: github.MigrationsListForOrgParamsSchema,
    tags: ['migrations']
  })
  async migrationsListForOrg(
    params: github.MigrationsListForOrgParams
  ): Promise<github.MigrationsListForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/migrations`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'per_page', 'page', 'exclude')
        )
      })
      .json<github.MigrationsListForOrgResponse>()
  }

  /**
   * Initiates the generation of a migration archive.
   */
  @aiFunction({
    name: 'github_migrations_start_for_org',
    description: `Initiates the generation of a migration archive.`,
    inputSchema: github.MigrationsStartForOrgParamsSchema,
    tags: ['migrations']
  })
  async migrationsStartForOrg(
    params: github.MigrationsStartForOrgParams
  ): Promise<github.MigrationsStartForOrgResponse> {
    return this.ky
      .post(`/orgs/${params.org}/migrations`, {
        json: pick(
          params,
          'repositories',
          'lock_repositories',
          'exclude_metadata',
          'exclude_git_data',
          'exclude_attachments',
          'exclude_releases',
          'exclude_owner_projects',
          'org_metadata_only',
          'exclude'
        )
      })
      .json<github.MigrationsStartForOrgResponse>()
  }

  /**
 * Fetches the status of a migration.

The `state` of a migration can be one of the following values:

*   `pending`, which means the migration hasn't started yet.
*   `exporting`, which means the migration is in progress.
*   `exported`, which means the migration finished successfully.
*   `failed`, which means the migration failed.
 */
  @aiFunction({
    name: 'github_migrations_get_status_for_org',
    description: `Fetches the status of a migration.

The \`state\` of a migration can be one of the following values:

*   \`pending\`, which means the migration hasn't started yet.
*   \`exporting\`, which means the migration is in progress.
*   \`exported\`, which means the migration finished successfully.
*   \`failed\`, which means the migration failed.`,
    inputSchema: github.MigrationsGetStatusForOrgParamsSchema,
    tags: ['migrations']
  })
  async migrationsGetStatusForOrg(
    params: github.MigrationsGetStatusForOrgParams
  ): Promise<github.MigrationsGetStatusForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/migrations/${params.migration_id}`, {
        searchParams: sanitizeSearchParams(pick(params, 'exclude'))
      })
      .json<github.MigrationsGetStatusForOrgResponse>()
  }

  /**
   * Fetches the URL to a migration archive.
   */
  @aiFunction({
    name: 'github_migrations_download_archive_for_org',
    description: `Fetches the URL to a migration archive.`,
    inputSchema: github.MigrationsDownloadArchiveForOrgParamsSchema,
    tags: ['migrations']
  })
  async migrationsDownloadArchiveForOrg(
    params: github.MigrationsDownloadArchiveForOrgParams
  ): Promise<github.MigrationsDownloadArchiveForOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/migrations/${params.migration_id}/archive`,
        {}
      )
      .json<github.MigrationsDownloadArchiveForOrgResponse>()
  }

  /**
   * Deletes a previous migration archive. Migration archives are automatically deleted after seven days.
   */
  @aiFunction({
    name: 'github_migrations_delete_archive_for_org',
    description: `Deletes a previous migration archive. Migration archives are automatically deleted after seven days.`,
    inputSchema: github.MigrationsDeleteArchiveForOrgParamsSchema,
    tags: ['migrations']
  })
  async migrationsDeleteArchiveForOrg(
    params: github.MigrationsDeleteArchiveForOrgParams
  ): Promise<github.MigrationsDeleteArchiveForOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/migrations/${params.migration_id}/archive`,
        {}
      )
      .json<github.MigrationsDeleteArchiveForOrgResponse>()
  }

  /**
   * Unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/repos/repos#delete-a-repository) when the migration is complete and you no longer need the source data.
   */
  @aiFunction({
    name: 'github_migrations_unlock_repo_for_org',
    description: `Unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/repos/repos#delete-a-repository) when the migration is complete and you no longer need the source data.`,
    inputSchema: github.MigrationsUnlockRepoForOrgParamsSchema,
    tags: ['migrations']
  })
  async migrationsUnlockRepoForOrg(
    params: github.MigrationsUnlockRepoForOrgParams
  ): Promise<github.MigrationsUnlockRepoForOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/migrations/${params.migration_id}/repos/${params.repo_name}/lock`,
        {}
      )
      .json<github.MigrationsUnlockRepoForOrgResponse>()
  }

  /**
   * List all the repositories for this organization migration.
   */
  @aiFunction({
    name: 'github_migrations_list_repos_for_org',
    description: `List all the repositories for this organization migration.`,
    inputSchema: github.MigrationsListReposForOrgParamsSchema,
    tags: ['migrations']
  })
  async migrationsListReposForOrg(
    params: github.MigrationsListReposForOrgParams
  ): Promise<github.MigrationsListReposForOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/migrations/${params.migration_id}/repositories`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.MigrationsListReposForOrgResponse>()
  }

  /**
 * Lists the organization roles available in this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

To use this endpoint, the authenticated user must be one of:

- An administrator for the organization.
- A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_list_org_roles',
    description: `Lists the organization roles available in this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

To use this endpoint, the authenticated user must be one of:

- An administrator for the organization.
- A user, or a user on a team, with the fine-grained permissions of \`read_organization_custom_org_role\` in the organization.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.OrgsListOrgRolesParamsSchema,
    tags: ['orgs']
  })
  async orgsListOrgRoles(
    params: github.OrgsListOrgRolesParams
  ): Promise<github.OrgsListOrgRolesResponse> {
    return this.ky
      .get(`/orgs/${params.org}/organization-roles`)
      .json<github.OrgsListOrgRolesResponse>()
  }

  /**
 * Removes all assigned organization roles from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

The authenticated user must be an administrator for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_revoke_all_org_roles_team',
    description: `Removes all assigned organization roles from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

The authenticated user must be an administrator for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.OrgsRevokeAllOrgRolesTeamParamsSchema,
    tags: ['orgs']
  })
  async orgsRevokeAllOrgRolesTeam(
    params: github.OrgsRevokeAllOrgRolesTeamParams
  ): Promise<github.OrgsRevokeAllOrgRolesTeamResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/organization-roles/teams/${params.team_slug}`,
        {}
      )
      .json<github.OrgsRevokeAllOrgRolesTeamResponse>()
  }

  /**
 * Assigns an organization role to a team in an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

The authenticated user must be an administrator for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_assign_team_to_org_role',
    description: `Assigns an organization role to a team in an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

The authenticated user must be an administrator for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.OrgsAssignTeamToOrgRoleParamsSchema,
    tags: ['orgs']
  })
  async orgsAssignTeamToOrgRole(
    params: github.OrgsAssignTeamToOrgRoleParams
  ): Promise<github.OrgsAssignTeamToOrgRoleResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/organization-roles/teams/${params.team_slug}/${params.role_id}`,
        {}
      )
      .json<github.OrgsAssignTeamToOrgRoleResponse>()
  }

  /**
 * Removes an organization role from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

The authenticated user must be an administrator for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_revoke_org_role_team',
    description: `Removes an organization role from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

The authenticated user must be an administrator for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.OrgsRevokeOrgRoleTeamParamsSchema,
    tags: ['orgs']
  })
  async orgsRevokeOrgRoleTeam(
    params: github.OrgsRevokeOrgRoleTeamParams
  ): Promise<github.OrgsRevokeOrgRoleTeamResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/organization-roles/teams/${params.team_slug}/${params.role_id}`,
        {}
      )
      .json<github.OrgsRevokeOrgRoleTeamResponse>()
  }

  /**
 * Revokes all assigned organization roles from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

The authenticated user must be an administrator for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_revoke_all_org_roles_user',
    description: `Revokes all assigned organization roles from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

The authenticated user must be an administrator for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.OrgsRevokeAllOrgRolesUserParamsSchema,
    tags: ['orgs']
  })
  async orgsRevokeAllOrgRolesUser(
    params: github.OrgsRevokeAllOrgRolesUserParams
  ): Promise<github.OrgsRevokeAllOrgRolesUserResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/organization-roles/users/${params.username}`,
        {}
      )
      .json<github.OrgsRevokeAllOrgRolesUserResponse>()
  }

  /**
 * Assigns an organization role to a member of an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

The authenticated user must be an administrator for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_assign_user_to_org_role',
    description: `Assigns an organization role to a member of an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

The authenticated user must be an administrator for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.OrgsAssignUserToOrgRoleParamsSchema,
    tags: ['orgs']
  })
  async orgsAssignUserToOrgRole(
    params: github.OrgsAssignUserToOrgRoleParams
  ): Promise<github.OrgsAssignUserToOrgRoleResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/organization-roles/users/${params.username}/${params.role_id}`,
        {}
      )
      .json<github.OrgsAssignUserToOrgRoleResponse>()
  }

  /**
 * Remove an organization role from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

The authenticated user must be an administrator for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_revoke_org_role_user',
    description: `Remove an organization role from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

The authenticated user must be an administrator for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.OrgsRevokeOrgRoleUserParamsSchema,
    tags: ['orgs']
  })
  async orgsRevokeOrgRoleUser(
    params: github.OrgsRevokeOrgRoleUserParams
  ): Promise<github.OrgsRevokeOrgRoleUserResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/organization-roles/users/${params.username}/${params.role_id}`,
        {}
      )
      .json<github.OrgsRevokeOrgRoleUserResponse>()
  }

  /**
 * Gets an organization role that is available to this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

To use this endpoint, the authenticated user must be one of:

- An administrator for the organization.
- A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_get_org_role',
    description: `Gets an organization role that is available to this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

To use this endpoint, the authenticated user must be one of:

- An administrator for the organization.
- A user, or a user on a team, with the fine-grained permissions of \`read_organization_custom_org_role\` in the organization.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.OrgsGetOrgRoleParamsSchema,
    tags: ['orgs']
  })
  async orgsGetOrgRole(
    params: github.OrgsGetOrgRoleParams
  ): Promise<github.OrgsGetOrgRoleResponse> {
    return this.ky
      .get(`/orgs/${params.org}/organization-roles/${params.role_id}`, {})
      .json<github.OrgsGetOrgRoleResponse>()
  }

  /**
 * Lists the teams that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

To use this endpoint, you must be an administrator for the organization.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_list_org_role_teams',
    description: `Lists the teams that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

To use this endpoint, you must be an administrator for the organization.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.OrgsListOrgRoleTeamsParamsSchema,
    tags: ['orgs']
  })
  async orgsListOrgRoleTeams(
    params: github.OrgsListOrgRoleTeamsParams
  ): Promise<github.OrgsListOrgRoleTeamsResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/organization-roles/${params.role_id}/teams`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.OrgsListOrgRoleTeamsResponse>()
  }

  /**
 * Lists organization members that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

To use this endpoint, you must be an administrator for the organization.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_list_org_role_users',
    description: `Lists organization members that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."

To use this endpoint, you must be an administrator for the organization.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.OrgsListOrgRoleUsersParamsSchema,
    tags: ['orgs']
  })
  async orgsListOrgRoleUsers(
    params: github.OrgsListOrgRoleUsersParams
  ): Promise<github.OrgsListOrgRoleUsersResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/organization-roles/${params.role_id}/users`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.OrgsListOrgRoleUsersResponse>()
  }

  /**
   * List all users who are outside collaborators of an organization.
   */
  @aiFunction({
    name: 'github_orgs_list_outside_collaborators',
    description: `List all users who are outside collaborators of an organization.`,
    inputSchema: github.OrgsListOutsideCollaboratorsParamsSchema,
    tags: ['orgs']
  })
  async orgsListOutsideCollaborators(
    params: github.OrgsListOutsideCollaboratorsParams
  ): Promise<github.OrgsListOutsideCollaboratorsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/outside_collaborators`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'filter', 'per_page', 'page')
        )
      })
      .json<github.OrgsListOutsideCollaboratorsResponse>()
  }

  /**
   * When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories).".
   */
  @aiFunction({
    name: 'github_orgs_convert_member_to_outside_collaborator',
    description: `When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories).".`,
    inputSchema: github.OrgsConvertMemberToOutsideCollaboratorParamsSchema,
    tags: ['orgs']
  })
  async orgsConvertMemberToOutsideCollaborator(
    params: github.OrgsConvertMemberToOutsideCollaboratorParams
  ): Promise<github.OrgsConvertMemberToOutsideCollaboratorResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/outside_collaborators/${params.username}`,
        {
          json: pick(params, 'async')
        }
      )
      .json<github.OrgsConvertMemberToOutsideCollaboratorResponse>()
  }

  /**
   * Removing a user from this list will remove them from all the organization's repositories.
   */
  @aiFunction({
    name: 'github_orgs_remove_outside_collaborator',
    description: `Removing a user from this list will remove them from all the organization's repositories.`,
    inputSchema: github.OrgsRemoveOutsideCollaboratorParamsSchema,
    tags: ['orgs']
  })
  async orgsRemoveOutsideCollaborator(
    params: github.OrgsRemoveOutsideCollaboratorParams
  ): Promise<github.OrgsRemoveOutsideCollaboratorResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/outside_collaborators/${params.username}`,
        {}
      )
      .json<github.OrgsRemoveOutsideCollaboratorResponse>()
  }

  /**
 * Lists packages in an organization readable by the user.

OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_list_packages_for_organization',
    description: `Lists packages in an organization readable by the user.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesListPackagesForOrganizationParamsSchema,
    tags: ['packages']
  })
  async packagesListPackagesForOrganization(
    params: github.PackagesListPackagesForOrganizationParams
  ): Promise<github.PackagesListPackagesForOrganizationResponse> {
    return this.ky
      .get(`/orgs/${params.org}/packages`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'package_type', 'visibility', 'page', 'per_page')
        )
      })
      .json<github.PackagesListPackagesForOrganizationResponse>()
  }

  /**
 * Gets a specific package in an organization.

OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_get_package_for_organization',
    description: `Gets a specific package in an organization.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesGetPackageForOrganizationParamsSchema,
    tags: ['packages']
  })
  async packagesGetPackageForOrganization(
    params: github.PackagesGetPackageForOrganizationParams
  ): Promise<github.PackagesGetPackageForOrganizationResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/packages/${params.package_type}/${params.package_name}`,
        {}
      )
      .json<github.PackagesGetPackageForOrganizationResponse>()
  }

  /**
 * Deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.

The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_delete_package_for_org',
    description: `Deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.

The authenticated user must have admin permissions in the organization to use this endpoint. If the \`package_type\` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` and \`delete:packages\` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesDeletePackageForOrgParamsSchema,
    tags: ['packages']
  })
  async packagesDeletePackageForOrg(
    params: github.PackagesDeletePackageForOrgParams
  ): Promise<github.PackagesDeletePackageForOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/packages/${params.package_type}/${params.package_name}`,
        {}
      )
      .json<github.PackagesDeletePackageForOrgResponse>()
  }

  /**
 * Restores an entire package in an organization.

You can restore a deleted package under the following conditions:
  - The package was deleted within the last 30 days.
  - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_restore_package_for_org',
    description: `Restores an entire package in an organization.

You can restore a deleted package under the following conditions:
  - The package was deleted within the last 30 days.
  - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

The authenticated user must have admin permissions in the organization to use this endpoint. If the \`package_type\` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` and \`write:packages\` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesRestorePackageForOrgParamsSchema,
    tags: ['packages']
  })
  async packagesRestorePackageForOrg(
    params: github.PackagesRestorePackageForOrgParams
  ): Promise<github.PackagesRestorePackageForOrgResponse> {
    return this.ky
      .post(
        `/orgs/${params.org}/packages/${params.package_type}/${params.package_name}/restore`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'token'))
        }
      )
      .json<github.PackagesRestorePackageForOrgResponse>()
  }

  /**
 * Lists package versions for a package owned by an organization.

OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_get_all_package_versions_for_package_owned_by_org',
    description: `Lists package versions for a package owned by an organization.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema:
      github.PackagesGetAllPackageVersionsForPackageOwnedByOrgParamsSchema,
    tags: ['packages']
  })
  async packagesGetAllPackageVersionsForPackageOwnedByOrg(
    params: github.PackagesGetAllPackageVersionsForPackageOwnedByOrgParams
  ): Promise<github.PackagesGetAllPackageVersionsForPackageOwnedByOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/packages/${params.package_type}/${params.package_name}/versions`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'page', 'per_page', 'state')
          )
        }
      )
      .json<github.PackagesGetAllPackageVersionsForPackageOwnedByOrgResponse>()
  }

  /**
 * Gets a specific package version in an organization.

OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_get_package_version_for_organization',
    description: `Gets a specific package version in an organization.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesGetPackageVersionForOrganizationParamsSchema,
    tags: ['packages']
  })
  async packagesGetPackageVersionForOrganization(
    params: github.PackagesGetPackageVersionForOrganizationParams
  ): Promise<github.PackagesGetPackageVersionForOrganizationResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/packages/${params.package_type}/${params.package_name}/versions/${params.package_version_id}`,
        {}
      )
      .json<github.PackagesGetPackageVersionForOrganizationResponse>()
  }

  /**
 * Deletes a specific package version in an organization. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.

The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_delete_package_version_for_org',
    description: `Deletes a specific package version in an organization. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.

The authenticated user must have admin permissions in the organization to use this endpoint. If the \`package_type\` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` and \`delete:packages\` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesDeletePackageVersionForOrgParamsSchema,
    tags: ['packages']
  })
  async packagesDeletePackageVersionForOrg(
    params: github.PackagesDeletePackageVersionForOrgParams
  ): Promise<github.PackagesDeletePackageVersionForOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/packages/${params.package_type}/${params.package_name}/versions/${params.package_version_id}`,
        {}
      )
      .json<github.PackagesDeletePackageVersionForOrgResponse>()
  }

  /**
 * Restores a specific package version in an organization.

You can restore a deleted package under the following conditions:
  - The package was deleted within the last 30 days.
  - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_restore_package_version_for_org',
    description: `Restores a specific package version in an organization.

You can restore a deleted package under the following conditions:
  - The package was deleted within the last 30 days.
  - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

The authenticated user must have admin permissions in the organization to use this endpoint. If the \`package_type\` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` and \`write:packages\` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesRestorePackageVersionForOrgParamsSchema,
    tags: ['packages']
  })
  async packagesRestorePackageVersionForOrg(
    params: github.PackagesRestorePackageVersionForOrgParams
  ): Promise<github.PackagesRestorePackageVersionForOrgResponse> {
    return this.ky
      .post(
        `/orgs/${params.org}/packages/${params.package_type}/${params.package_name}/versions/${params.package_version_id}/restore`,
        {}
      )
      .json<github.PackagesRestorePackageVersionForOrgResponse>()
  }

  /**
 * Lists requests from organization members to access organization resources with a fine-grained personal access token.

Only GitHub Apps can use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_list_pat_grant_requests',
    description: `Lists requests from organization members to access organization resources with a fine-grained personal access token.

Only GitHub Apps can use this endpoint.`,
    inputSchema: github.OrgsListPatGrantRequestsParamsSchema,
    tags: ['orgs']
  })
  async orgsListPatGrantRequests(
    params: github.OrgsListPatGrantRequestsParams
  ): Promise<github.OrgsListPatGrantRequestsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/personal-access-token-requests`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'per_page',
            'page',
            'sort',
            'direction',
            'owner',
            'repository',
            'permission',
            'last_used_before',
            'last_used_after',
            'token_id'
          )
        )
      })
      .json<github.OrgsListPatGrantRequestsResponse>()
  }

  /**
 * Approves or denies multiple pending requests to access organization resources via a fine-grained personal access token.

Only GitHub Apps can use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_review_pat_grant_requests_in_bulk',
    description: `Approves or denies multiple pending requests to access organization resources via a fine-grained personal access token.

Only GitHub Apps can use this endpoint.`,
    inputSchema: github.OrgsReviewPatGrantRequestsInBulkParamsSchema,
    tags: ['orgs']
  })
  async orgsReviewPatGrantRequestsInBulk(
    params: github.OrgsReviewPatGrantRequestsInBulkParams
  ): Promise<github.OrgsReviewPatGrantRequestsInBulkResponse> {
    return this.ky
      .post(`/orgs/${params.org}/personal-access-token-requests`, {
        json: pick(params, 'pat_request_ids', 'action', 'reason')
      })
      .json<github.OrgsReviewPatGrantRequestsInBulkResponse>()
  }

  /**
 * Approves or denies a pending request to access organization resources via a fine-grained personal access token.

Only GitHub Apps can use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_review_pat_grant_request',
    description: `Approves or denies a pending request to access organization resources via a fine-grained personal access token.

Only GitHub Apps can use this endpoint.`,
    inputSchema: github.OrgsReviewPatGrantRequestParamsSchema,
    tags: ['orgs']
  })
  async orgsReviewPatGrantRequest(
    params: github.OrgsReviewPatGrantRequestParams
  ): Promise<github.OrgsReviewPatGrantRequestResponse> {
    return this.ky
      .post(
        `/orgs/${params.org}/personal-access-token-requests/${params.pat_request_id}`,
        {
          json: pick(params, 'action', 'reason')
        }
      )
      .json<github.OrgsReviewPatGrantRequestResponse>()
  }

  /**
 * Lists the repositories a fine-grained personal access token request is requesting access to.

Only GitHub Apps can use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_list_pat_grant_request_repositories',
    description: `Lists the repositories a fine-grained personal access token request is requesting access to.

Only GitHub Apps can use this endpoint.`,
    inputSchema: github.OrgsListPatGrantRequestRepositoriesParamsSchema,
    tags: ['orgs']
  })
  async orgsListPatGrantRequestRepositories(
    params: github.OrgsListPatGrantRequestRepositoriesParams
  ): Promise<github.OrgsListPatGrantRequestRepositoriesResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/personal-access-token-requests/${params.pat_request_id}/repositories`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.OrgsListPatGrantRequestRepositoriesResponse>()
  }

  /**
 * Lists approved fine-grained personal access tokens owned by organization members that can access organization resources.

Only GitHub Apps can use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_list_pat_grants',
    description: `Lists approved fine-grained personal access tokens owned by organization members that can access organization resources.

Only GitHub Apps can use this endpoint.`,
    inputSchema: github.OrgsListPatGrantsParamsSchema,
    tags: ['orgs']
  })
  async orgsListPatGrants(
    params: github.OrgsListPatGrantsParams
  ): Promise<github.OrgsListPatGrantsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/personal-access-tokens`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'per_page',
            'page',
            'sort',
            'direction',
            'owner',
            'repository',
            'permission',
            'last_used_before',
            'last_used_after',
            'token_id'
          )
        )
      })
      .json<github.OrgsListPatGrantsResponse>()
  }

  /**
 * Updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access.

Only GitHub Apps can use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_update_pat_accesses',
    description: `Updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access.

Only GitHub Apps can use this endpoint.`,
    inputSchema: github.OrgsUpdatePatAccessesParamsSchema,
    tags: ['orgs']
  })
  async orgsUpdatePatAccesses(
    params: github.OrgsUpdatePatAccessesParams
  ): Promise<github.OrgsUpdatePatAccessesResponse> {
    return this.ky
      .post(`/orgs/${params.org}/personal-access-tokens`, {
        json: pick(params, 'action', 'pat_ids')
      })
      .json<github.OrgsUpdatePatAccessesResponse>()
  }

  /**
 * Updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access.

Only GitHub Apps can use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_update_pat_access',
    description: `Updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access.

Only GitHub Apps can use this endpoint.`,
    inputSchema: github.OrgsUpdatePatAccessParamsSchema,
    tags: ['orgs']
  })
  async orgsUpdatePatAccess(
    params: github.OrgsUpdatePatAccessParams
  ): Promise<github.OrgsUpdatePatAccessResponse> {
    return this.ky
      .post(
        `/orgs/${params.org}/personal-access-tokens/${params.pat_id}`,
        {
          json: pick(params, 'action')
        }
      )
      .json<github.OrgsUpdatePatAccessResponse>()
  }

  /**
 * Lists the repositories a fine-grained personal access token has access to.

Only GitHub Apps can use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_list_pat_grant_repositories',
    description: `Lists the repositories a fine-grained personal access token has access to.

Only GitHub Apps can use this endpoint.`,
    inputSchema: github.OrgsListPatGrantRepositoriesParamsSchema,
    tags: ['orgs']
  })
  async orgsListPatGrantRepositories(
    params: github.OrgsListPatGrantRepositoriesParams
  ): Promise<github.OrgsListPatGrantRepositoriesResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/personal-access-tokens/${params.pat_id}/repositories`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.OrgsListPatGrantRepositoriesResponse>()
  }

  /**
 * > [!NOTE]
> This endpoint is in public preview and is subject to change.

Lists all private registry configurations available at the organization-level without revealing their encrypted
values.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_private_registries_list_org_private_registries',
    description: `> [!NOTE]
> This endpoint is in public preview and is subject to change.

Lists all private registry configurations available at the organization-level without revealing their encrypted
values.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.PrivateRegistriesListOrgPrivateRegistriesParamsSchema,
    tags: ['private-registries']
  })
  async privateRegistriesListOrgPrivateRegistries(
    params: github.PrivateRegistriesListOrgPrivateRegistriesParams
  ): Promise<github.PrivateRegistriesListOrgPrivateRegistriesResponse> {
    return this.ky
      .get(`/orgs/${params.org}/private-registries`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.PrivateRegistriesListOrgPrivateRegistriesResponse>()
  }

  /**
 * > [!NOTE]
> This endpoint is in public preview and is subject to change.

Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_private_registries_create_org_private_registry',
    description: `> [!NOTE]
> This endpoint is in public preview and is subject to change.

Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.PrivateRegistriesCreateOrgPrivateRegistryParamsSchema,
    tags: ['private-registries']
  })
  async privateRegistriesCreateOrgPrivateRegistry(
    params: github.PrivateRegistriesCreateOrgPrivateRegistryParams
  ): Promise<github.PrivateRegistriesCreateOrgPrivateRegistryResponse> {
    return this.ky
      .post(`/orgs/${params.org}/private-registries`, {
        json: pick(
          params,
          'registry_type',
          'username',
          'encrypted_value',
          'key_id',
          'visibility',
          'selected_repository_ids'
        )
      })
      .json<github.PrivateRegistriesCreateOrgPrivateRegistryResponse>()
  }

  /**
 * > [!NOTE]
> This endpoint is in public preview and is subject to change.

Gets the org public key, which is needed to encrypt private registry secrets. You need to encrypt a secret before you can create or update secrets.

OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_private_registries_get_org_public_key',
    description: `> [!NOTE]
> This endpoint is in public preview and is subject to change.

Gets the org public key, which is needed to encrypt private registry secrets. You need to encrypt a secret before you can create or update secrets.

OAuth tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.PrivateRegistriesGetOrgPublicKeyParamsSchema,
    tags: ['private-registries']
  })
  async privateRegistriesGetOrgPublicKey(
    params: github.PrivateRegistriesGetOrgPublicKeyParams
  ): Promise<github.PrivateRegistriesGetOrgPublicKeyResponse> {
    return this.ky
      .get(`/orgs/${params.org}/private-registries/public-key`)
      .json<github.PrivateRegistriesGetOrgPublicKeyResponse>()
  }

  /**
 * > [!NOTE]
> This endpoint is in public preview and is subject to change.

Get the configuration of a single private registry defined for an organization, omitting its encrypted value.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_private_registries_get_org_private_registry',
    description: `> [!NOTE]
> This endpoint is in public preview and is subject to change.

Get the configuration of a single private registry defined for an organization, omitting its encrypted value.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.PrivateRegistriesGetOrgPrivateRegistryParamsSchema,
    tags: ['private-registries']
  })
  async privateRegistriesGetOrgPrivateRegistry(
    params: github.PrivateRegistriesGetOrgPrivateRegistryParams
  ): Promise<github.PrivateRegistriesGetOrgPrivateRegistryResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/private-registries/${params.secret_name}`,
        {}
      )
      .json<github.PrivateRegistriesGetOrgPrivateRegistryResponse>()
  }

  /**
 * > [!NOTE]
> This endpoint is in public preview and is subject to change.

Delete a private registry configuration at the organization-level.

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_private_registries_delete_org_private_registry',
    description: `> [!NOTE]
> This endpoint is in public preview and is subject to change.

Delete a private registry configuration at the organization-level.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.PrivateRegistriesDeleteOrgPrivateRegistryParamsSchema,
    tags: ['private-registries']
  })
  async privateRegistriesDeleteOrgPrivateRegistry(
    params: github.PrivateRegistriesDeleteOrgPrivateRegistryParams
  ): Promise<github.PrivateRegistriesDeleteOrgPrivateRegistryResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/private-registries/${params.secret_name}`,
        {}
      )
      .json<github.PrivateRegistriesDeleteOrgPrivateRegistryResponse>()
  }

  /**
 * > [!NOTE]
> This endpoint is in public preview and is subject to change.

Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_private_registries_update_org_private_registry',
    description: `> [!NOTE]
> This endpoint is in public preview and is subject to change.

Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.PrivateRegistriesUpdateOrgPrivateRegistryParamsSchema,
    tags: ['private-registries']
  })
  async privateRegistriesUpdateOrgPrivateRegistry(
    params: github.PrivateRegistriesUpdateOrgPrivateRegistryParams
  ): Promise<github.PrivateRegistriesUpdateOrgPrivateRegistryResponse> {
    return this.ky
      .patch(
        `/orgs/${params.org}/private-registries/${params.secret_name}`,
        {
          json: pick(
            params,
            'registry_type',
            'username',
            'encrypted_value',
            'key_id',
            'visibility',
            'selected_repository_ids'
          )
        }
      )
      .json<github.PrivateRegistriesUpdateOrgPrivateRegistryResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_list_for_org',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsListForOrgParamsSchema,
    tags: ['projects']
  })
  async projectsListForOrg(
    params: github.ProjectsListForOrgParams
  ): Promise<github.ProjectsListForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/projects`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'state', 'per_page', 'page')
        )
      })
      .json<github.ProjectsListForOrgResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_create_for_org',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsCreateForOrgParamsSchema,
    tags: ['projects']
  })
  async projectsCreateForOrg(
    params: github.ProjectsCreateForOrgParams
  ): Promise<github.ProjectsCreateForOrgResponse> {
    return this.ky
      .post(`/orgs/${params.org}/projects`, {
        json: pick(params, 'name', 'body')
      })
      .json<github.ProjectsCreateForOrgResponse>()
  }

  /**
 * Gets all custom properties defined for an organization.
Organization members can read these properties.
 */
  @aiFunction({
    name: 'github_orgs_get_all_custom_properties',
    description: `Gets all custom properties defined for an organization.
Organization members can read these properties.`,
    inputSchema: github.OrgsGetAllCustomPropertiesParamsSchema,
    tags: ['orgs']
  })
  async orgsGetAllCustomProperties(
    params: github.OrgsGetAllCustomPropertiesParams
  ): Promise<github.OrgsGetAllCustomPropertiesResponse> {
    return this.ky
      .get(`/orgs/${params.org}/properties/schema`)
      .json<github.OrgsGetAllCustomPropertiesResponse>()
  }

  /**
 * Creates new or updates existing custom properties defined for an organization in a batch.

If the property already exists, the existing property will be replaced with the new values.
Missing optional values will fall back to default values, previous values will be overwritten.
E.g. if a property exists with `values_editable_by: org_and_repo_actors` and it's updated without specifying `values_editable_by`, it will be updated to default value `org_actors`.

To use this endpoint, the authenticated user must be one of:
  - An administrator for the organization.
  - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization.
 */
  @aiFunction({
    name: 'github_orgs_create_or_update_custom_properties',
    description: `Creates new or updates existing custom properties defined for an organization in a batch.

If the property already exists, the existing property will be replaced with the new values.
Missing optional values will fall back to default values, previous values will be overwritten.
E.g. if a property exists with \`values_editable_by: org_and_repo_actors\` and it's updated without specifying \`values_editable_by\`, it will be updated to default value \`org_actors\`.

To use this endpoint, the authenticated user must be one of:
  - An administrator for the organization.
  - A user, or a user on a team, with the fine-grained permission of \`custom_properties_org_definitions_manager\` in the organization.`,
    inputSchema: github.OrgsCreateOrUpdateCustomPropertiesParamsSchema,
    tags: ['orgs']
  })
  async orgsCreateOrUpdateCustomProperties(
    params: github.OrgsCreateOrUpdateCustomPropertiesParams
  ): Promise<github.OrgsCreateOrUpdateCustomPropertiesResponse> {
    return this.ky
      .patch(`/orgs/${params.org}/properties/schema`, {
        json: pick(params, 'properties')
      })
      .json<github.OrgsCreateOrUpdateCustomPropertiesResponse>()
  }

  /**
 * Gets a custom property that is defined for an organization.
Organization members can read these properties.
 */
  @aiFunction({
    name: 'github_orgs_get_custom_property',
    description: `Gets a custom property that is defined for an organization.
Organization members can read these properties.`,
    inputSchema: github.OrgsGetCustomPropertyParamsSchema,
    tags: ['orgs']
  })
  async orgsGetCustomProperty(
    params: github.OrgsGetCustomPropertyParams
  ): Promise<github.OrgsGetCustomPropertyResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/properties/schema/${params.custom_property_name}`,
        {}
      )
      .json<github.OrgsGetCustomPropertyResponse>()
  }

  /**
 * Creates a new or updates an existing custom property that is defined for an organization.

To use this endpoint, the authenticated user must be one of:
- An administrator for the organization.
- A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization.
 */
  @aiFunction({
    name: 'github_orgs_create_or_update_custom_property',
    description: `Creates a new or updates an existing custom property that is defined for an organization.

To use this endpoint, the authenticated user must be one of:
- An administrator for the organization.
- A user, or a user on a team, with the fine-grained permission of \`custom_properties_org_definitions_manager\` in the organization.`,
    inputSchema: github.OrgsCreateOrUpdateCustomPropertyParamsSchema,
    tags: ['orgs']
  })
  async orgsCreateOrUpdateCustomProperty(
    params: github.OrgsCreateOrUpdateCustomPropertyParams
  ): Promise<github.OrgsCreateOrUpdateCustomPropertyResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/properties/schema/${params.custom_property_name}`,
        {
          json: pick(
            params,
            'value_type',
            'required',
            'default_value',
            'description',
            'allowed_values',
            'values_editable_by'
          )
        }
      )
      .json<github.OrgsCreateOrUpdateCustomPropertyResponse>()
  }

  /**
 * Removes a custom property that is defined for an organization.

To use this endpoint, the authenticated user must be one of:
  - An administrator for the organization.
  - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization.
 */
  @aiFunction({
    name: 'github_orgs_remove_custom_property',
    description: `Removes a custom property that is defined for an organization.

To use this endpoint, the authenticated user must be one of:
  - An administrator for the organization.
  - A user, or a user on a team, with the fine-grained permission of \`custom_properties_org_definitions_manager\` in the organization.`,
    inputSchema: github.OrgsRemoveCustomPropertyParamsSchema,
    tags: ['orgs']
  })
  async orgsRemoveCustomProperty(
    params: github.OrgsRemoveCustomPropertyParams
  ): Promise<github.OrgsRemoveCustomPropertyResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/properties/schema/${params.custom_property_name}`,
        {}
      )
      .json<github.OrgsRemoveCustomPropertyResponse>()
  }

  /**
 * Lists organization repositories with all of their custom property values.
Organization members can read these properties.
 */
  @aiFunction({
    name: 'github_orgs_list_custom_properties_values_for_repos',
    description: `Lists organization repositories with all of their custom property values.
Organization members can read these properties.`,
    inputSchema: github.OrgsListCustomPropertiesValuesForReposParamsSchema,
    tags: ['orgs']
  })
  async orgsListCustomPropertiesValuesForRepos(
    params: github.OrgsListCustomPropertiesValuesForReposParams
  ): Promise<github.OrgsListCustomPropertiesValuesForReposResponse> {
    return this.ky
      .get(`/orgs/${params.org}/properties/values`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'per_page', 'page', 'repository_query')
        )
      })
      .json<github.OrgsListCustomPropertiesValuesForReposResponse>()
  }

  /**
 * Create new or update existing custom property values for repositories in a batch that belong to an organization.
Each target repository will have its custom property values updated to match the values provided in the request.

A maximum of 30 repositories can be updated in a single request.

Using a value of `null` for a custom property will remove or 'unset' the property value from the repository.

To use this endpoint, the authenticated user must be one of:
  - An administrator for the organization.
  - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization.
 */
  @aiFunction({
    name: 'github_orgs_create_or_update_custom_properties_values_for_repos',
    description: `Create new or update existing custom property values for repositories in a batch that belong to an organization.
Each target repository will have its custom property values updated to match the values provided in the request.

A maximum of 30 repositories can be updated in a single request.

Using a value of \`null\` for a custom property will remove or 'unset' the property value from the repository.

To use this endpoint, the authenticated user must be one of:
  - An administrator for the organization.
  - A user, or a user on a team, with the fine-grained permission of \`custom_properties_org_values_editor\` in the organization.`,
    inputSchema:
      github.OrgsCreateOrUpdateCustomPropertiesValuesForReposParamsSchema,
    tags: ['orgs']
  })
  async orgsCreateOrUpdateCustomPropertiesValuesForRepos(
    params: github.OrgsCreateOrUpdateCustomPropertiesValuesForReposParams
  ): Promise<github.OrgsCreateOrUpdateCustomPropertiesValuesForReposResponse> {
    return this.ky
      .patch(`/orgs/${params.org}/properties/values`, {
        json: pick(params, 'repository_names', 'properties')
      })
      .json<github.OrgsCreateOrUpdateCustomPropertiesValuesForReposResponse>()
  }

  /**
   * Members of an organization can choose to have their membership publicized or not.
   */
  @aiFunction({
    name: 'github_orgs_list_public_members',
    description: `Members of an organization can choose to have their membership publicized or not.`,
    inputSchema: github.OrgsListPublicMembersParamsSchema,
    tags: ['orgs']
  })
  async orgsListPublicMembers(
    params: github.OrgsListPublicMembersParams
  ): Promise<github.OrgsListPublicMembersResponse> {
    return this.ky
      .get(`/orgs/${params.org}/public_members`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.OrgsListPublicMembersResponse>()
  }

  /**
   * Check if the provided user is a public member of the organization.
   */
  @aiFunction({
    name: 'github_orgs_check_public_membership_for_user',
    description: `Check if the provided user is a public member of the organization.`,
    inputSchema: github.OrgsCheckPublicMembershipForUserParamsSchema,
    tags: ['orgs']
  })
  async orgsCheckPublicMembershipForUser(
    params: github.OrgsCheckPublicMembershipForUserParams
  ): Promise<github.OrgsCheckPublicMembershipForUserResponse> {
    return this.ky
      .get(`/orgs/${params.org}/public_members/${params.username}`, {})
      .json<github.OrgsCheckPublicMembershipForUserResponse>()
  }

  /**
 * The user can publicize their own membership. (A user cannot publicize the membership for another user.)

Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method).".
 */
  @aiFunction({
    name: 'github_orgs_set_public_membership_for_authenticated_user',
    description: `The user can publicize their own membership. (A user cannot publicize the membership for another user.)

Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method).".`,
    inputSchema: github.OrgsSetPublicMembershipForAuthenticatedUserParamsSchema,
    tags: ['orgs']
  })
  async orgsSetPublicMembershipForAuthenticatedUser(
    params: github.OrgsSetPublicMembershipForAuthenticatedUserParams
  ): Promise<github.OrgsSetPublicMembershipForAuthenticatedUserResponse> {
    return this.ky
      .put(`/orgs/${params.org}/public_members/${params.username}`, {})
      .json<github.OrgsSetPublicMembershipForAuthenticatedUserResponse>()
  }

  /**
   * Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default.
   */
  @aiFunction({
    name: 'github_orgs_remove_public_membership_for_authenticated_user',
    description: `Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default.`,
    inputSchema:
      github.OrgsRemovePublicMembershipForAuthenticatedUserParamsSchema,
    tags: ['orgs']
  })
  async orgsRemovePublicMembershipForAuthenticatedUser(
    params: github.OrgsRemovePublicMembershipForAuthenticatedUserParams
  ): Promise<github.OrgsRemovePublicMembershipForAuthenticatedUserResponse> {
    return this.ky
      .delete(`/orgs/${params.org}/public_members/${params.username}`, {})
      .json<github.OrgsRemovePublicMembershipForAuthenticatedUserResponse>()
  }

  /**
 * Lists repositories for the specified organization.

> [!NOTE]
> In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).".
 */
  @aiFunction({
    name: 'github_repos_list_for_org',
    description: `Lists repositories for the specified organization.

> [!NOTE]
> In order to see the \`security_and_analysis\` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).".`,
    inputSchema: github.ReposListForOrgParamsSchema,
    tags: ['repos']
  })
  async reposListForOrg(
    params: github.ReposListForOrgParams
  ): Promise<github.ReposListForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/repos`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'type', 'sort', 'direction', 'per_page', 'page')
        )
      })
      .json<github.ReposListForOrgResponse>()
  }

  /**
 * Creates a new repository in the specified organization. The authenticated user must be a member of the organization.

OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository.
 */
  @aiFunction({
    name: 'github_repos_create_in_org',
    description: `Creates a new repository in the specified organization. The authenticated user must be a member of the organization.

OAuth app tokens and personal access tokens (classic) need the \`public_repo\` or \`repo\` scope to create a public repository, and \`repo\` scope to create a private repository.`,
    inputSchema: github.ReposCreateInOrgParamsSchema,
    tags: ['repos']
  })
  async reposCreateInOrg(
    params: github.ReposCreateInOrgParams
  ): Promise<github.ReposCreateInOrgResponse> {
    return this.ky
      .post(`/orgs/${params.org}/repos`, {
        json: pick(
          params,
          'name',
          'description',
          'homepage',
          'private',
          'visibility',
          'has_issues',
          'has_projects',
          'has_wiki',
          'has_downloads',
          'is_template',
          'team_id',
          'auto_init',
          'gitignore_template',
          'license_template',
          'allow_squash_merge',
          'allow_merge_commit',
          'allow_rebase_merge',
          'allow_auto_merge',
          'delete_branch_on_merge',
          'use_squash_pr_title_as_default',
          'squash_merge_commit_title',
          'squash_merge_commit_message',
          'merge_commit_title',
          'merge_commit_message',
          'custom_properties'
        )
      })
      .json<github.ReposCreateInOrgResponse>()
  }

  /**
   * Get all the repository rulesets for an organization.
   */
  @aiFunction({
    name: 'github_repos_get_org_rulesets',
    description: `Get all the repository rulesets for an organization.`,
    inputSchema: github.ReposGetOrgRulesetsParamsSchema,
    tags: ['repos']
  })
  async reposGetOrgRulesets(
    params: github.ReposGetOrgRulesetsParams
  ): Promise<github.ReposGetOrgRulesetsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/rulesets`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'per_page', 'page', 'targets')
        )
      })
      .json<github.ReposGetOrgRulesetsResponse>()
  }

  /**
   * Create a repository ruleset for an organization.
   */
  @aiFunction({
    name: 'github_repos_create_org_ruleset',
    description: `Create a repository ruleset for an organization.`,
    inputSchema: github.ReposCreateOrgRulesetParamsSchema,
    tags: ['repos']
  })
  async reposCreateOrgRuleset(
    params: github.ReposCreateOrgRulesetParams
  ): Promise<github.ReposCreateOrgRulesetResponse> {
    return this.ky
      .post(`/orgs/${params.org}/rulesets`, {
        json: pick(
          params,
          'name',
          'target',
          'enforcement',
          'bypass_actors',
          'conditions',
          'rules'
        )
      })
      .json<github.ReposCreateOrgRulesetResponse>()
  }

  /**
 * Lists suites of rule evaluations at the organization level.
For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets).".
 */
  @aiFunction({
    name: 'github_repos_get_org_rule_suites',
    description: `Lists suites of rule evaluations at the organization level.
For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets).".`,
    inputSchema: github.ReposGetOrgRuleSuitesParamsSchema,
    tags: ['repos']
  })
  async reposGetOrgRuleSuites(
    params: github.ReposGetOrgRuleSuitesParams
  ): Promise<github.ReposGetOrgRuleSuitesResponse> {
    return this.ky
      .get(`/orgs/${params.org}/rulesets/rule-suites`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'ref',
            'repository_name',
            'time_period',
            'actor_name',
            'rule_suite_result',
            'per_page',
            'page'
          )
        )
      })
      .json<github.ReposGetOrgRuleSuitesResponse>()
  }

  /**
 * Gets information about a suite of rule evaluations from within an organization.
For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets).".
 */
  @aiFunction({
    name: 'github_repos_get_org_rule_suite',
    description: `Gets information about a suite of rule evaluations from within an organization.
For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets).".`,
    inputSchema: github.ReposGetOrgRuleSuiteParamsSchema,
    tags: ['repos']
  })
  async reposGetOrgRuleSuite(
    params: github.ReposGetOrgRuleSuiteParams
  ): Promise<github.ReposGetOrgRuleSuiteResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/rulesets/rule-suites/${params.rule_suite_id}`,
        {}
      )
      .json<github.ReposGetOrgRuleSuiteResponse>()
  }

  /**
 * Get a repository ruleset for an organization.

**Note:** To prevent leaking sensitive information, the `bypass_actors` property is only returned if the user
making the API request has write access to the ruleset.
 */
  @aiFunction({
    name: 'github_repos_get_org_ruleset',
    description: `Get a repository ruleset for an organization.

**Note:** To prevent leaking sensitive information, the \`bypass_actors\` property is only returned if the user
making the API request has write access to the ruleset.`,
    inputSchema: github.ReposGetOrgRulesetParamsSchema,
    tags: ['repos']
  })
  async reposGetOrgRuleset(
    params: github.ReposGetOrgRulesetParams
  ): Promise<github.ReposGetOrgRulesetResponse> {
    return this.ky
      .get(`/orgs/${params.org}/rulesets/${params.ruleset_id}`, {})
      .json<github.ReposGetOrgRulesetResponse>()
  }

  /**
   * Update a ruleset for an organization.
   */
  @aiFunction({
    name: 'github_repos_update_org_ruleset',
    description: `Update a ruleset for an organization.`,
    inputSchema: github.ReposUpdateOrgRulesetParamsSchema,
    tags: ['repos']
  })
  async reposUpdateOrgRuleset(
    params: github.ReposUpdateOrgRulesetParams
  ): Promise<github.ReposUpdateOrgRulesetResponse> {
    return this.ky
      .put(`/orgs/${params.org}/rulesets/${params.ruleset_id}`, {
        json: pick(
          params,
          'name',
          'target',
          'enforcement',
          'bypass_actors',
          'conditions',
          'rules'
        )
      })
      .json<github.ReposUpdateOrgRulesetResponse>()
  }

  /**
   * Delete a ruleset for an organization.
   */
  @aiFunction({
    name: 'github_repos_delete_org_ruleset',
    description: `Delete a ruleset for an organization.`,
    inputSchema: github.ReposDeleteOrgRulesetParamsSchema,
    tags: ['repos']
  })
  async reposDeleteOrgRuleset(
    params: github.ReposDeleteOrgRulesetParams
  ): Promise<github.ReposDeleteOrgRulesetResponse> {
    return this.ky
      .delete(`/orgs/${params.org}/rulesets/${params.ruleset_id}`, {})
      .json<github.ReposDeleteOrgRulesetResponse>()
  }

  /**
   * Get the history of an organization ruleset.
   */
  @aiFunction({
    name: 'github_orgs_get_org_ruleset_history',
    description: `Get the history of an organization ruleset.`,
    inputSchema: github.OrgsGetOrgRulesetHistoryParamsSchema,
    tags: ['orgs']
  })
  async orgsGetOrgRulesetHistory(
    params: github.OrgsGetOrgRulesetHistoryParams
  ): Promise<github.OrgsGetOrgRulesetHistoryResponse> {
    return this.ky
      .get(`/orgs/${params.org}/rulesets/${params.ruleset_id}/history`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.OrgsGetOrgRulesetHistoryResponse>()
  }

  /**
   * Get a version of an organization ruleset.
   */
  @aiFunction({
    name: 'github_orgs_get_org_ruleset_version',
    description: `Get a version of an organization ruleset.`,
    inputSchema: github.OrgsGetOrgRulesetVersionParamsSchema,
    tags: ['orgs']
  })
  async orgsGetOrgRulesetVersion(
    params: github.OrgsGetOrgRulesetVersionParams
  ): Promise<github.OrgsGetOrgRulesetVersionResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/rulesets/${params.ruleset_id}/history/${params.version_id}`,
        {}
      )
      .json<github.OrgsGetOrgRulesetVersionResponse>()
  }

  /**
 * Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
 */
  @aiFunction({
    name: 'github_secret_scanning_list_alerts_for_org',
    description: `Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`security_events\` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the \`public_repo\` scope instead.`,
    inputSchema: github.SecretScanningListAlertsForOrgParamsSchema,
    tags: ['secret-scanning']
  })
  async secretScanningListAlertsForOrg(
    params: github.SecretScanningListAlertsForOrgParams
  ): Promise<github.SecretScanningListAlertsForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/secret-scanning/alerts`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'state',
            'secret_type',
            'resolution',
            'sort',
            'direction',
            'page',
            'per_page',
            'before',
            'after',
            'validity',
            'is_publicly_leaked',
            'is_multi_repo'
          )
        )
      })
      .json<github.SecretScanningListAlertsForOrgResponse>()
  }

  /**
 * Lists repository security advisories for an organization.

The authenticated user must be an owner or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_security_advisories_list_org_repository_advisories',
    description: `Lists repository security advisories for an organization.

The authenticated user must be an owner or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`repository_advisories:write\` scope to use this endpoint.`,
    inputSchema:
      github.SecurityAdvisoriesListOrgRepositoryAdvisoriesParamsSchema,
    tags: ['security-advisories']
  })
  async securityAdvisoriesListOrgRepositoryAdvisories(
    params: github.SecurityAdvisoriesListOrgRepositoryAdvisoriesParams
  ): Promise<github.SecurityAdvisoriesListOrgRepositoryAdvisoriesResponse> {
    return this.ky
      .get(`/orgs/${params.org}/security-advisories`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'direction',
            'sort',
            'before',
            'after',
            'per_page',
            'state'
          )
        )
      })
      .json<github.SecurityAdvisoriesListOrgRepositoryAdvisoriesResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead.
 */
  @aiFunction({
    name: 'github_orgs_list_security_manager_teams',
    description: `> [!WARNING]
> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead.`,
    inputSchema: github.OrgsListSecurityManagerTeamsParamsSchema,
    tags: ['orgs']
  })
  async orgsListSecurityManagerTeams(
    params: github.OrgsListSecurityManagerTeamsParams
  ): Promise<github.OrgsListSecurityManagerTeamsResponse> {
    return this.ky
      .get(`/orgs/${params.org}/security-managers`)
      .json<github.OrgsListSecurityManagerTeamsResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead.
 */
  @aiFunction({
    name: 'github_orgs_add_security_manager_team',
    description: `> [!WARNING]
> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead.`,
    inputSchema: github.OrgsAddSecurityManagerTeamParamsSchema,
    tags: ['orgs']
  })
  async orgsAddSecurityManagerTeam(
    params: github.OrgsAddSecurityManagerTeamParams
  ): Promise<github.OrgsAddSecurityManagerTeamResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/security-managers/teams/${params.team_slug}`,
        {}
      )
      .json<github.OrgsAddSecurityManagerTeamResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead.
 */
  @aiFunction({
    name: 'github_orgs_remove_security_manager_team',
    description: `> [!WARNING]
> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead.`,
    inputSchema: github.OrgsRemoveSecurityManagerTeamParamsSchema,
    tags: ['orgs']
  })
  async orgsRemoveSecurityManagerTeam(
    params: github.OrgsRemoveSecurityManagerTeamParams
  ): Promise<github.OrgsRemoveSecurityManagerTeamResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/security-managers/teams/${params.team_slug}`,
        {}
      )
      .json<github.OrgsRemoveSecurityManagerTeamResponse>()
  }

  /**
 * Gets the summary of the free and paid GitHub Actions minutes used.

Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".

OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_billing_get_github_actions_billing_org',
    description: `Gets the summary of the free and paid GitHub Actions minutes used.

Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.BillingGetGithubActionsBillingOrgParamsSchema,
    tags: ['billing']
  })
  async billingGetGithubActionsBillingOrg(
    params: github.BillingGetGithubActionsBillingOrgParams
  ): Promise<github.BillingGetGithubActionsBillingOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/settings/billing/actions`)
      .json<github.BillingGetGithubActionsBillingOrgResponse>()
  }

  /**
 * Gets the free and paid storage used for GitHub Packages in gigabytes.

Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."

OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_billing_get_github_packages_billing_org',
    description: `Gets the free and paid storage used for GitHub Packages in gigabytes.

Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.BillingGetGithubPackagesBillingOrgParamsSchema,
    tags: ['billing']
  })
  async billingGetGithubPackagesBillingOrg(
    params: github.BillingGetGithubPackagesBillingOrgParams
  ): Promise<github.BillingGetGithubPackagesBillingOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/settings/billing/packages`)
      .json<github.BillingGetGithubPackagesBillingOrgResponse>()
  }

  /**
 * Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages.

Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."

OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_billing_get_shared_storage_billing_org',
    description: `Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages.

Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`admin:org\` scope to use this endpoint.`,
    inputSchema: github.BillingGetSharedStorageBillingOrgParamsSchema,
    tags: ['billing']
  })
  async billingGetSharedStorageBillingOrg(
    params: github.BillingGetSharedStorageBillingOrgParams
  ): Promise<github.BillingGetSharedStorageBillingOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/settings/billing/shared-storage`)
      .json<github.BillingGetSharedStorageBillingOrgResponse>()
  }

  /**
 * Lists all hosted compute network configurations configured in an organization.

OAuth app tokens and personal access tokens (classic) need the `read:network_configurations` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_hosted_compute_list_network_configurations_for_org',
    description: `Lists all hosted compute network configurations configured in an organization.

OAuth app tokens and personal access tokens (classic) need the \`read:network_configurations\` scope to use this endpoint.`,
    inputSchema:
      github.HostedComputeListNetworkConfigurationsForOrgParamsSchema,
    tags: ['hosted-compute']
  })
  async hostedComputeListNetworkConfigurationsForOrg(
    params: github.HostedComputeListNetworkConfigurationsForOrgParams
  ): Promise<github.HostedComputeListNetworkConfigurationsForOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/settings/network-configurations`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.HostedComputeListNetworkConfigurationsForOrgResponse>()
  }

  /**
 * Creates a hosted compute network configuration for an organization.

OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_hosted_compute_create_network_configuration_for_org',
    description: `Creates a hosted compute network configuration for an organization.

OAuth app tokens and personal access tokens (classic) need the \`write:network_configurations\` scope to use this endpoint.`,
    inputSchema:
      github.HostedComputeCreateNetworkConfigurationForOrgParamsSchema,
    tags: ['hosted-compute']
  })
  async hostedComputeCreateNetworkConfigurationForOrg(
    params: github.HostedComputeCreateNetworkConfigurationForOrgParams
  ): Promise<github.HostedComputeCreateNetworkConfigurationForOrgResponse> {
    return this.ky
      .post(`/orgs/${params.org}/settings/network-configurations`, {
        json: pick(params, 'name', 'compute_service', 'network_settings_ids')
      })
      .json<github.HostedComputeCreateNetworkConfigurationForOrgResponse>()
  }

  /**
 * Gets a hosted compute network configuration configured in an organization.

OAuth app tokens and personal access tokens (classic) need the `read:network_configurations` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_hosted_compute_get_network_configuration_for_org',
    description: `Gets a hosted compute network configuration configured in an organization.

OAuth app tokens and personal access tokens (classic) need the \`read:network_configurations\` scope to use this endpoint.`,
    inputSchema: github.HostedComputeGetNetworkConfigurationForOrgParamsSchema,
    tags: ['hosted-compute']
  })
  async hostedComputeGetNetworkConfigurationForOrg(
    params: github.HostedComputeGetNetworkConfigurationForOrgParams
  ): Promise<github.HostedComputeGetNetworkConfigurationForOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/settings/network-configurations/${params.network_configuration_id}`,
        {}
      )
      .json<github.HostedComputeGetNetworkConfigurationForOrgResponse>()
  }

  /**
 * Deletes a hosted compute network configuration from an organization.

OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_hosted_compute_delete_network_configuration_from_org',
    description: `Deletes a hosted compute network configuration from an organization.

OAuth app tokens and personal access tokens (classic) need the \`write:network_configurations\` scope to use this endpoint.`,
    inputSchema:
      github.HostedComputeDeleteNetworkConfigurationFromOrgParamsSchema,
    tags: ['hosted-compute']
  })
  async hostedComputeDeleteNetworkConfigurationFromOrg(
    params: github.HostedComputeDeleteNetworkConfigurationFromOrgParams
  ): Promise<github.HostedComputeDeleteNetworkConfigurationFromOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/settings/network-configurations/${params.network_configuration_id}`,
        {}
      )
      .json<github.HostedComputeDeleteNetworkConfigurationFromOrgResponse>()
  }

  /**
 * Updates a hosted compute network configuration for an organization.

OAuth app tokens and personal access tokens (classic) need the `write:network_configurations` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_hosted_compute_update_network_configuration_for_org',
    description: `Updates a hosted compute network configuration for an organization.

OAuth app tokens and personal access tokens (classic) need the \`write:network_configurations\` scope to use this endpoint.`,
    inputSchema:
      github.HostedComputeUpdateNetworkConfigurationForOrgParamsSchema,
    tags: ['hosted-compute']
  })
  async hostedComputeUpdateNetworkConfigurationForOrg(
    params: github.HostedComputeUpdateNetworkConfigurationForOrgParams
  ): Promise<github.HostedComputeUpdateNetworkConfigurationForOrgResponse> {
    return this.ky
      .patch(
        `/orgs/${params.org}/settings/network-configurations/${params.network_configuration_id}`,
        {
          json: pick(params, 'name', 'compute_service', 'network_settings_ids')
        }
      )
      .json<github.HostedComputeUpdateNetworkConfigurationForOrgResponse>()
  }

  /**
 * Gets a hosted compute network settings resource configured for an organization.

OAuth app tokens and personal access tokens (classic) need the `read:network_configurations` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_hosted_compute_get_network_settings_for_org',
    description: `Gets a hosted compute network settings resource configured for an organization.

OAuth app tokens and personal access tokens (classic) need the \`read:network_configurations\` scope to use this endpoint.`,
    inputSchema: github.HostedComputeGetNetworkSettingsForOrgParamsSchema,
    tags: ['hosted-compute']
  })
  async hostedComputeGetNetworkSettingsForOrg(
    params: github.HostedComputeGetNetworkSettingsForOrgParams
  ): Promise<github.HostedComputeGetNetworkSettingsForOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/settings/network-settings/${params.network_settings_id}`,
        {}
      )
      .json<github.HostedComputeGetNetworkSettingsForOrgResponse>()
  }

  /**
 * Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.

> [!NOTE]
> This endpoint will only return results for a given day if the team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day.

The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,
and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
they must have telemetry enabled in their IDE.

To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization containing the team within GitHub settings.
Only organization owners for the organization that contains this team and owners and billing managers of the parent enterprise can view Copilot metrics for a team.

OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint.
 */
  @aiFunction({
    name: 'github_copilot_copilot_metrics_for_team',
    description: `Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.

> [!NOTE]
> This endpoint will only return results for a given day if the team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day.

The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,
and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
they must have telemetry enabled in their IDE.

To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization containing the team within GitHub settings.
Only organization owners for the organization that contains this team and owners and billing managers of the parent enterprise can view Copilot metrics for a team.

OAuth app tokens and personal access tokens (classic) need either the \`manage_billing:copilot\`, \`read:org\`, or \`read:enterprise\` scopes to use this endpoint.`,
    inputSchema: github.CopilotCopilotMetricsForTeamParamsSchema,
    tags: ['copilot']
  })
  async copilotCopilotMetricsForTeam(
    params: github.CopilotCopilotMetricsForTeamParams
  ): Promise<github.CopilotCopilotMetricsForTeamResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/team/${params.team_slug}/copilot/metrics`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'since', 'until', 'page', 'per_page')
          )
        }
      )
      .json<github.CopilotCopilotMetricsForTeamResponse>()
  }

  /**
 * > [!NOTE]
> This endpoint is closing down. It will be accessible throughout February 2025, but will not return any new data after February 1st.

You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE
for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.
See the response schema tab for detailed metrics definitions.

The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day,
and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
they must have telemetry enabled in their IDE.

> [!NOTE]
> This endpoint will only return results for a given day if the team had five or more members with active Copilot licenses, as evaluated at the end of that day.

Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage metrics for a team.

OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint.
 */
  @aiFunction({
    name: 'github_copilot_usage_metrics_for_team',
    description: `> [!NOTE]
> This endpoint is closing down. It will be accessible throughout February 2025, but will not return any new data after February 1st.

You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE
for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.
See the response schema tab for detailed metrics definitions.

The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day,
and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
they must have telemetry enabled in their IDE.

> [!NOTE]
> This endpoint will only return results for a given day if the team had five or more members with active Copilot licenses, as evaluated at the end of that day.

Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage metrics for a team.

OAuth app tokens and personal access tokens (classic) need either the \`manage_billing:copilot\`, \`read:org\`, or \`read:enterprise\` scopes to use this endpoint.`,
    inputSchema: github.CopilotUsageMetricsForTeamParamsSchema,
    tags: ['copilot']
  })
  async copilotUsageMetricsForTeam(
    params: github.CopilotUsageMetricsForTeamParams
  ): Promise<github.CopilotUsageMetricsForTeamResponse> {
    return this.ky
      .get(`/orgs/${params.org}/team/${params.team_slug}/copilot/usage`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'since', 'until', 'page', 'per_page')
        )
      })
      .json<github.CopilotUsageMetricsForTeamResponse>()
  }

  /**
   * Lists all teams in an organization that are visible to the authenticated user.
   */
  @aiFunction({
    name: 'github_teams_list',
    description: `Lists all teams in an organization that are visible to the authenticated user.`,
    inputSchema: github.TeamsListParamsSchema,
    tags: ['teams']
  })
  async teamsList(
    params: github.TeamsListParams
  ): Promise<github.TeamsListResponse> {
    return this.ky
      .get(`/orgs/${params.org}/teams`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.TeamsListResponse>()
  }

  /**
 * To create a team, the authenticated user must be a member or owner of `{org}`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://docs.github.com/articles/setting-team-creation-permissions-in-your-organization)."

When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see "[About teams](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/about-teams)".
 */
  @aiFunction({
    name: 'github_teams_create',
    description: `To create a team, the authenticated user must be a member or owner of \`{org}\`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://docs.github.com/articles/setting-team-creation-permissions-in-your-organization)."

When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of \`maintainers\`. For more information, see "[About teams](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/about-teams)".`,
    inputSchema: github.TeamsCreateParamsSchema,
    tags: ['teams']
  })
  async teamsCreate(
    params: github.TeamsCreateParams
  ): Promise<github.TeamsCreateResponse> {
    return this.ky
      .post(`/orgs/${params.org}/teams`, {
        json: pick(
          params,
          'name',
          'description',
          'maintainers',
          'repo_names',
          'privacy',
          'notification_setting',
          'permission',
          'parent_team_id'
        )
      })
      .json<github.TeamsCreateResponse>()
  }

  /**
 * Gets a team using the team's `slug`. To create the `slug`, GitHub replaces special characters in the `name` string, changes all words to lowercase, and replaces spaces with a `-` separator. For example, `"My TEam Näme"` would become `my-team-name`.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}`.
 */
  @aiFunction({
    name: 'github_teams_get_by_name',
    description: `Gets a team using the team's \`slug\`. To create the \`slug\`, GitHub replaces special characters in the \`name\` string, changes all words to lowercase, and replaces spaces with a \`-\` separator. For example, \`"My TEam Näme"\` would become \`my-team-name\`.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}\`.`,
    inputSchema: github.TeamsGetByNameParamsSchema,
    tags: ['teams']
  })
  async teamsGetByName(
    params: github.TeamsGetByNameParams
  ): Promise<github.TeamsGetByNameResponse> {
    return this.ky
      .get(`/orgs/${params.org}/teams/${params.team_slug}`, {})
      .json<github.TeamsGetByNameResponse>()
  }

  /**
 * To delete a team, the authenticated user must be an organization owner or team maintainer.

If you are an organization owner, deleting a parent team will delete all of its child teams as well.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}`.
 */
  @aiFunction({
    name: 'github_teams_delete_in_org',
    description: `To delete a team, the authenticated user must be an organization owner or team maintainer.

If you are an organization owner, deleting a parent team will delete all of its child teams as well.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}\`.`,
    inputSchema: github.TeamsDeleteInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsDeleteInOrg(
    params: github.TeamsDeleteInOrgParams
  ): Promise<github.TeamsDeleteInOrgResponse> {
    return this.ky
      .delete(`/orgs/${params.org}/teams/${params.team_slug}`, {})
      .json<github.TeamsDeleteInOrgResponse>()
  }

  /**
 * To edit a team, the authenticated user must either be an organization owner or a team maintainer.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}`.
 */
  @aiFunction({
    name: 'github_teams_update_in_org',
    description: `To edit a team, the authenticated user must either be an organization owner or a team maintainer.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}\`.`,
    inputSchema: github.TeamsUpdateInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsUpdateInOrg(
    params: github.TeamsUpdateInOrgParams
  ): Promise<github.TeamsUpdateInOrgResponse> {
    return this.ky
      .patch(`/orgs/${params.org}/teams/${params.team_slug}`, {
        json: pick(
          params,
          'name',
          'description',
          'privacy',
          'notification_setting',
          'permission',
          'parent_team_id'
        )
      })
      .json<github.TeamsUpdateInOrgResponse>()
  }

  /**
 * List all discussions on a team's page.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`.

OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_list_discussions_in_org',
    description: `List all discussions on a team's page.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions\`.

OAuth app tokens and personal access tokens (classic) need the \`read:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsListDiscussionsInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsListDiscussionsInOrg(
    params: github.TeamsListDiscussionsInOrgParams
  ): Promise<github.TeamsListDiscussionsInOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/teams/${params.team_slug}/discussions`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'direction', 'per_page', 'page', 'pinned')
        )
      })
      .json<github.TeamsListDiscussionsInOrgResponse>()
  }

  /**
 * Creates a new discussion post on a team's page.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`.

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_create_discussion_in_org',
    description: `Creates a new discussion post on a team's page.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/{org_id}/team/{team_id}/discussions\`.

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsCreateDiscussionInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsCreateDiscussionInOrg(
    params: github.TeamsCreateDiscussionInOrgParams
  ): Promise<github.TeamsCreateDiscussionInOrgResponse> {
    return this.ky
      .post(`/orgs/${params.org}/teams/${params.team_slug}/discussions`, {
        json: pick(params, 'title', 'body', 'private')
      })
      .json<github.TeamsCreateDiscussionInOrgResponse>()
  }

  /**
 * Get a specific discussion on a team's page.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.

OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_get_discussion_in_org',
    description: `Get a specific discussion on a team's page.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`.

OAuth app tokens and personal access tokens (classic) need the \`read:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsGetDiscussionInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsGetDiscussionInOrg(
    params: github.TeamsGetDiscussionInOrgParams
  ): Promise<github.TeamsGetDiscussionInOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/teams/${params.team_slug}/discussions/${params.discussion_number}`,
        {}
      )
      .json<github.TeamsGetDiscussionInOrgResponse>()
  }

  /**
 * Delete a discussion from a team's page.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_delete_discussion_in_org',
    description: `Delete a discussion from a team's page.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`.

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsDeleteDiscussionInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsDeleteDiscussionInOrg(
    params: github.TeamsDeleteDiscussionInOrgParams
  ): Promise<github.TeamsDeleteDiscussionInOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/teams/${params.team_slug}/discussions/${params.discussion_number}`,
        {}
      )
      .json<github.TeamsDeleteDiscussionInOrgResponse>()
  }

  /**
 * Edits the title and body text of a discussion post. Only the parameters you provide are updated.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_update_discussion_in_org',
    description: `Edits the title and body text of a discussion post. Only the parameters you provide are updated.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}\`.

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsUpdateDiscussionInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsUpdateDiscussionInOrg(
    params: github.TeamsUpdateDiscussionInOrgParams
  ): Promise<github.TeamsUpdateDiscussionInOrgResponse> {
    return this.ky
      .patch(
        `/orgs/${params.org}/teams/${params.team_slug}/discussions/${params.discussion_number}`,
        {
          json: pick(params, 'title', 'body')
        }
      )
      .json<github.TeamsUpdateDiscussionInOrgResponse>()
  }

  /**
 * List all comments on a team discussion.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.

OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_list_discussion_comments_in_org',
    description: `List all comments on a team discussion.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments\`.

OAuth app tokens and personal access tokens (classic) need the \`read:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsListDiscussionCommentsInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsListDiscussionCommentsInOrg(
    params: github.TeamsListDiscussionCommentsInOrgParams
  ): Promise<github.TeamsListDiscussionCommentsInOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/teams/${params.team_slug}/discussions/${params.discussion_number}/comments`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'direction', 'per_page', 'page')
          )
        }
      )
      .json<github.TeamsListDiscussionCommentsInOrgResponse>()
  }

  /**
 * Creates a new comment on a team discussion.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_create_discussion_comment_in_org',
    description: `Creates a new comment on a team discussion.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments\`.

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsCreateDiscussionCommentInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsCreateDiscussionCommentInOrg(
    params: github.TeamsCreateDiscussionCommentInOrgParams
  ): Promise<github.TeamsCreateDiscussionCommentInOrgResponse> {
    return this.ky
      .post(
        `/orgs/${params.org}/teams/${params.team_slug}/discussions/${params.discussion_number}/comments`,
        {
          json: pick(params, 'body')
        }
      )
      .json<github.TeamsCreateDiscussionCommentInOrgResponse>()
  }

  /**
 * Get a specific comment on a team discussion.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.

OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_get_discussion_comment_in_org',
    description: `Get a specific comment on a team discussion.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`.

OAuth app tokens and personal access tokens (classic) need the \`read:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsGetDiscussionCommentInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsGetDiscussionCommentInOrg(
    params: github.TeamsGetDiscussionCommentInOrgParams
  ): Promise<github.TeamsGetDiscussionCommentInOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/teams/${params.team_slug}/discussions/${params.discussion_number}/comments/${params.comment_number}`,
        {}
      )
      .json<github.TeamsGetDiscussionCommentInOrgResponse>()
  }

  /**
 * Deletes a comment on a team discussion.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_delete_discussion_comment_in_org',
    description: `Deletes a comment on a team discussion.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`.

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsDeleteDiscussionCommentInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsDeleteDiscussionCommentInOrg(
    params: github.TeamsDeleteDiscussionCommentInOrgParams
  ): Promise<github.TeamsDeleteDiscussionCommentInOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/teams/${params.team_slug}/discussions/${params.discussion_number}/comments/${params.comment_number}`,
        {}
      )
      .json<github.TeamsDeleteDiscussionCommentInOrgResponse>()
  }

  /**
 * Edits the body text of a discussion comment.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_update_discussion_comment_in_org',
    description: `Edits the body text of a discussion comment.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}\`.

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsUpdateDiscussionCommentInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsUpdateDiscussionCommentInOrg(
    params: github.TeamsUpdateDiscussionCommentInOrgParams
  ): Promise<github.TeamsUpdateDiscussionCommentInOrgResponse> {
    return this.ky
      .patch(
        `/orgs/${params.org}/teams/${params.team_slug}/discussions/${params.discussion_number}/comments/${params.comment_number}`,
        {
          json: pick(params, 'body')
        }
      )
      .json<github.TeamsUpdateDiscussionCommentInOrgResponse>()
  }

  /**
 * List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.

OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_reactions_list_for_team_discussion_comment_in_org',
    description: `List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions\`.

OAuth app tokens and personal access tokens (classic) need the \`read:discussion\` scope to use this endpoint.`,
    inputSchema: github.ReactionsListForTeamDiscussionCommentInOrgParamsSchema,
    tags: ['reactions']
  })
  async reactionsListForTeamDiscussionCommentInOrg(
    params: github.ReactionsListForTeamDiscussionCommentInOrgParams
  ): Promise<github.ReactionsListForTeamDiscussionCommentInOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/teams/${params.team_slug}/discussions/${params.discussion_number}/comments/${params.comment_number}/reactions`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'content', 'per_page', 'page')
          )
        }
      )
      .json<github.ReactionsListForTeamDiscussionCommentInOrgResponse>()
  }

  /**
 * Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).

A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_reactions_create_for_team_discussion_comment_in_org',
    description: `Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).

A response with an HTTP \`200\` status means that you already added the reaction type to this team discussion comment.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions\`.

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema:
      github.ReactionsCreateForTeamDiscussionCommentInOrgParamsSchema,
    tags: ['reactions']
  })
  async reactionsCreateForTeamDiscussionCommentInOrg(
    params: github.ReactionsCreateForTeamDiscussionCommentInOrgParams
  ): Promise<github.ReactionsCreateForTeamDiscussionCommentInOrgResponse> {
    return this.ky
      .post(
        `/orgs/${params.org}/teams/${params.team_slug}/discussions/${params.discussion_number}/comments/${params.comment_number}/reactions`,
        {
          json: pick(params, 'content')
        }
      )
      .json<github.ReactionsCreateForTeamDiscussionCommentInOrgResponse>()
  }

  /**
 * > [!NOTE]
> You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`.

Delete a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_reactions_delete_for_team_discussion_comment',
    description: `> [!NOTE]
> You can also specify a team or organization with \`team_id\` and \`org_id\` using the route \`DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id\`.

Delete a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.ReactionsDeleteForTeamDiscussionCommentParamsSchema,
    tags: ['reactions']
  })
  async reactionsDeleteForTeamDiscussionComment(
    params: github.ReactionsDeleteForTeamDiscussionCommentParams
  ): Promise<github.ReactionsDeleteForTeamDiscussionCommentResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/teams/${params.team_slug}/discussions/${params.discussion_number}/comments/${params.comment_number}/reactions/${params.reaction_id}`,
        {}
      )
      .json<github.ReactionsDeleteForTeamDiscussionCommentResponse>()
  }

  /**
 * List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.

OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_reactions_list_for_team_discussion_in_org',
    description: `List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions\`.

OAuth app tokens and personal access tokens (classic) need the \`read:discussion\` scope to use this endpoint.`,
    inputSchema: github.ReactionsListForTeamDiscussionInOrgParamsSchema,
    tags: ['reactions']
  })
  async reactionsListForTeamDiscussionInOrg(
    params: github.ReactionsListForTeamDiscussionInOrgParams
  ): Promise<github.ReactionsListForTeamDiscussionInOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/teams/${params.team_slug}/discussions/${params.discussion_number}/reactions`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'content', 'per_page', 'page')
          )
        }
      )
      .json<github.ReactionsListForTeamDiscussionInOrgResponse>()
  }

  /**
 * Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).

A response with an HTTP `200` status means that you already added the reaction type to this team discussion.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_reactions_create_for_team_discussion_in_org',
    description: `Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).

A response with an HTTP \`200\` status means that you already added the reaction type to this team discussion.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions\`.

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.ReactionsCreateForTeamDiscussionInOrgParamsSchema,
    tags: ['reactions']
  })
  async reactionsCreateForTeamDiscussionInOrg(
    params: github.ReactionsCreateForTeamDiscussionInOrgParams
  ): Promise<github.ReactionsCreateForTeamDiscussionInOrgResponse> {
    return this.ky
      .post(
        `/orgs/${params.org}/teams/${params.team_slug}/discussions/${params.discussion_number}/reactions`,
        {
          json: pick(params, 'content')
        }
      )
      .json<github.ReactionsCreateForTeamDiscussionInOrgResponse>()
  }

  /**
 * > [!NOTE]
> You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`.

Delete a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_reactions_delete_for_team_discussion',
    description: `> [!NOTE]
> You can also specify a team or organization with \`team_id\` and \`org_id\` using the route \`DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id\`.

Delete a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.ReactionsDeleteForTeamDiscussionParamsSchema,
    tags: ['reactions']
  })
  async reactionsDeleteForTeamDiscussion(
    params: github.ReactionsDeleteForTeamDiscussionParams
  ): Promise<github.ReactionsDeleteForTeamDiscussionResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/teams/${params.team_slug}/discussions/${params.discussion_number}/reactions/${params.reaction_id}`,
        {}
      )
      .json<github.ReactionsDeleteForTeamDiscussionResponse>()
  }

  /**
 * The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/invitations`.
 */
  @aiFunction({
    name: 'github_teams_list_pending_invitations_in_org',
    description: `The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/invitations\`.`,
    inputSchema: github.TeamsListPendingInvitationsInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsListPendingInvitationsInOrg(
    params: github.TeamsListPendingInvitationsInOrgParams
  ): Promise<github.TeamsListPendingInvitationsInOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/teams/${params.team_slug}/invitations`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.TeamsListPendingInvitationsInOrgResponse>()
  }

  /**
 * Team members will include the members of child teams.

To list members in a team, the team must be visible to the authenticated user.
 */
  @aiFunction({
    name: 'github_teams_list_members_in_org',
    description: `Team members will include the members of child teams.

To list members in a team, the team must be visible to the authenticated user.`,
    inputSchema: github.TeamsListMembersInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsListMembersInOrg(
    params: github.TeamsListMembersInOrgParams
  ): Promise<github.TeamsListMembersInOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/teams/${params.team_slug}/members`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'role', 'per_page', 'page')
        )
      })
      .json<github.TeamsListMembersInOrgResponse>()
  }

  /**
 * Team members will include the members of child teams.

To get a user's membership with a team, the team must be visible to the authenticated user.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`.

> [!NOTE]
> The response contains the `state` of the membership and the member's `role`.

The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team).
 */
  @aiFunction({
    name: 'github_teams_get_membership_for_user_in_org',
    description: `Team members will include the members of child teams.

To get a user's membership with a team, the team must be visible to the authenticated user.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/memberships/{username}\`.

> [!NOTE]
> The response contains the \`state\` of the membership and the member's \`role\`.

The \`role\` for organization owners is set to \`maintainer\`. For more information about \`maintainer\` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team).`,
    inputSchema: github.TeamsGetMembershipForUserInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsGetMembershipForUserInOrg(
    params: github.TeamsGetMembershipForUserInOrgParams
  ): Promise<github.TeamsGetMembershipForUserInOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/teams/${params.team_slug}/memberships/${params.username}`,
        {}
      )
      .json<github.TeamsGetMembershipForUserInOrgResponse>()
  }

  /**
 * Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

> [!NOTE]
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."

An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team.

If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`.
 */
  @aiFunction({
    name: 'github_teams_add_or_update_membership_for_user_in_org',
    description: `Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

> [!NOTE]
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."

An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team.

If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/memberships/{username}\`.`,
    inputSchema: github.TeamsAddOrUpdateMembershipForUserInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsAddOrUpdateMembershipForUserInOrg(
    params: github.TeamsAddOrUpdateMembershipForUserInOrgParams
  ): Promise<github.TeamsAddOrUpdateMembershipForUserInOrgResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/teams/${params.team_slug}/memberships/${params.username}`,
        {
          json: pick(params, 'role')
        }
      )
      .json<github.TeamsAddOrUpdateMembershipForUserInOrgResponse>()
  }

  /**
 * To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

> [!NOTE]
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`.
 */
  @aiFunction({
    name: 'github_teams_remove_membership_for_user_in_org',
    description: `To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

> [!NOTE]
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}\`.`,
    inputSchema: github.TeamsRemoveMembershipForUserInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsRemoveMembershipForUserInOrg(
    params: github.TeamsRemoveMembershipForUserInOrgParams
  ): Promise<github.TeamsRemoveMembershipForUserInOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/teams/${params.team_slug}/memberships/${params.username}`,
        {}
      )
      .json<github.TeamsRemoveMembershipForUserInOrgResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_teams_list_projects_in_org',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.TeamsListProjectsInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsListProjectsInOrg(
    params: github.TeamsListProjectsInOrgParams
  ): Promise<github.TeamsListProjectsInOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/teams/${params.team_slug}/projects`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.TeamsListProjectsInOrgResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_teams_check_permissions_for_project_in_org',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.TeamsCheckPermissionsForProjectInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsCheckPermissionsForProjectInOrg(
    params: github.TeamsCheckPermissionsForProjectInOrgParams
  ): Promise<github.TeamsCheckPermissionsForProjectInOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/teams/${params.team_slug}/projects/${params.project_id}`,
        {}
      )
      .json<github.TeamsCheckPermissionsForProjectInOrgResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_teams_add_or_update_project_permissions_in_org',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.TeamsAddOrUpdateProjectPermissionsInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsAddOrUpdateProjectPermissionsInOrg(
    params: github.TeamsAddOrUpdateProjectPermissionsInOrgParams
  ): Promise<github.TeamsAddOrUpdateProjectPermissionsInOrgResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/teams/${params.team_slug}/projects/${params.project_id}`,
        {
          json: pick(params, 'permission')
        }
      )
      .json<github.TeamsAddOrUpdateProjectPermissionsInOrgResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_teams_remove_project_in_org',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.TeamsRemoveProjectInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsRemoveProjectInOrg(
    params: github.TeamsRemoveProjectInOrgParams
  ): Promise<github.TeamsRemoveProjectInOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/teams/${params.team_slug}/projects/${params.project_id}`,
        {}
      )
      .json<github.TeamsRemoveProjectInOrgResponse>()
  }

  /**
 * Lists a team's repositories visible to the authenticated user.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`.
 */
  @aiFunction({
    name: 'github_teams_list_repos_in_org',
    description: `Lists a team's repositories visible to the authenticated user.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/repos\`.`,
    inputSchema: github.TeamsListReposInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsListReposInOrg(
    params: github.TeamsListReposInOrgParams
  ): Promise<github.TeamsListReposInOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/teams/${params.team_slug}/repos`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.TeamsListReposInOrgResponse>()
  }

  /**
 * Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked.

You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `application/vnd.github.v3.repository+json` accept header.

If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status.

If the repository is private, you must have at least `read` permission for that repository, and your token must have the `repo` or `admin:org` scope. Otherwise, you will receive a `404 Not Found` response status.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.
 */
  @aiFunction({
    name: 'github_teams_check_permissions_for_repo_in_org',
    description: `Checks whether a team has \`admin\`, \`push\`, \`maintain\`, \`triage\`, or \`pull\` permission for a repository. Repositories inherited through a parent team will also be checked.

You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the \`application/vnd.github.v3.repository+json\` accept header.

If a team doesn't have permission for the repository, you will receive a \`404 Not Found\` response status.

If the repository is private, you must have at least \`read\` permission for that repository, and your token must have the \`repo\` or \`admin:org\` scope. Otherwise, you will receive a \`404 Not Found\` response status.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`.`,
    inputSchema: github.TeamsCheckPermissionsForRepoInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsCheckPermissionsForRepoInOrg(
    params: github.TeamsCheckPermissionsForRepoInOrgParams
  ): Promise<github.TeamsCheckPermissionsForRepoInOrgResponse> {
    return this.ky
      .get(
        `/orgs/${params.org}/teams/${params.team_slug}/repos/${params.owner}/${params.repo}`,
        {}
      )
      .json<github.TeamsCheckPermissionsForRepoInOrgResponse>()
  }

  /**
 * To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.

For more information about the permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)".
 */
  @aiFunction({
    name: 'github_teams_add_or_update_repo_permissions_in_org',
    description: `To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a \`422 Unprocessable Entity\` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`.

For more information about the permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)".`,
    inputSchema: github.TeamsAddOrUpdateRepoPermissionsInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsAddOrUpdateRepoPermissionsInOrg(
    params: github.TeamsAddOrUpdateRepoPermissionsInOrgParams
  ): Promise<github.TeamsAddOrUpdateRepoPermissionsInOrgResponse> {
    return this.ky
      .put(
        `/orgs/${params.org}/teams/${params.team_slug}/repos/${params.owner}/${params.repo}`,
        {
          json: pick(params, 'permission')
        }
      )
      .json<github.TeamsAddOrUpdateRepoPermissionsInOrgResponse>()
  }

  /**
 * If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.
 */
  @aiFunction({
    name: 'github_teams_remove_repo_in_org',
    description: `If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}\`.`,
    inputSchema: github.TeamsRemoveRepoInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsRemoveRepoInOrg(
    params: github.TeamsRemoveRepoInOrgParams
  ): Promise<github.TeamsRemoveRepoInOrgResponse> {
    return this.ky
      .delete(
        `/orgs/${params.org}/teams/${params.team_slug}/repos/${params.owner}/${params.repo}`,
        {}
      )
      .json<github.TeamsRemoveRepoInOrgResponse>()
  }

  /**
 * Lists the child teams of the team specified by `{team_slug}`.

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`.
 */
  @aiFunction({
    name: 'github_teams_list_child_in_org',
    description: `Lists the child teams of the team specified by \`{team_slug}\`.

> [!NOTE]
> You can also specify a team by \`org_id\` and \`team_id\` using the route \`GET /organizations/{org_id}/team/{team_id}/teams\`.`,
    inputSchema: github.TeamsListChildInOrgParamsSchema,
    tags: ['teams']
  })
  async teamsListChildInOrg(
    params: github.TeamsListChildInOrgParams
  ): Promise<github.TeamsListChildInOrgResponse> {
    return this.ky
      .get(`/orgs/${params.org}/teams/${params.team_slug}/teams`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.TeamsListChildInOrgResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/).

Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."

The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint.
 */
  @aiFunction({
    name: 'github_orgs_enable_or_disable_security_product_on_all_org_repos',
    description: `> [!WARNING]
> **Closing down notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/).

Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."

The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`admin:org\`, \`write:org\`, or \`repo\` scopes to use this endpoint.`,
    inputSchema:
      github.OrgsEnableOrDisableSecurityProductOnAllOrgReposParamsSchema,
    tags: ['orgs']
  })
  async orgsEnableOrDisableSecurityProductOnAllOrgRepos(
    params: github.OrgsEnableOrDisableSecurityProductOnAllOrgReposParams
  ): Promise<github.OrgsEnableOrDisableSecurityProductOnAllOrgReposResponse> {
    return this.ky
      .post(
        `/orgs/${params.org}/${params.security_product}/${params.enablement}`,
        {
          json: pick(params, 'query_suite')
        }
      )
      .json<github.OrgsEnableOrDisableSecurityProductOnAllOrgReposResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_get_card',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsGetCardParamsSchema,
    tags: ['projects']
  })
  async projectsGetCard(
    params: github.ProjectsGetCardParams
  ): Promise<github.ProjectsGetCardResponse> {
    return this.ky
      .get(`/projects/columns/cards/${params.card_id}`)
      .json<github.ProjectsGetCardResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_delete_card',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsDeleteCardParamsSchema,
    tags: ['projects']
  })
  async projectsDeleteCard(
    params: github.ProjectsDeleteCardParams
  ): Promise<github.ProjectsDeleteCardResponse> {
    return this.ky
      .delete(`/projects/columns/cards/${params.card_id}`)
      .json<github.ProjectsDeleteCardResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_update_card',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsUpdateCardParamsSchema,
    tags: ['projects']
  })
  async projectsUpdateCard(
    params: github.ProjectsUpdateCardParams
  ): Promise<github.ProjectsUpdateCardResponse> {
    return this.ky
      .patch(`/projects/columns/cards/${params.card_id}`, {
        json: pick(params, 'note', 'archived')
      })
      .json<github.ProjectsUpdateCardResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_move_card',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsMoveCardParamsSchema,
    tags: ['projects']
  })
  async projectsMoveCard(
    params: github.ProjectsMoveCardParams
  ): Promise<github.ProjectsMoveCardResponse> {
    return this.ky
      .post(`/projects/columns/cards/${params.card_id}/moves`, {
        json: pick(params, 'position', 'column_id')
      })
      .json<github.ProjectsMoveCardResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_get_column',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsGetColumnParamsSchema,
    tags: ['projects']
  })
  async projectsGetColumn(
    params: github.ProjectsGetColumnParams
  ): Promise<github.ProjectsGetColumnResponse> {
    return this.ky
      .get(`/projects/columns/${params.column_id}`)
      .json<github.ProjectsGetColumnResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_delete_column',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsDeleteColumnParamsSchema,
    tags: ['projects']
  })
  async projectsDeleteColumn(
    params: github.ProjectsDeleteColumnParams
  ): Promise<github.ProjectsDeleteColumnResponse> {
    return this.ky
      .delete(`/projects/columns/${params.column_id}`)
      .json<github.ProjectsDeleteColumnResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_update_column',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsUpdateColumnParamsSchema,
    tags: ['projects']
  })
  async projectsUpdateColumn(
    params: github.ProjectsUpdateColumnParams
  ): Promise<github.ProjectsUpdateColumnResponse> {
    return this.ky
      .patch(`/projects/columns/${params.column_id}`, {
        json: pick(params, 'name')
      })
      .json<github.ProjectsUpdateColumnResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_list_cards',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsListCardsParamsSchema,
    tags: ['projects']
  })
  async projectsListCards(
    params: github.ProjectsListCardsParams
  ): Promise<github.ProjectsListCardsResponse> {
    return this.ky
      .get(`/projects/columns/${params.column_id}/cards`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'archived_state', 'per_page', 'page')
        )
      })
      .json<github.ProjectsListCardsResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_create_card',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    // TODO: Improve handling of union params
    inputSchema: github.ProjectsCreateCardParamsSchema as any,
    tags: ['projects']
  })
  async projectsCreateCard(
    params: github.ProjectsCreateCardParams
  ): Promise<github.ProjectsCreateCardResponse> {
    return this.ky
      .post(`/projects/columns/${params.column_id}/cards`, {
        json: params
      })
      .json<github.ProjectsCreateCardResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_move_column',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsMoveColumnParamsSchema,
    tags: ['projects']
  })
  async projectsMoveColumn(
    params: github.ProjectsMoveColumnParams
  ): Promise<github.ProjectsMoveColumnResponse> {
    return this.ky
      .post(`/projects/columns/${params.column_id}/moves`, {
        json: pick(params, 'position')
      })
      .json<github.ProjectsMoveColumnResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_get',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsGetParamsSchema,
    tags: ['projects']
  })
  async projectsGet(
    params: github.ProjectsGetParams
  ): Promise<github.ProjectsGetResponse> {
    return this.ky
      .get(`/projects/${params.project_id}`)
      .json<github.ProjectsGetResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_delete',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsDeleteParamsSchema,
    tags: ['projects']
  })
  async projectsDelete(
    params: github.ProjectsDeleteParams
  ): Promise<github.ProjectsDeleteResponse> {
    return this.ky
      .delete(`/projects/${params.project_id}`)
      .json<github.ProjectsDeleteResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_update',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsUpdateParamsSchema,
    tags: ['projects']
  })
  async projectsUpdate(
    params: github.ProjectsUpdateParams
  ): Promise<github.ProjectsUpdateResponse> {
    return this.ky
      .patch(`/projects/${params.project_id}`, {
        json: pick(
          params,
          'name',
          'body',
          'state',
          'organization_permission',
          'private'
        )
      })
      .json<github.ProjectsUpdateResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_list_collaborators',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsListCollaboratorsParamsSchema,
    tags: ['projects']
  })
  async projectsListCollaborators(
    params: github.ProjectsListCollaboratorsParams
  ): Promise<github.ProjectsListCollaboratorsResponse> {
    return this.ky
      .get(`/projects/${params.project_id}/collaborators`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'affiliation', 'per_page', 'page')
        )
      })
      .json<github.ProjectsListCollaboratorsResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_add_collaborator',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsAddCollaboratorParamsSchema,
    tags: ['projects']
  })
  async projectsAddCollaborator(
    params: github.ProjectsAddCollaboratorParams
  ): Promise<github.ProjectsAddCollaboratorResponse> {
    return this.ky
      .put(
        `/projects/${params.project_id}/collaborators/${params.username}`,
        {
          json: pick(params, 'permission')
        }
      )
      .json<github.ProjectsAddCollaboratorResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_remove_collaborator',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsRemoveCollaboratorParamsSchema,
    tags: ['projects']
  })
  async projectsRemoveCollaborator(
    params: github.ProjectsRemoveCollaboratorParams
  ): Promise<github.ProjectsRemoveCollaboratorResponse> {
    return this.ky
      .delete(
        `/projects/${params.project_id}/collaborators/${params.username}`,
        {}
      )
      .json<github.ProjectsRemoveCollaboratorResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_get_permission_for_user',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsGetPermissionForUserParamsSchema,
    tags: ['projects']
  })
  async projectsGetPermissionForUser(
    params: github.ProjectsGetPermissionForUserParams
  ): Promise<github.ProjectsGetPermissionForUserResponse> {
    return this.ky
      .get(
        `/projects/${params.project_id}/collaborators/${params.username}/permission`,
        {}
      )
      .json<github.ProjectsGetPermissionForUserResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_list_columns',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsListColumnsParamsSchema,
    tags: ['projects']
  })
  async projectsListColumns(
    params: github.ProjectsListColumnsParams
  ): Promise<github.ProjectsListColumnsResponse> {
    return this.ky
      .get(`/projects/${params.project_id}/columns`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ProjectsListColumnsResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_create_column',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsCreateColumnParamsSchema,
    tags: ['projects']
  })
  async projectsCreateColumn(
    params: github.ProjectsCreateColumnParams
  ): Promise<github.ProjectsCreateColumnResponse> {
    return this.ky
      .post(`/projects/${params.project_id}/columns`, {
        json: pick(params, 'name')
      })
      .json<github.ProjectsCreateColumnResponse>()
  }

  /**
 * > [!NOTE]
> Accessing this endpoint does not count against your REST API rate limit.

Some categories of endpoints have custom rate limits that are separate from the rate limit governing the other REST API endpoints. For this reason, the API response categorizes your rate limit. Under `resources`, you'll see objects relating to different categories:
* The `core` object provides your rate limit status for all non-search-related resources in the REST API.
* The `search` object provides your rate limit status for the REST API for searching (excluding code searches). For more information, see "[Search](https://docs.github.com/rest/search/search)."
* The `code_search` object provides your rate limit status for the REST API for searching code. For more information, see "[Search code](https://docs.github.com/rest/search/search#search-code)."
* The `graphql` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/graphql/overview/resource-limitations#rate-limit)."
* The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)."
* The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)."
* The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)."
* The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)."
* The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)."

> [!NOTE]
> The `rate` object is closing down. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object.
 */
  @aiFunction({
    name: 'github_rate_limit_get',
    description: `> [!NOTE]
> Accessing this endpoint does not count against your REST API rate limit.

Some categories of endpoints have custom rate limits that are separate from the rate limit governing the other REST API endpoints. For this reason, the API response categorizes your rate limit. Under \`resources\`, you'll see objects relating to different categories:
* The \`core\` object provides your rate limit status for all non-search-related resources in the REST API.
* The \`search\` object provides your rate limit status for the REST API for searching (excluding code searches). For more information, see "[Search](https://docs.github.com/rest/search/search)."
* The \`code_search\` object provides your rate limit status for the REST API for searching code. For more information, see "[Search code](https://docs.github.com/rest/search/search#search-code)."
* The \`graphql\` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/graphql/overview/resource-limitations#rate-limit)."
* The \`integration_manifest\` object provides your rate limit status for the \`POST /app-manifests/{code}/conversions\` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)."
* The \`dependency_snapshots\` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)."
* The \`code_scanning_upload\` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)."
* The \`actions_runner_registration\` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)."
* The \`source_import\` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)."

> [!NOTE]
> The \`rate\` object is closing down. If you're writing new API client code or updating existing code, you should use the \`core\` object instead of the \`rate\` object. The \`core\` object contains the same information that is present in the \`rate\` object.`,
    inputSchema: github.RateLimitGetParamsSchema,
    tags: ['rate-limit']
  })
  async rateLimitGet(
    _params: github.RateLimitGetParams
  ): Promise<github.RateLimitGetResponse> {
    return this.ky.get('/rate_limit').json<github.RateLimitGetResponse>()
  }

  /**
 * The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network.

> [!NOTE]
> In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).".
 */
  @aiFunction({
    name: 'github_repos_get',
    description: `The \`parent\` and \`source\` objects are present when the repository is a fork. \`parent\` is the repository this repository was forked from, \`source\` is the ultimate source for the network.

> [!NOTE]
> In order to see the \`security_and_analysis\` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).".`,
    inputSchema: github.ReposGetParamsSchema,
    tags: ['repos']
  })
  async reposGet(
    params: github.ReposGetParams
  ): Promise<github.ReposGetResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}`, {})
      .json<github.ReposGetResponse>()
  }

  /**
 * Deleting a repository requires admin access.

If an organization owner has configured the organization to prevent members from deleting organization-owned
repositories, you will get a `403 Forbidden` response.

OAuth app tokens and personal access tokens (classic) need the `delete_repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_delete',
    description: `Deleting a repository requires admin access.

If an organization owner has configured the organization to prevent members from deleting organization-owned
repositories, you will get a \`403 Forbidden\` response.

OAuth app tokens and personal access tokens (classic) need the \`delete_repo\` scope to use this endpoint.`,
    inputSchema: github.ReposDeleteParamsSchema,
    tags: ['repos']
  })
  async reposDelete(
    params: github.ReposDeleteParams
  ): Promise<github.ReposDeleteResponse> {
    return this.ky
      .delete(`/repos/${params.owner}/${params.repo}`, {})
      .json<github.ReposDeleteResponse>()
  }

  /**
   * **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/repos/repos#replace-all-repository-topics) endpoint.
   */
  @aiFunction({
    name: 'github_repos_update',
    description: `**Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/repos/repos#replace-all-repository-topics) endpoint.`,
    inputSchema: github.ReposUpdateParamsSchema,
    tags: ['repos']
  })
  async reposUpdate(
    params: github.ReposUpdateParams
  ): Promise<github.ReposUpdateResponse> {
    return this.ky
      .patch(`/repos/${params.owner}/${params.repo}`, {
        json: pick(
          params,
          'name',
          'description',
          'homepage',
          'private',
          'visibility',
          'security_and_analysis',
          'has_issues',
          'has_projects',
          'has_wiki',
          'is_template',
          'default_branch',
          'allow_squash_merge',
          'allow_merge_commit',
          'allow_rebase_merge',
          'allow_auto_merge',
          'delete_branch_on_merge',
          'allow_update_branch',
          'use_squash_pr_title_as_default',
          'squash_merge_commit_title',
          'squash_merge_commit_message',
          'merge_commit_title',
          'merge_commit_message',
          'archived',
          'allow_forking',
          'web_commit_signoff_required'
        )
      })
      .json<github.ReposUpdateResponse>()
  }

  /**
 * Lists all artifacts for a repository.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_actions_list_artifacts_for_repo',
    description: `Lists all artifacts for a repository.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ActionsListArtifactsForRepoParamsSchema,
    tags: ['actions']
  })
  async actionsListArtifactsForRepo(
    params: github.ActionsListArtifactsForRepoParams
  ): Promise<github.ActionsListArtifactsForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/actions/artifacts`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'per_page', 'page', 'name')
        )
      })
      .json<github.ActionsListArtifactsForRepoResponse>()
  }

  /**
 * Gets a specific artifact for a workflow run.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_artifact',
    description: `Gets a specific artifact for a workflow run.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetArtifactParamsSchema,
    tags: ['actions']
  })
  async actionsGetArtifact(
    params: github.ActionsGetArtifactParams
  ): Promise<github.ActionsGetArtifactResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/artifacts/${params.artifact_id}`,
        {}
      )
      .json<github.ActionsGetArtifactResponse>()
  }

  /**
 * Deletes an artifact for a workflow run.
OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_delete_artifact',
    description: `Deletes an artifact for a workflow run.
OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDeleteArtifactParamsSchema,
    tags: ['actions']
  })
  async actionsDeleteArtifact(
    params: github.ActionsDeleteArtifactParams
  ): Promise<github.ActionsDeleteArtifactResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/actions/artifacts/${params.artifact_id}`,
        {}
      )
      .json<github.ActionsDeleteArtifactResponse>()
  }

  /**
 * Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in
the response header to find the URL for the download. The `:archive_format` must be `zip`.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_download_artifact',
    description: `Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for \`Location:\` in
the response header to find the URL for the download. The \`:archive_format\` must be \`zip\`.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDownloadArtifactParamsSchema,
    tags: ['actions']
  })
  async actionsDownloadArtifact(
    params: github.ActionsDownloadArtifactParams
  ): Promise<github.ActionsDownloadArtifactResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/artifacts/${params.artifact_id}/${params.archive_format}`,
        {}
      )
      .json<github.ActionsDownloadArtifactResponse>()
  }

  /**
 * Gets GitHub Actions cache usage for a repository.
The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_actions_cache_usage',
    description: `Gets GitHub Actions cache usage for a repository.
The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetActionsCacheUsageParamsSchema,
    tags: ['actions']
  })
  async actionsGetActionsCacheUsage(
    params: github.ActionsGetActionsCacheUsageParams
  ): Promise<github.ActionsGetActionsCacheUsageResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/cache/usage`,
        {}
      )
      .json<github.ActionsGetActionsCacheUsageResponse>()
  }

  /**
 * Lists the GitHub Actions caches for a repository.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_actions_cache_list',
    description: `Lists the GitHub Actions caches for a repository.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetActionsCacheListParamsSchema,
    tags: ['actions']
  })
  async actionsGetActionsCacheList(
    params: github.ActionsGetActionsCacheListParams
  ): Promise<github.ActionsGetActionsCacheListResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/actions/caches`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'per_page', 'page', 'ref', 'key', 'sort', 'direction')
        )
      })
      .json<github.ActionsGetActionsCacheListResponse>()
  }

  /**
 * Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_delete_actions_cache_by_key',
    description: `Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDeleteActionsCacheByKeyParamsSchema,
    tags: ['actions']
  })
  async actionsDeleteActionsCacheByKey(
    params: github.ActionsDeleteActionsCacheByKeyParams
  ): Promise<github.ActionsDeleteActionsCacheByKeyResponse> {
    return this.ky
      .delete(`/repos/${params.owner}/${params.repo}/actions/caches`, {
        searchParams: sanitizeSearchParams(pick(params, 'key', 'ref'))
      })
      .json<github.ActionsDeleteActionsCacheByKeyResponse>()
  }

  /**
 * Deletes a GitHub Actions cache for a repository, using a cache ID.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_delete_actions_cache_by_id',
    description: `Deletes a GitHub Actions cache for a repository, using a cache ID.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDeleteActionsCacheByIdParamsSchema,
    tags: ['actions']
  })
  async actionsDeleteActionsCacheById(
    params: github.ActionsDeleteActionsCacheByIdParams
  ): Promise<github.ActionsDeleteActionsCacheByIdResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/actions/caches/${params.cache_id}`,
        {}
      )
      .json<github.ActionsDeleteActionsCacheByIdResponse>()
  }

  /**
 * Gets a specific job in a workflow run.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_job_for_workflow_run',
    description: `Gets a specific job in a workflow run.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetJobForWorkflowRunParamsSchema,
    tags: ['actions']
  })
  async actionsGetJobForWorkflowRun(
    params: github.ActionsGetJobForWorkflowRunParams
  ): Promise<github.ActionsGetJobForWorkflowRunResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/jobs/${params.job_id}`,
        {}
      )
      .json<github.ActionsGetJobForWorkflowRunResponse>()
  }

  /**
 * Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look
for `Location:` in the response header to find the URL for the download.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_download_job_logs_for_workflow_run',
    description: `Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look
for \`Location:\` in the response header to find the URL for the download.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDownloadJobLogsForWorkflowRunParamsSchema,
    tags: ['actions']
  })
  async actionsDownloadJobLogsForWorkflowRun(
    params: github.ActionsDownloadJobLogsForWorkflowRunParams
  ): Promise<github.ActionsDownloadJobLogsForWorkflowRunResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/jobs/${params.job_id}/logs`,
        {}
      )
      .json<github.ActionsDownloadJobLogsForWorkflowRunResponse>()
  }

  /**
 * Re-run a job and its dependent jobs in a workflow run.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_re_run_job_for_workflow_run',
    description: `Re-run a job and its dependent jobs in a workflow run.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsReRunJobForWorkflowRunParamsSchema,
    tags: ['actions']
  })
  async actionsReRunJobForWorkflowRun(
    params: github.ActionsReRunJobForWorkflowRunParams
  ): Promise<github.ActionsReRunJobForWorkflowRunResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/actions/jobs/${params.job_id}/rerun`,
        {
          json: pick(params, 'enable_debug_logging')
        }
      )
      .json<github.ActionsReRunJobForWorkflowRunResponse>()
  }

  /**
 * Gets the customization template for an OpenID Connect (OIDC) subject claim.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_custom_oidc_sub_claim_for_repo',
    description: `Gets the customization template for an OpenID Connect (OIDC) subject claim.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetCustomOidcSubClaimForRepoParamsSchema,
    tags: ['actions']
  })
  async actionsGetCustomOidcSubClaimForRepo(
    params: github.ActionsGetCustomOidcSubClaimForRepoParams
  ): Promise<github.ActionsGetCustomOidcSubClaimForRepoResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/oidc/customization/sub`,
        {}
      )
      .json<github.ActionsGetCustomOidcSubClaimForRepoResponse>()
  }

  /**
 * Sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_set_custom_oidc_sub_claim_for_repo',
    description: `Sets the customization template and \`opt-in\` or \`opt-out\` flag for an OpenID Connect (OIDC) subject claim for a repository.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsSetCustomOidcSubClaimForRepoParamsSchema,
    tags: ['actions']
  })
  async actionsSetCustomOidcSubClaimForRepo(
    params: github.ActionsSetCustomOidcSubClaimForRepoParams
  ): Promise<github.ActionsSetCustomOidcSubClaimForRepoResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/actions/oidc/customization/sub`,
        {
          json: pick(params, 'use_default', 'include_claim_keys')
        }
      )
      .json<github.ActionsSetCustomOidcSubClaimForRepoResponse>()
  }

  /**
 * Lists all organization secrets shared with a repository without revealing their encrypted
values.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_list_repo_organization_secrets',
    description: `Lists all organization secrets shared with a repository without revealing their encrypted
values.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsListRepoOrganizationSecretsParamsSchema,
    tags: ['actions']
  })
  async actionsListRepoOrganizationSecrets(
    params: github.ActionsListRepoOrganizationSecretsParams
  ): Promise<github.ActionsListRepoOrganizationSecretsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/organization-secrets`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ActionsListRepoOrganizationSecretsResponse>()
  }

  /**
 * Lists all organization variables shared with a repository.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_list_repo_organization_variables',
    description: `Lists all organization variables shared with a repository.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsListRepoOrganizationVariablesParamsSchema,
    tags: ['actions']
  })
  async actionsListRepoOrganizationVariables(
    params: github.ActionsListRepoOrganizationVariablesParams
  ): Promise<github.ActionsListRepoOrganizationVariablesResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/organization-variables`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ActionsListRepoOrganizationVariablesResponse>()
  }

  /**
 * Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_github_actions_permissions_repository',
    description: `Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsGetGithubActionsPermissionsRepositoryParamsSchema,
    tags: ['actions']
  })
  async actionsGetGithubActionsPermissionsRepository(
    params: github.ActionsGetGithubActionsPermissionsRepositoryParams
  ): Promise<github.ActionsGetGithubActionsPermissionsRepositoryResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/permissions`,
        {}
      )
      .json<github.ActionsGetGithubActionsPermissionsRepositoryResponse>()
  }

  /**
 * Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_set_github_actions_permissions_repository',
    description: `Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsSetGithubActionsPermissionsRepositoryParamsSchema,
    tags: ['actions']
  })
  async actionsSetGithubActionsPermissionsRepository(
    params: github.ActionsSetGithubActionsPermissionsRepositoryParams
  ): Promise<github.ActionsSetGithubActionsPermissionsRepositoryResponse> {
    return this.ky
      .put(`/repos/${params.owner}/${params.repo}/actions/permissions`, {
        json: pick(params, 'enabled', 'allowed_actions')
      })
      .json<github.ActionsSetGithubActionsPermissionsRepositoryResponse>()
  }

  /**
 * Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.
This endpoint only applies to private repositories.
For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)."

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_workflow_access_to_repository',
    description: `Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.
This endpoint only applies to private repositories.
For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)."

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetWorkflowAccessToRepositoryParamsSchema,
    tags: ['actions']
  })
  async actionsGetWorkflowAccessToRepository(
    params: github.ActionsGetWorkflowAccessToRepositoryParams
  ): Promise<github.ActionsGetWorkflowAccessToRepositoryResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/permissions/access`,
        {}
      )
      .json<github.ActionsGetWorkflowAccessToRepositoryResponse>()
  }

  /**
 * Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.
This endpoint only applies to private repositories.
For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)".

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_set_workflow_access_to_repository',
    description: `Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.
This endpoint only applies to private repositories.
For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)".

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsSetWorkflowAccessToRepositoryParamsSchema,
    tags: ['actions']
  })
  async actionsSetWorkflowAccessToRepository(
    params: github.ActionsSetWorkflowAccessToRepositoryParams
  ): Promise<github.ActionsSetWorkflowAccessToRepositoryResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/actions/permissions/access`,
        {
          json: pick(params, 'access_level')
        }
      )
      .json<github.ActionsSetWorkflowAccessToRepositoryResponse>()
  }

  /**
 * Gets the settings for selected actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)."

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_allowed_actions_repository',
    description: `Gets the settings for selected actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)."

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetAllowedActionsRepositoryParamsSchema,
    tags: ['actions']
  })
  async actionsGetAllowedActionsRepository(
    params: github.ActionsGetAllowedActionsRepositoryParams
  ): Promise<github.ActionsGetAllowedActionsRepositoryResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/permissions/selected-actions`,
        {}
      )
      .json<github.ActionsGetAllowedActionsRepositoryResponse>()
  }

  /**
 * Sets the actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)."

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_set_allowed_actions_repository',
    description: `Sets the actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository permission policy for \`allowed_actions\` must be configured to \`selected\`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)."

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsSetAllowedActionsRepositoryParamsSchema,
    tags: ['actions']
  })
  async actionsSetAllowedActionsRepository(
    params: github.ActionsSetAllowedActionsRepositoryParams
  ): Promise<github.ActionsSetAllowedActionsRepositoryResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/actions/permissions/selected-actions`,
        {
          json: pick(
            params,
            'github_owned_allowed',
            'verified_allowed',
            'patterns_allowed'
          )
        }
      )
      .json<github.ActionsSetAllowedActionsRepositoryResponse>()
  }

  /**
 * Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository,
as well as if GitHub Actions can submit approving pull request reviews.
For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)."

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_github_actions_default_workflow_permissions_repository',
    description: `Gets the default workflow permissions granted to the \`GITHUB_TOKEN\` when running workflows in a repository,
as well as if GitHub Actions can submit approving pull request reviews.
For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)."

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsGetGithubActionsDefaultWorkflowPermissionsRepositoryParamsSchema,
    tags: ['actions']
  })
  async actionsGetGithubActionsDefaultWorkflowPermissionsRepository(
    params: github.ActionsGetGithubActionsDefaultWorkflowPermissionsRepositoryParams
  ): Promise<github.ActionsGetGithubActionsDefaultWorkflowPermissionsRepositoryResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/permissions/workflow`,
        {}
      )
      .json<github.ActionsGetGithubActionsDefaultWorkflowPermissionsRepositoryResponse>()
  }

  /**
 * Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository, and sets if GitHub Actions
can submit approving pull request reviews.
For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)."

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_set_github_actions_default_workflow_permissions_repository',
    description: `Sets the default workflow permissions granted to the \`GITHUB_TOKEN\` when running workflows in a repository, and sets if GitHub Actions
can submit approving pull request reviews.
For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)."

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsSetGithubActionsDefaultWorkflowPermissionsRepositoryParamsSchema,
    tags: ['actions']
  })
  async actionsSetGithubActionsDefaultWorkflowPermissionsRepository(
    params: github.ActionsSetGithubActionsDefaultWorkflowPermissionsRepositoryParams
  ): Promise<github.ActionsSetGithubActionsDefaultWorkflowPermissionsRepositoryResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/actions/permissions/workflow`,
        {
          json: pick(
            params,
            'default_workflow_permissions',
            'can_approve_pull_request_reviews'
          )
        }
      )
      .json<github.ActionsSetGithubActionsDefaultWorkflowPermissionsRepositoryResponse>()
  }

  /**
 * Lists all self-hosted runners configured in a repository.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_list_self_hosted_runners_for_repo',
    description: `Lists all self-hosted runners configured in a repository.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsListSelfHostedRunnersForRepoParamsSchema,
    tags: ['actions']
  })
  async actionsListSelfHostedRunnersForRepo(
    params: github.ActionsListSelfHostedRunnersForRepoParams
  ): Promise<github.ActionsListSelfHostedRunnersForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/actions/runners`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'name', 'per_page', 'page')
        )
      })
      .json<github.ActionsListSelfHostedRunnersForRepoResponse>()
  }

  /**
 * Lists binaries for the runner application that you can download and run.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_list_runner_applications_for_repo',
    description: `Lists binaries for the runner application that you can download and run.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsListRunnerApplicationsForRepoParamsSchema,
    tags: ['actions']
  })
  async actionsListRunnerApplicationsForRepo(
    params: github.ActionsListRunnerApplicationsForRepoParams
  ): Promise<github.ActionsListRunnerApplicationsForRepoResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/runners/downloads`,
        {}
      )
      .json<github.ActionsListRunnerApplicationsForRepoResponse>()
  }

  /**
 * Generates a configuration that can be passed to the runner application at startup.

The authenticated user must have admin access to the repository.

OAuth tokens and personal access tokens (classic) need the`repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_generate_runner_jitconfig_for_repo',
    description: `Generates a configuration that can be passed to the runner application at startup.

The authenticated user must have admin access to the repository.

OAuth tokens and personal access tokens (classic) need the\`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGenerateRunnerJitconfigForRepoParamsSchema,
    tags: ['actions']
  })
  async actionsGenerateRunnerJitconfigForRepo(
    params: github.ActionsGenerateRunnerJitconfigForRepoParams
  ): Promise<github.ActionsGenerateRunnerJitconfigForRepoResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/actions/runners/generate-jitconfig`,
        {
          json: pick(params, 'name', 'runner_group_id', 'labels', 'work_folder')
        }
      )
      .json<github.ActionsGenerateRunnerJitconfigForRepoResponse>()
  }

  /**
 * Returns a token that you can pass to the `config` script. The token expires after one hour.

For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner:

```
./config.sh --url https://github.com/octo-org --token TOKEN
```

Authenticated users must have admin access to the repository to use this endpoint.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_create_registration_token_for_repo',
    description: `Returns a token that you can pass to the \`config\` script. The token expires after one hour.

For example, you can replace \`TOKEN\` in the following example with the registration token provided by this endpoint to configure your self-hosted runner:

\`\`\`
./config.sh --url https://github.com/octo-org --token TOKEN
\`\`\`

Authenticated users must have admin access to the repository to use this endpoint.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsCreateRegistrationTokenForRepoParamsSchema,
    tags: ['actions']
  })
  async actionsCreateRegistrationTokenForRepo(
    params: github.ActionsCreateRegistrationTokenForRepoParams
  ): Promise<github.ActionsCreateRegistrationTokenForRepoResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/actions/runners/registration-token`,
        {}
      )
      .json<github.ActionsCreateRegistrationTokenForRepoResponse>()
  }

  /**
 * Returns a token that you can pass to the `config` script to remove a self-hosted runner from an repository. The token expires after one hour.

For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization:

```
./config.sh remove --token TOKEN
```

Authenticated users must have admin access to the repository to use this endpoint.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_create_remove_token_for_repo',
    description: `Returns a token that you can pass to the \`config\` script to remove a self-hosted runner from an repository. The token expires after one hour.

For example, you can replace \`TOKEN\` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization:

\`\`\`
./config.sh remove --token TOKEN
\`\`\`

Authenticated users must have admin access to the repository to use this endpoint.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsCreateRemoveTokenForRepoParamsSchema,
    tags: ['actions']
  })
  async actionsCreateRemoveTokenForRepo(
    params: github.ActionsCreateRemoveTokenForRepoParams
  ): Promise<github.ActionsCreateRemoveTokenForRepoResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/actions/runners/remove-token`,
        {}
      )
      .json<github.ActionsCreateRemoveTokenForRepoResponse>()
  }

  /**
 * Gets a specific self-hosted runner configured in a repository.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_self_hosted_runner_for_repo',
    description: `Gets a specific self-hosted runner configured in a repository.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetSelfHostedRunnerForRepoParamsSchema,
    tags: ['actions']
  })
  async actionsGetSelfHostedRunnerForRepo(
    params: github.ActionsGetSelfHostedRunnerForRepoParams
  ): Promise<github.ActionsGetSelfHostedRunnerForRepoResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/runners/${params.runner_id}`,
        {}
      )
      .json<github.ActionsGetSelfHostedRunnerForRepoResponse>()
  }

  /**
 * Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_delete_self_hosted_runner_from_repo',
    description: `Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDeleteSelfHostedRunnerFromRepoParamsSchema,
    tags: ['actions']
  })
  async actionsDeleteSelfHostedRunnerFromRepo(
    params: github.ActionsDeleteSelfHostedRunnerFromRepoParams
  ): Promise<github.ActionsDeleteSelfHostedRunnerFromRepoResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/actions/runners/${params.runner_id}`,
        {}
      )
      .json<github.ActionsDeleteSelfHostedRunnerFromRepoResponse>()
  }

  /**
 * Lists all labels for a self-hosted runner configured in a repository.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_list_labels_for_self_hosted_runner_for_repo',
    description: `Lists all labels for a self-hosted runner configured in a repository.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsListLabelsForSelfHostedRunnerForRepoParamsSchema,
    tags: ['actions']
  })
  async actionsListLabelsForSelfHostedRunnerForRepo(
    params: github.ActionsListLabelsForSelfHostedRunnerForRepoParams
  ): Promise<github.ActionsListLabelsForSelfHostedRunnerForRepoResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/runners/${params.runner_id}/labels`,
        {}
      )
      .json<github.ActionsListLabelsForSelfHostedRunnerForRepoResponse>()
  }

  /**
 * Adds custom labels to a self-hosted runner configured in a repository.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_add_custom_labels_to_self_hosted_runner_for_repo',
    description: `Adds custom labels to a self-hosted runner configured in a repository.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsAddCustomLabelsToSelfHostedRunnerForRepoParamsSchema,
    tags: ['actions']
  })
  async actionsAddCustomLabelsToSelfHostedRunnerForRepo(
    params: github.ActionsAddCustomLabelsToSelfHostedRunnerForRepoParams
  ): Promise<github.ActionsAddCustomLabelsToSelfHostedRunnerForRepoResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/actions/runners/${params.runner_id}/labels`,
        {
          json: pick(params, 'labels')
        }
      )
      .json<github.ActionsAddCustomLabelsToSelfHostedRunnerForRepoResponse>()
  }

  /**
 * Remove all previous custom labels and set the new custom labels for a specific
self-hosted runner configured in a repository.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_set_custom_labels_for_self_hosted_runner_for_repo',
    description: `Remove all previous custom labels and set the new custom labels for a specific
self-hosted runner configured in a repository.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsSetCustomLabelsForSelfHostedRunnerForRepoParamsSchema,
    tags: ['actions']
  })
  async actionsSetCustomLabelsForSelfHostedRunnerForRepo(
    params: github.ActionsSetCustomLabelsForSelfHostedRunnerForRepoParams
  ): Promise<github.ActionsSetCustomLabelsForSelfHostedRunnerForRepoResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/actions/runners/${params.runner_id}/labels`,
        {
          json: pick(params, 'labels')
        }
      )
      .json<github.ActionsSetCustomLabelsForSelfHostedRunnerForRepoResponse>()
  }

  /**
 * Remove all custom labels from a self-hosted runner configured in a
repository. Returns the remaining read-only labels from the runner.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_remove_all_custom_labels_from_self_hosted_runner_for_repo',
    description: `Remove all custom labels from a self-hosted runner configured in a
repository. Returns the remaining read-only labels from the runner.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepoParamsSchema,
    tags: ['actions']
  })
  async actionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepo(
    params: github.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepoParams
  ): Promise<github.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepoResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/actions/runners/${params.runner_id}/labels`,
        {}
      )
      .json<github.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForRepoResponse>()
  }

  /**
 * Remove a custom label from a self-hosted runner configured
in a repository. Returns the remaining labels from the runner.

This endpoint returns a `404 Not Found` status if the custom label is not
present on the runner.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_remove_custom_label_from_self_hosted_runner_for_repo',
    description: `Remove a custom label from a self-hosted runner configured
in a repository. Returns the remaining labels from the runner.

This endpoint returns a \`404 Not Found\` status if the custom label is not
present on the runner.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema:
      github.ActionsRemoveCustomLabelFromSelfHostedRunnerForRepoParamsSchema,
    tags: ['actions']
  })
  async actionsRemoveCustomLabelFromSelfHostedRunnerForRepo(
    params: github.ActionsRemoveCustomLabelFromSelfHostedRunnerForRepoParams
  ): Promise<github.ActionsRemoveCustomLabelFromSelfHostedRunnerForRepoResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/actions/runners/${params.runner_id}/labels/${params.name}`,
        {}
      )
      .json<github.ActionsRemoveCustomLabelFromSelfHostedRunnerForRepoResponse>()
  }

  /**
 * Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.

This endpoint will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`.
 */
  @aiFunction({
    name: 'github_actions_list_workflow_runs_for_repo',
    description: `Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.

This endpoint will return up to 1,000 results for each search when using the following parameters: \`actor\`, \`branch\`, \`check_suite_id\`, \`created\`, \`event\`, \`head_sha\`, \`status\`.`,
    inputSchema: github.ActionsListWorkflowRunsForRepoParamsSchema,
    tags: ['actions']
  })
  async actionsListWorkflowRunsForRepo(
    params: github.ActionsListWorkflowRunsForRepoParams
  ): Promise<github.ActionsListWorkflowRunsForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/actions/runs`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'actor',
            'branch',
            'event',
            'status',
            'per_page',
            'page',
            'created',
            'exclude_pull_requests',
            'check_suite_id',
            'head_sha'
          )
        )
      })
      .json<github.ActionsListWorkflowRunsForRepoResponse>()
  }

  /**
 * Gets a specific workflow run.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_actions_get_workflow_run',
    description: `Gets a specific workflow run.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ActionsGetWorkflowRunParamsSchema,
    tags: ['actions']
  })
  async actionsGetWorkflowRun(
    params: github.ActionsGetWorkflowRunParams
  ): Promise<github.ActionsGetWorkflowRunResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'exclude_pull_requests')
          )
        }
      )
      .json<github.ActionsGetWorkflowRunResponse>()
  }

  /**
 * Deletes a specific workflow run.

Anyone with write access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_delete_workflow_run',
    description: `Deletes a specific workflow run.

Anyone with write access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDeleteWorkflowRunParamsSchema,
    tags: ['actions']
  })
  async actionsDeleteWorkflowRun(
    params: github.ActionsDeleteWorkflowRunParams
  ): Promise<github.ActionsDeleteWorkflowRunResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}`,
        {}
      )
      .json<github.ActionsDeleteWorkflowRunResponse>()
  }

  /**
 * Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_actions_get_reviews_for_run',
    description: `Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ActionsGetReviewsForRunParamsSchema,
    tags: ['actions']
  })
  async actionsGetReviewsForRun(
    params: github.ActionsGetReviewsForRunParams
  ): Promise<github.ActionsGetReviewsForRunResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/approvals`,
        {}
      )
      .json<github.ActionsGetReviewsForRunResponse>()
  }

  /**
 * Approves a workflow run for a pull request from a public fork of a first time contributor. For more information, see ["Approving workflow runs from public forks](https://docs.github.com/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks)."

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_approve_workflow_run',
    description: `Approves a workflow run for a pull request from a public fork of a first time contributor. For more information, see ["Approving workflow runs from public forks](https://docs.github.com/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks)."

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsApproveWorkflowRunParamsSchema,
    tags: ['actions']
  })
  async actionsApproveWorkflowRun(
    params: github.ActionsApproveWorkflowRunParams
  ): Promise<github.ActionsApproveWorkflowRunResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/approve`,
        {}
      )
      .json<github.ActionsApproveWorkflowRunResponse>()
  }

  /**
 * Lists artifacts for a workflow run.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_actions_list_workflow_run_artifacts',
    description: `Lists artifacts for a workflow run.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ActionsListWorkflowRunArtifactsParamsSchema,
    tags: ['actions']
  })
  async actionsListWorkflowRunArtifacts(
    params: github.ActionsListWorkflowRunArtifactsParams
  ): Promise<github.ActionsListWorkflowRunArtifactsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/artifacts`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'per_page', 'page', 'name')
          )
        }
      )
      .json<github.ActionsListWorkflowRunArtifactsResponse>()
  }

  /**
 * Gets a specific workflow run attempt.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_actions_get_workflow_run_attempt',
    description: `Gets a specific workflow run attempt.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ActionsGetWorkflowRunAttemptParamsSchema,
    tags: ['actions']
  })
  async actionsGetWorkflowRunAttempt(
    params: github.ActionsGetWorkflowRunAttemptParams
  ): Promise<github.ActionsGetWorkflowRunAttemptResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/attempts/${params.attempt_number}`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'exclude_pull_requests')
          )
        }
      )
      .json<github.ActionsGetWorkflowRunAttemptResponse>()
  }

  /**
 * Lists jobs for a specific workflow run attempt. You can use parameters to narrow the list of results. For more information
about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint  with a private repository.
 */
  @aiFunction({
    name: 'github_actions_list_jobs_for_workflow_run_attempt',
    description: `Lists jobs for a specific workflow run attempt. You can use parameters to narrow the list of results. For more information
about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint  with a private repository.`,
    inputSchema: github.ActionsListJobsForWorkflowRunAttemptParamsSchema,
    tags: ['actions']
  })
  async actionsListJobsForWorkflowRunAttempt(
    params: github.ActionsListJobsForWorkflowRunAttemptParams
  ): Promise<github.ActionsListJobsForWorkflowRunAttemptResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/attempts/${params.attempt_number}/jobs`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ActionsListJobsForWorkflowRunAttemptResponse>()
  }

  /**
 * Gets a redirect URL to download an archive of log files for a specific workflow run attempt. This link expires after
1 minute. Look for `Location:` in the response header to find the URL for the download.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_download_workflow_run_attempt_logs',
    description: `Gets a redirect URL to download an archive of log files for a specific workflow run attempt. This link expires after
1 minute. Look for \`Location:\` in the response header to find the URL for the download.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDownloadWorkflowRunAttemptLogsParamsSchema,
    tags: ['actions']
  })
  async actionsDownloadWorkflowRunAttemptLogs(
    params: github.ActionsDownloadWorkflowRunAttemptLogsParams
  ): Promise<github.ActionsDownloadWorkflowRunAttemptLogsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/attempts/${params.attempt_number}/logs`,
        {}
      )
      .json<github.ActionsDownloadWorkflowRunAttemptLogsResponse>()
  }

  /**
 * Cancels a workflow run using its `id`.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_cancel_workflow_run',
    description: `Cancels a workflow run using its \`id\`.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsCancelWorkflowRunParamsSchema,
    tags: ['actions']
  })
  async actionsCancelWorkflowRun(
    params: github.ActionsCancelWorkflowRunParams
  ): Promise<github.ActionsCancelWorkflowRunResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/cancel`,
        {}
      )
      .json<github.ActionsCancelWorkflowRunResponse>()
  }

  /**
 * Approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."

> [!NOTE]
> GitHub Apps can only review their own custom deployment protection rules. To approve or reject pending deployments that are waiting for review from a specific person or team, see [`POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments`](/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run).

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_actions_review_custom_gates_for_run',
    description: `Approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."

> [!NOTE]
> GitHub Apps can only review their own custom deployment protection rules. To approve or reject pending deployments that are waiting for review from a specific person or team, see [\`POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\`](/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run).

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    // TODO: Improve handling of union params
    inputSchema: github.ActionsReviewCustomGatesForRunParamsSchema as any,
    tags: ['actions']
  })
  async actionsReviewCustomGatesForRun(
    params: github.ActionsReviewCustomGatesForRunParams
  ): Promise<github.ActionsReviewCustomGatesForRunResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/deployment_protection_rule`,
        {
          json: params
        }
      )
      .json<github.ActionsReviewCustomGatesForRunResponse>()
  }

  /**
 * Cancels a workflow run and bypasses conditions that would otherwise cause a workflow execution to continue, such as an `always()` condition on a job.
You should only use this endpoint to cancel a workflow run when the workflow run is not responding to [`POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel`](/rest/actions/workflow-runs#cancel-a-workflow-run).

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_force_cancel_workflow_run',
    description: `Cancels a workflow run and bypasses conditions that would otherwise cause a workflow execution to continue, such as an \`always()\` condition on a job.
You should only use this endpoint to cancel a workflow run when the workflow run is not responding to [\`POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\`](/rest/actions/workflow-runs#cancel-a-workflow-run).

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsForceCancelWorkflowRunParamsSchema,
    tags: ['actions']
  })
  async actionsForceCancelWorkflowRun(
    params: github.ActionsForceCancelWorkflowRunParams
  ): Promise<github.ActionsForceCancelWorkflowRunResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/force-cancel`,
        {}
      )
      .json<github.ActionsForceCancelWorkflowRunResponse>()
  }

  /**
 * Lists jobs for a workflow run. You can use parameters to narrow the list of results. For more information
about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_actions_list_jobs_for_workflow_run',
    description: `Lists jobs for a workflow run. You can use parameters to narrow the list of results. For more information
about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ActionsListJobsForWorkflowRunParamsSchema,
    tags: ['actions']
  })
  async actionsListJobsForWorkflowRun(
    params: github.ActionsListJobsForWorkflowRunParams
  ): Promise<github.ActionsListJobsForWorkflowRunResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/jobs`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'filter', 'per_page', 'page')
          )
        }
      )
      .json<github.ActionsListJobsForWorkflowRunResponse>()
  }

  /**
 * Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for
`Location:` in the response header to find the URL for the download.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_download_workflow_run_logs',
    description: `Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for
\`Location:\` in the response header to find the URL for the download.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDownloadWorkflowRunLogsParamsSchema,
    tags: ['actions']
  })
  async actionsDownloadWorkflowRunLogs(
    params: github.ActionsDownloadWorkflowRunLogsParams
  ): Promise<github.ActionsDownloadWorkflowRunLogsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/logs`,
        {}
      )
      .json<github.ActionsDownloadWorkflowRunLogsResponse>()
  }

  /**
 * Deletes all logs for a workflow run.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_delete_workflow_run_logs',
    description: `Deletes all logs for a workflow run.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDeleteWorkflowRunLogsParamsSchema,
    tags: ['actions']
  })
  async actionsDeleteWorkflowRunLogs(
    params: github.ActionsDeleteWorkflowRunLogsParams
  ): Promise<github.ActionsDeleteWorkflowRunLogsResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/logs`,
        {}
      )
      .json<github.ActionsDeleteWorkflowRunLogsResponse>()
  }

  /**
 * Get all deployment environments for a workflow run that are waiting for protection rules to pass.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_pending_deployments_for_run',
    description: `Get all deployment environments for a workflow run that are waiting for protection rules to pass.

Anyone with read access to the repository can use this endpoint.

If the repository is private, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetPendingDeploymentsForRunParamsSchema,
    tags: ['actions']
  })
  async actionsGetPendingDeploymentsForRun(
    params: github.ActionsGetPendingDeploymentsForRunParams
  ): Promise<github.ActionsGetPendingDeploymentsForRunResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/pending_deployments`,
        {}
      )
      .json<github.ActionsGetPendingDeploymentsForRunResponse>()
  }

  /**
 * Approve or reject pending deployments that are waiting on approval by a required reviewer.

Required reviewers with read access to the repository contents and deployments can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_review_pending_deployments_for_run',
    description: `Approve or reject pending deployments that are waiting on approval by a required reviewer.

Required reviewers with read access to the repository contents and deployments can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsReviewPendingDeploymentsForRunParamsSchema,
    tags: ['actions']
  })
  async actionsReviewPendingDeploymentsForRun(
    params: github.ActionsReviewPendingDeploymentsForRunParams
  ): Promise<github.ActionsReviewPendingDeploymentsForRunResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/pending_deployments`,
        {
          json: pick(params, 'environment_ids', 'state', 'comment')
        }
      )
      .json<github.ActionsReviewPendingDeploymentsForRunResponse>()
  }

  /**
 * Re-runs your workflow run using its `id`.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_re_run_workflow',
    description: `Re-runs your workflow run using its \`id\`.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsReRunWorkflowParamsSchema,
    tags: ['actions']
  })
  async actionsReRunWorkflow(
    params: github.ActionsReRunWorkflowParams
  ): Promise<github.ActionsReRunWorkflowResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/rerun`,
        {
          json: pick(params, 'enable_debug_logging')
        }
      )
      .json<github.ActionsReRunWorkflowResponse>()
  }

  /**
 * Re-run all of the failed jobs and their dependent jobs in a workflow run using the `id` of the workflow run.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_re_run_workflow_failed_jobs',
    description: `Re-run all of the failed jobs and their dependent jobs in a workflow run using the \`id\` of the workflow run.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsReRunWorkflowFailedJobsParamsSchema,
    tags: ['actions']
  })
  async actionsReRunWorkflowFailedJobs(
    params: github.ActionsReRunWorkflowFailedJobsParams
  ): Promise<github.ActionsReRunWorkflowFailedJobsResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/rerun-failed-jobs`,
        {
          json: pick(params, 'enable_debug_logging')
        }
      )
      .json<github.ActionsReRunWorkflowFailedJobsResponse>()
  }

  /**
 * > [!WARNING]
> This endpoint is in the process of closing down. Refer to "[Actions Get workflow usage and Get workflow run usage endpoints closing down](https://github.blog/changelog/2025-02-02-actions-get-workflow-usage-and-get-workflow-run-usage-endpoints-closing-down/)" for more information.

Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_actions_get_workflow_run_usage',
    description: `> [!WARNING]
> This endpoint is in the process of closing down. Refer to "[Actions Get workflow usage and Get workflow run usage endpoints closing down](https://github.blog/changelog/2025-02-02-actions-get-workflow-usage-and-get-workflow-run-usage-endpoints-closing-down/)" for more information.

Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ActionsGetWorkflowRunUsageParamsSchema,
    tags: ['actions']
  })
  async actionsGetWorkflowRunUsage(
    params: github.ActionsGetWorkflowRunUsageParams
  ): Promise<github.ActionsGetWorkflowRunUsageResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}/timing`,
        {}
      )
      .json<github.ActionsGetWorkflowRunUsageResponse>()
  }

  /**
 * Lists all secrets available in a repository without revealing their encrypted
values.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_list_repo_secrets',
    description: `Lists all secrets available in a repository without revealing their encrypted
values.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsListRepoSecretsParamsSchema,
    tags: ['actions']
  })
  async actionsListRepoSecrets(
    params: github.ActionsListRepoSecretsParams
  ): Promise<github.ActionsListRepoSecretsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/actions/secrets`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActionsListRepoSecretsResponse>()
  }

  /**
 * 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, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_repo_public_key',
    description: `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, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetRepoPublicKeyParamsSchema,
    tags: ['actions']
  })
  async actionsGetRepoPublicKey(
    params: github.ActionsGetRepoPublicKeyParams
  ): Promise<github.ActionsGetRepoPublicKeyResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/secrets/public-key`,
        {}
      )
      .json<github.ActionsGetRepoPublicKeyResponse>()
  }

  /**
 * Gets a single repository secret without revealing its encrypted value.

The authenticated user must have collaborator access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_repo_secret',
    description: `Gets a single repository secret without revealing its encrypted value.

The authenticated user must have collaborator access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetRepoSecretParamsSchema,
    tags: ['actions']
  })
  async actionsGetRepoSecret(
    params: github.ActionsGetRepoSecretParams
  ): Promise<github.ActionsGetRepoSecretResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/secrets/${params.secret_name}`,
        {}
      )
      .json<github.ActionsGetRepoSecretResponse>()
  }

  /**
 * Creates or updates a repository secret with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_create_or_update_repo_secret',
    description: `Creates or updates a repository secret with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsCreateOrUpdateRepoSecretParamsSchema,
    tags: ['actions']
  })
  async actionsCreateOrUpdateRepoSecret(
    params: github.ActionsCreateOrUpdateRepoSecretParams
  ): Promise<github.ActionsCreateOrUpdateRepoSecretResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/actions/secrets/${params.secret_name}`,
        {
          json: pick(params, 'encrypted_value', 'key_id')
        }
      )
      .json<github.ActionsCreateOrUpdateRepoSecretResponse>()
  }

  /**
 * Deletes a secret in a repository using the secret name.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_delete_repo_secret',
    description: `Deletes a secret in a repository using the secret name.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDeleteRepoSecretParamsSchema,
    tags: ['actions']
  })
  async actionsDeleteRepoSecret(
    params: github.ActionsDeleteRepoSecretParams
  ): Promise<github.ActionsDeleteRepoSecretResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/actions/secrets/${params.secret_name}`,
        {}
      )
      .json<github.ActionsDeleteRepoSecretResponse>()
  }

  /**
 * Lists all repository variables.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_list_repo_variables',
    description: `Lists all repository variables.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsListRepoVariablesParamsSchema,
    tags: ['actions']
  })
  async actionsListRepoVariables(
    params: github.ActionsListRepoVariablesParams
  ): Promise<github.ActionsListRepoVariablesResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/actions/variables`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActionsListRepoVariablesResponse>()
  }

  /**
 * Creates a repository variable that you can reference in a GitHub Actions workflow.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_create_repo_variable',
    description: `Creates a repository variable that you can reference in a GitHub Actions workflow.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsCreateRepoVariableParamsSchema,
    tags: ['actions']
  })
  async actionsCreateRepoVariable(
    params: github.ActionsCreateRepoVariableParams
  ): Promise<github.ActionsCreateRepoVariableResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/actions/variables`, {
        json: pick(params, 'name', 'value')
      })
      .json<github.ActionsCreateRepoVariableResponse>()
  }

  /**
 * Gets a specific variable in a repository.

The authenticated user must have collaborator access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_repo_variable',
    description: `Gets a specific variable in a repository.

The authenticated user must have collaborator access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetRepoVariableParamsSchema,
    tags: ['actions']
  })
  async actionsGetRepoVariable(
    params: github.ActionsGetRepoVariableParams
  ): Promise<github.ActionsGetRepoVariableResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/variables/${params.name}`,
        {}
      )
      .json<github.ActionsGetRepoVariableResponse>()
  }

  /**
 * Deletes a repository variable using the variable name.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_delete_repo_variable',
    description: `Deletes a repository variable using the variable name.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDeleteRepoVariableParamsSchema,
    tags: ['actions']
  })
  async actionsDeleteRepoVariable(
    params: github.ActionsDeleteRepoVariableParams
  ): Promise<github.ActionsDeleteRepoVariableResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/actions/variables/${params.name}`,
        {}
      )
      .json<github.ActionsDeleteRepoVariableResponse>()
  }

  /**
 * Updates a repository variable that you can reference in a GitHub Actions workflow.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_update_repo_variable',
    description: `Updates a repository variable that you can reference in a GitHub Actions workflow.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsUpdateRepoVariableParamsSchema,
    tags: ['actions']
  })
  async actionsUpdateRepoVariable(
    params: github.ActionsUpdateRepoVariableParams
  ): Promise<github.ActionsUpdateRepoVariableResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/actions/variables/${params.name}`,
        {
          json: pick(params, 'name', 'value')
        }
      )
      .json<github.ActionsUpdateRepoVariableResponse>()
  }

  /**
 * Lists the workflows in a repository.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_actions_list_repo_workflows',
    description: `Lists the workflows in a repository.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ActionsListRepoWorkflowsParamsSchema,
    tags: ['actions']
  })
  async actionsListRepoWorkflows(
    params: github.ActionsListRepoWorkflowsParams
  ): Promise<github.ActionsListRepoWorkflowsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/actions/workflows`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActionsListRepoWorkflowsResponse>()
  }

  /**
 * Gets a specific workflow. You can replace `workflow_id` with the workflow
file name. For example, you could use `main.yaml`.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_actions_get_workflow',
    description: `Gets a specific workflow. You can replace \`workflow_id\` with the workflow
file name. For example, you could use \`main.yaml\`.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ActionsGetWorkflowParamsSchema,
    tags: ['actions']
  })
  async actionsGetWorkflow(
    params: github.ActionsGetWorkflowParams
  ): Promise<github.ActionsGetWorkflowResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/workflows/${params.workflow_id}`,
        {}
      )
      .json<github.ActionsGetWorkflowResponse>()
  }

  /**
 * Disables a workflow and sets the `state` of the workflow to `disabled_manually`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_disable_workflow',
    description: `Disables a workflow and sets the \`state\` of the workflow to \`disabled_manually\`. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDisableWorkflowParamsSchema,
    tags: ['actions']
  })
  async actionsDisableWorkflow(
    params: github.ActionsDisableWorkflowParams
  ): Promise<github.ActionsDisableWorkflowResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/actions/workflows/${params.workflow_id}/disable`,
        {}
      )
      .json<github.ActionsDisableWorkflowResponse>()
  }

  /**
 * You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.

You must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)."

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_create_workflow_dispatch',
    description: `You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`.

You must configure your GitHub Actions workflow to run when the [\`workflow_dispatch\` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The \`inputs\` are configured in the workflow file. For more information about how to configure the \`workflow_dispatch\` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)."

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsCreateWorkflowDispatchParamsSchema,
    tags: ['actions']
  })
  async actionsCreateWorkflowDispatch(
    params: github.ActionsCreateWorkflowDispatchParams
  ): Promise<github.ActionsCreateWorkflowDispatchResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/actions/workflows/${params.workflow_id}/dispatches`,
        {
          json: pick(params, 'ref', 'inputs')
        }
      )
      .json<github.ActionsCreateWorkflowDispatchResponse>()
  }

  /**
 * Enables a workflow and sets the `state` of the workflow to `active`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_enable_workflow',
    description: `Enables a workflow and sets the \`state\` of the workflow to \`active\`. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsEnableWorkflowParamsSchema,
    tags: ['actions']
  })
  async actionsEnableWorkflow(
    params: github.ActionsEnableWorkflowParams
  ): Promise<github.ActionsEnableWorkflowResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/actions/workflows/${params.workflow_id}/enable`,
        {}
      )
      .json<github.ActionsEnableWorkflowResponse>()
  }

  /**
 * List all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).

Anyone with read access to the repository can use this endpoint

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.

This endpoint will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`.
 */
  @aiFunction({
    name: 'github_actions_list_workflow_runs',
    description: `List all workflow runs for a workflow. You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters).

Anyone with read access to the repository can use this endpoint

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.

This endpoint will return up to 1,000 results for each search when using the following parameters: \`actor\`, \`branch\`, \`check_suite_id\`, \`created\`, \`event\`, \`head_sha\`, \`status\`.`,
    inputSchema: github.ActionsListWorkflowRunsParamsSchema,
    tags: ['actions']
  })
  async actionsListWorkflowRuns(
    params: github.ActionsListWorkflowRunsParams
  ): Promise<github.ActionsListWorkflowRunsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/workflows/${params.workflow_id}/runs`,
        {
          searchParams: sanitizeSearchParams(
            pick(
              params,
              'actor',
              'branch',
              'event',
              'status',
              'per_page',
              'page',
              'created',
              'exclude_pull_requests',
              'check_suite_id',
              'head_sha'
            )
          )
        }
      )
      .json<github.ActionsListWorkflowRunsResponse>()
  }

  /**
 * > [!WARNING]
> This endpoint is in the process of closing down. Refer to "[Actions Get workflow usage and Get workflow run usage endpoints closing down](https://github.blog/changelog/2025-02-02-actions-get-workflow-usage-and-get-workflow-run-usage-endpoints-closing-down/)" for more information.

Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".

You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_actions_get_workflow_usage',
    description: `> [!WARNING]
> This endpoint is in the process of closing down. Refer to "[Actions Get workflow usage and Get workflow run usage endpoints closing down](https://github.blog/changelog/2025-02-02-actions-get-workflow-usage-and-get-workflow-run-usage-endpoints-closing-down/)" for more information.

Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".

You can replace \`workflow_id\` with the workflow file name. For example, you could use \`main.yaml\`.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ActionsGetWorkflowUsageParamsSchema,
    tags: ['actions']
  })
  async actionsGetWorkflowUsage(
    params: github.ActionsGetWorkflowUsageParams
  ): Promise<github.ActionsGetWorkflowUsageResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/actions/workflows/${params.workflow_id}/timing`,
        {}
      )
      .json<github.ActionsGetWorkflowUsageResponse>()
  }

  /**
 * Lists a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes, and associates these changes with commits and users.

For more information about viewing repository activity,
see "[Viewing activity and data for your repository](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository).".
 */
  @aiFunction({
    name: 'github_repos_list_activities',
    description: `Lists a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes, and associates these changes with commits and users.

For more information about viewing repository activity,
see "[Viewing activity and data for your repository](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository).".`,
    inputSchema: github.ReposListActivitiesParamsSchema,
    tags: ['repos']
  })
  async reposListActivities(
    params: github.ReposListActivitiesParams
  ): Promise<github.ReposListActivitiesResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/activity`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'direction',
            'per_page',
            'before',
            'after',
            'ref',
            'actor',
            'time_period',
            'activity_type'
          )
        )
      })
      .json<github.ReposListActivitiesResponse>()
  }

  /**
   * Lists the [available assignees](https://docs.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository.
   */
  @aiFunction({
    name: 'github_issues_list_assignees',
    description: `Lists the [available assignees](https://docs.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository.`,
    inputSchema: github.IssuesListAssigneesParamsSchema,
    tags: ['issues']
  })
  async issuesListAssignees(
    params: github.IssuesListAssigneesParams
  ): Promise<github.IssuesListAssigneesResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/assignees`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.IssuesListAssigneesResponse>()
  }

  /**
 * Checks if a user has permission to be assigned to an issue in this repository.

If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned.

Otherwise a `404` status code is returned.
 */
  @aiFunction({
    name: 'github_issues_check_user_can_be_assigned',
    description: `Checks if a user has permission to be assigned to an issue in this repository.

If the \`assignee\` can be assigned to issues in the repository, a \`204\` header with no content is returned.

Otherwise a \`404\` status code is returned.`,
    inputSchema: github.IssuesCheckUserCanBeAssignedParamsSchema,
    tags: ['issues']
  })
  async issuesCheckUserCanBeAssigned(
    params: github.IssuesCheckUserCanBeAssignedParams
  ): Promise<github.IssuesCheckUserCanBeAssignedResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/assignees/${params.assignee}`,
        {}
      )
      .json<github.IssuesCheckUserCanBeAssignedResponse>()
  }

  /**
 * Store an artifact attestation and associate it with a repository.

The authenticated user must have write permission to the repository and, if using a fine-grained access token, the `attestations:write` permission is required.

Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For more information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
 */
  @aiFunction({
    name: 'github_repos_create_attestation',
    description: `Store an artifact attestation and associate it with a repository.

The authenticated user must have write permission to the repository and, if using a fine-grained access token, the \`attestations:write\` permission is required.

Artifact attestations are meant to be created using the [attest action](https://github.com/actions/attest). For more information, see our guide on [using artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).`,
    inputSchema: github.ReposCreateAttestationParamsSchema,
    tags: ['repos']
  })
  async reposCreateAttestation(
    params: github.ReposCreateAttestationParams
  ): Promise<github.ReposCreateAttestationResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/attestations`, {
        json: pick(params, 'bundle')
      })
      .json<github.ReposCreateAttestationResponse>()
  }

  /**
 * List a collection of artifact attestations with a given subject digest that are associated with a repository.

The authenticated user making the request must have read access to the repository. In addition, when using a fine-grained access token the `attestations:read` permission is required.

**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
 */
  @aiFunction({
    name: 'github_repos_list_attestations',
    description: `List a collection of artifact attestations with a given subject digest that are associated with a repository.

The authenticated user making the request must have read access to the repository. In addition, when using a fine-grained access token the \`attestations:read\` permission is required.

**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI \`attestation verify\` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).`,
    inputSchema: github.ReposListAttestationsParamsSchema,
    tags: ['repos']
  })
  async reposListAttestations(
    params: github.ReposListAttestationsParams
  ): Promise<github.ReposListAttestationsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/attestations/${params.subject_digest}`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'per_page', 'before', 'after', 'predicate_type')
          )
        }
      )
      .json<github.ReposListAttestationsResponse>()
  }

  /**
 * Gets all autolinks that are configured for a repository.

Information about autolinks are only available to repository administrators.
 */
  @aiFunction({
    name: 'github_repos_list_autolinks',
    description: `Gets all autolinks that are configured for a repository.

Information about autolinks are only available to repository administrators.`,
    inputSchema: github.ReposListAutolinksParamsSchema,
    tags: ['repos']
  })
  async reposListAutolinks(
    params: github.ReposListAutolinksParams
  ): Promise<github.ReposListAutolinksResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/autolinks`, {})
      .json<github.ReposListAutolinksResponse>()
  }

  /**
   * Users with admin access to the repository can create an autolink.
   */
  @aiFunction({
    name: 'github_repos_create_autolink',
    description: `Users with admin access to the repository can create an autolink.`,
    inputSchema: github.ReposCreateAutolinkParamsSchema,
    tags: ['repos']
  })
  async reposCreateAutolink(
    params: github.ReposCreateAutolinkParams
  ): Promise<github.ReposCreateAutolinkResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/autolinks`, {
        json: pick(params, 'key_prefix', 'url_template', 'is_alphanumeric')
      })
      .json<github.ReposCreateAutolinkResponse>()
  }

  /**
 * This returns a single autolink reference by ID that was configured for the given repository.

Information about autolinks are only available to repository administrators.
 */
  @aiFunction({
    name: 'github_repos_get_autolink',
    description: `This returns a single autolink reference by ID that was configured for the given repository.

Information about autolinks are only available to repository administrators.`,
    inputSchema: github.ReposGetAutolinkParamsSchema,
    tags: ['repos']
  })
  async reposGetAutolink(
    params: github.ReposGetAutolinkParams
  ): Promise<github.ReposGetAutolinkResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/autolinks/${params.autolink_id}`,
        {}
      )
      .json<github.ReposGetAutolinkResponse>()
  }

  /**
 * This deletes a single autolink reference by ID that was configured for the given repository.

Information about autolinks are only available to repository administrators.
 */
  @aiFunction({
    name: 'github_repos_delete_autolink',
    description: `This deletes a single autolink reference by ID that was configured for the given repository.

Information about autolinks are only available to repository administrators.`,
    inputSchema: github.ReposDeleteAutolinkParamsSchema,
    tags: ['repos']
  })
  async reposDeleteAutolink(
    params: github.ReposDeleteAutolinkParams
  ): Promise<github.ReposDeleteAutolinkResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/autolinks/${params.autolink_id}`,
        {}
      )
      .json<github.ReposDeleteAutolinkResponse>()
  }

  /**
   * Shows whether Dependabot security updates are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)".
   */
  @aiFunction({
    name: 'github_repos_check_automated_security_fixes',
    description: `Shows whether Dependabot security updates are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)".`,
    inputSchema: github.ReposCheckAutomatedSecurityFixesParamsSchema,
    tags: ['repos']
  })
  async reposCheckAutomatedSecurityFixes(
    params: github.ReposCheckAutomatedSecurityFixesParams
  ): Promise<github.ReposCheckAutomatedSecurityFixesResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/automated-security-fixes`,
        {}
      )
      .json<github.ReposCheckAutomatedSecurityFixesResponse>()
  }

  /**
   * Enables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)".
   */
  @aiFunction({
    name: 'github_repos_enable_automated_security_fixes',
    description: `Enables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)".`,
    inputSchema: github.ReposEnableAutomatedSecurityFixesParamsSchema,
    tags: ['repos']
  })
  async reposEnableAutomatedSecurityFixes(
    params: github.ReposEnableAutomatedSecurityFixesParams
  ): Promise<github.ReposEnableAutomatedSecurityFixesResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/automated-security-fixes`,
        {}
      )
      .json<github.ReposEnableAutomatedSecurityFixesResponse>()
  }

  /**
   * Disables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)".
   */
  @aiFunction({
    name: 'github_repos_disable_automated_security_fixes',
    description: `Disables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring Dependabot security updates](https://docs.github.com/articles/configuring-automated-security-fixes)".`,
    inputSchema: github.ReposDisableAutomatedSecurityFixesParamsSchema,
    tags: ['repos']
  })
  async reposDisableAutomatedSecurityFixes(
    params: github.ReposDisableAutomatedSecurityFixesParams
  ): Promise<github.ReposDisableAutomatedSecurityFixesResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/automated-security-fixes`,
        {}
      )
      .json<github.ReposDisableAutomatedSecurityFixesResponse>()
  }

  /**
   * List branches.
   */
  @aiFunction({
    name: 'github_repos_list_branches',
    description: `List branches.`,
    inputSchema: github.ReposListBranchesParamsSchema,
    tags: ['repos']
  })
  async reposListBranches(
    params: github.ReposListBranchesParams
  ): Promise<github.ReposListBranchesResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/branches`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'protected', 'per_page', 'page')
        )
      })
      .json<github.ReposListBranchesResponse>()
  }

  /**
   * Get a branch.
   */
  @aiFunction({
    name: 'github_repos_get_branch',
    description: `Get a branch.`,
    inputSchema: github.ReposGetBranchParamsSchema,
    tags: ['repos']
  })
  async reposGetBranch(
    params: github.ReposGetBranchParams
  ): Promise<github.ReposGetBranchResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}`,
        {}
      )
      .json<github.ReposGetBranchResponse>()
  }

  /**
   * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
   */
  @aiFunction({
    name: 'github_repos_get_branch_protection',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.`,
    inputSchema: github.ReposGetBranchProtectionParamsSchema,
    tags: ['repos']
  })
  async reposGetBranchProtection(
    params: github.ReposGetBranchProtectionParams
  ): Promise<github.ReposGetBranchProtectionResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection`,
        {}
      )
      .json<github.ReposGetBranchProtectionResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Protecting a branch requires admin or owner permissions to the repository.

> [!NOTE]
> Passing new arrays of `users` and `teams` replaces their previous values.

> [!NOTE]
> The list of users, apps, and teams in total is limited to 100 items.
 */
  @aiFunction({
    name: 'github_repos_update_branch_protection',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Protecting a branch requires admin or owner permissions to the repository.

> [!NOTE]
> Passing new arrays of \`users\` and \`teams\` replaces their previous values.

> [!NOTE]
> The list of users, apps, and teams in total is limited to 100 items.`,
    inputSchema: github.ReposUpdateBranchProtectionParamsSchema,
    tags: ['repos']
  })
  async reposUpdateBranchProtection(
    params: github.ReposUpdateBranchProtectionParams
  ): Promise<github.ReposUpdateBranchProtectionResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection`,
        {
          json: pick(
            params,
            'required_status_checks',
            'enforce_admins',
            'required_pull_request_reviews',
            'restrictions',
            'required_linear_history',
            'allow_force_pushes',
            'allow_deletions',
            'block_creations',
            'required_conversation_resolution',
            'lock_branch',
            'allow_fork_syncing'
          )
        }
      )
      .json<github.ReposUpdateBranchProtectionResponse>()
  }

  /**
   * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
   */
  @aiFunction({
    name: 'github_repos_delete_branch_protection',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.`,
    inputSchema: github.ReposDeleteBranchProtectionParamsSchema,
    tags: ['repos']
  })
  async reposDeleteBranchProtection(
    params: github.ReposDeleteBranchProtectionParams
  ): Promise<github.ReposDeleteBranchProtectionResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection`,
        {}
      )
      .json<github.ReposDeleteBranchProtectionResponse>()
  }

  /**
   * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
   */
  @aiFunction({
    name: 'github_repos_get_admin_branch_protection',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.`,
    inputSchema: github.ReposGetAdminBranchProtectionParamsSchema,
    tags: ['repos']
  })
  async reposGetAdminBranchProtection(
    params: github.ReposGetAdminBranchProtectionParams
  ): Promise<github.ReposGetAdminBranchProtectionResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/enforce_admins`,
        {}
      )
      .json<github.ReposGetAdminBranchProtectionResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.
 */
  @aiFunction({
    name: 'github_repos_set_admin_branch_protection',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.`,
    inputSchema: github.ReposSetAdminBranchProtectionParamsSchema,
    tags: ['repos']
  })
  async reposSetAdminBranchProtection(
    params: github.ReposSetAdminBranchProtectionParams
  ): Promise<github.ReposSetAdminBranchProtectionResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/enforce_admins`,
        {}
      )
      .json<github.ReposSetAdminBranchProtectionResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.
 */
  @aiFunction({
    name: 'github_repos_delete_admin_branch_protection',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.`,
    inputSchema: github.ReposDeleteAdminBranchProtectionParamsSchema,
    tags: ['repos']
  })
  async reposDeleteAdminBranchProtection(
    params: github.ReposDeleteAdminBranchProtectionParams
  ): Promise<github.ReposDeleteAdminBranchProtectionResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/enforce_admins`,
        {}
      )
      .json<github.ReposDeleteAdminBranchProtectionResponse>()
  }

  /**
   * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
   */
  @aiFunction({
    name: 'github_repos_get_pull_request_review_protection',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.`,
    inputSchema: github.ReposGetPullRequestReviewProtectionParamsSchema,
    tags: ['repos']
  })
  async reposGetPullRequestReviewProtection(
    params: github.ReposGetPullRequestReviewProtectionParams
  ): Promise<github.ReposGetPullRequestReviewProtectionResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/required_pull_request_reviews`,
        {}
      )
      .json<github.ReposGetPullRequestReviewProtectionResponse>()
  }

  /**
   * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
   */
  @aiFunction({
    name: 'github_repos_delete_pull_request_review_protection',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.`,
    inputSchema: github.ReposDeletePullRequestReviewProtectionParamsSchema,
    tags: ['repos']
  })
  async reposDeletePullRequestReviewProtection(
    params: github.ReposDeletePullRequestReviewProtectionParams
  ): Promise<github.ReposDeletePullRequestReviewProtectionResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/required_pull_request_reviews`,
        {}
      )
      .json<github.ReposDeletePullRequestReviewProtectionResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled.

> [!NOTE]
> Passing new arrays of `users` and `teams` replaces their previous values.
 */
  @aiFunction({
    name: 'github_repos_update_pull_request_review_protection',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled.

> [!NOTE]
> Passing new arrays of \`users\` and \`teams\` replaces their previous values.`,
    inputSchema: github.ReposUpdatePullRequestReviewProtectionParamsSchema,
    tags: ['repos']
  })
  async reposUpdatePullRequestReviewProtection(
    params: github.ReposUpdatePullRequestReviewProtectionParams
  ): Promise<github.ReposUpdatePullRequestReviewProtectionResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/required_pull_request_reviews`,
        {
          json: pick(
            params,
            'dismissal_restrictions',
            'dismiss_stale_reviews',
            'require_code_owner_reviews',
            'required_approving_review_count',
            'require_last_push_approval',
            'bypass_pull_request_allowances'
          )
        }
      )
      .json<github.ReposUpdatePullRequestReviewProtectionResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://docs.github.com/articles/signing-commits-with-gpg) in GitHub Help.

> [!NOTE]
> You must enable branch protection to require signed commits.
 */
  @aiFunction({
    name: 'github_repos_get_commit_signature_protection',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of \`true\` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://docs.github.com/articles/signing-commits-with-gpg) in GitHub Help.

> [!NOTE]
> You must enable branch protection to require signed commits.`,
    inputSchema: github.ReposGetCommitSignatureProtectionParamsSchema,
    tags: ['repos']
  })
  async reposGetCommitSignatureProtection(
    params: github.ReposGetCommitSignatureProtectionParams
  ): Promise<github.ReposGetCommitSignatureProtectionResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/required_signatures`,
        {}
      )
      .json<github.ReposGetCommitSignatureProtectionResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits.
 */
  @aiFunction({
    name: 'github_repos_create_commit_signature_protection',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits.`,
    inputSchema: github.ReposCreateCommitSignatureProtectionParamsSchema,
    tags: ['repos']
  })
  async reposCreateCommitSignatureProtection(
    params: github.ReposCreateCommitSignatureProtectionParams
  ): Promise<github.ReposCreateCommitSignatureProtectionResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/required_signatures`,
        {}
      )
      .json<github.ReposCreateCommitSignatureProtectionResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits.
 */
  @aiFunction({
    name: 'github_repos_delete_commit_signature_protection',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits.`,
    inputSchema: github.ReposDeleteCommitSignatureProtectionParamsSchema,
    tags: ['repos']
  })
  async reposDeleteCommitSignatureProtection(
    params: github.ReposDeleteCommitSignatureProtectionParams
  ): Promise<github.ReposDeleteCommitSignatureProtectionResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/required_signatures`,
        {}
      )
      .json<github.ReposDeleteCommitSignatureProtectionResponse>()
  }

  /**
   * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
   */
  @aiFunction({
    name: 'github_repos_get_status_checks_protection',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.`,
    inputSchema: github.ReposGetStatusChecksProtectionParamsSchema,
    tags: ['repos']
  })
  async reposGetStatusChecksProtection(
    params: github.ReposGetStatusChecksProtectionParams
  ): Promise<github.ReposGetStatusChecksProtectionResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/required_status_checks`,
        {}
      )
      .json<github.ReposGetStatusChecksProtectionResponse>()
  }

  /**
   * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
   */
  @aiFunction({
    name: 'github_repos_remove_status_check_protection',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.`,
    inputSchema: github.ReposRemoveStatusCheckProtectionParamsSchema,
    tags: ['repos']
  })
  async reposRemoveStatusCheckProtection(
    params: github.ReposRemoveStatusCheckProtectionParams
  ): Promise<github.ReposRemoveStatusCheckProtectionResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/required_status_checks`,
        {}
      )
      .json<github.ReposRemoveStatusCheckProtectionResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled.
 */
  @aiFunction({
    name: 'github_repos_update_status_check_protection',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled.`,
    inputSchema: github.ReposUpdateStatusCheckProtectionParamsSchema,
    tags: ['repos']
  })
  async reposUpdateStatusCheckProtection(
    params: github.ReposUpdateStatusCheckProtectionParams
  ): Promise<github.ReposUpdateStatusCheckProtectionResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/required_status_checks`,
        {
          json: pick(params, 'strict', 'contexts', 'checks')
        }
      )
      .json<github.ReposUpdateStatusCheckProtectionResponse>()
  }

  /**
   * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
   */
  @aiFunction({
    name: 'github_repos_get_all_status_check_contexts',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.`,
    inputSchema: github.ReposGetAllStatusCheckContextsParamsSchema,
    tags: ['repos']
  })
  async reposGetAllStatusCheckContexts(
    params: github.ReposGetAllStatusCheckContextsParams
  ): Promise<github.ReposGetAllStatusCheckContextsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/required_status_checks/contexts`,
        {}
      )
      .json<github.ReposGetAllStatusCheckContextsResponse>()
  }

  /**
   * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
   */
  @aiFunction({
    name: 'github_repos_add_status_check_contexts',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.`,
    // TODO: Improve handling of union params
    inputSchema: github.ReposAddStatusCheckContextsParamsSchema as any,
    tags: ['repos']
  })
  async reposAddStatusCheckContexts(
    params: github.ReposAddStatusCheckContextsParams
  ): Promise<github.ReposAddStatusCheckContextsResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/required_status_checks/contexts`,
        {
          json: params
        }
      )
      .json<github.ReposAddStatusCheckContextsResponse>()
  }

  /**
   * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
   */
  @aiFunction({
    name: 'github_repos_set_status_check_contexts',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.`,
    // TODO: Improve handling of union params
    inputSchema: github.ReposSetStatusCheckContextsParamsSchema as any,
    tags: ['repos']
  })
  async reposSetStatusCheckContexts(
    params: github.ReposSetStatusCheckContextsParams
  ): Promise<github.ReposSetStatusCheckContextsResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/required_status_checks/contexts`,
        {
          json: params
        }
      )
      .json<github.ReposSetStatusCheckContextsResponse>()
  }

  /**
   * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
   */
  @aiFunction({
    name: 'github_repos_remove_status_check_contexts',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.`,
    // TODO: Improve handling of union params
    inputSchema: github.ReposRemoveStatusCheckContextsParamsSchema as any,
    tags: ['repos']
  })
  async reposRemoveStatusCheckContexts(
    params: github.ReposRemoveStatusCheckContextsParams
  ): Promise<github.ReposRemoveStatusCheckContextsResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/required_status_checks/contexts`,
        {
          json: params
        }
      )
      .json<github.ReposRemoveStatusCheckContextsResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Lists who has access to this protected branch.

> [!NOTE]
> Users, apps, and teams `restrictions` are only available for organization-owned repositories.
 */
  @aiFunction({
    name: 'github_repos_get_access_restrictions',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Lists who has access to this protected branch.

> [!NOTE]
> Users, apps, and teams \`restrictions\` are only available for organization-owned repositories.`,
    inputSchema: github.ReposGetAccessRestrictionsParamsSchema,
    tags: ['repos']
  })
  async reposGetAccessRestrictions(
    params: github.ReposGetAccessRestrictionsParams
  ): Promise<github.ReposGetAccessRestrictionsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/restrictions`,
        {}
      )
      .json<github.ReposGetAccessRestrictionsResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Disables the ability to restrict who can push to this branch.
 */
  @aiFunction({
    name: 'github_repos_delete_access_restrictions',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Disables the ability to restrict who can push to this branch.`,
    inputSchema: github.ReposDeleteAccessRestrictionsParamsSchema,
    tags: ['repos']
  })
  async reposDeleteAccessRestrictions(
    params: github.ReposDeleteAccessRestrictionsParams
  ): Promise<github.ReposDeleteAccessRestrictionsResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/restrictions`,
        {}
      )
      .json<github.ReposDeleteAccessRestrictionsResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Lists the GitHub Apps that have push access to this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch.
 */
  @aiFunction({
    name: 'github_repos_get_apps_with_access_to_protected_branch',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Lists the GitHub Apps that have push access to this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch.`,
    inputSchema: github.ReposGetAppsWithAccessToProtectedBranchParamsSchema,
    tags: ['repos']
  })
  async reposGetAppsWithAccessToProtectedBranch(
    params: github.ReposGetAppsWithAccessToProtectedBranchParams
  ): Promise<github.ReposGetAppsWithAccessToProtectedBranchResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/restrictions/apps`,
        {}
      )
      .json<github.ReposGetAppsWithAccessToProtectedBranchResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Grants the specified apps push access for this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch.
 */
  @aiFunction({
    name: 'github_repos_add_app_access_restrictions',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Grants the specified apps push access for this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch.`,
    inputSchema: github.ReposAddAppAccessRestrictionsParamsSchema,
    tags: ['repos']
  })
  async reposAddAppAccessRestrictions(
    params: github.ReposAddAppAccessRestrictionsParams
  ): Promise<github.ReposAddAppAccessRestrictionsResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/restrictions/apps`,
        {
          json: pick(params, 'apps')
        }
      )
      .json<github.ReposAddAppAccessRestrictionsResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch.
 */
  @aiFunction({
    name: 'github_repos_set_app_access_restrictions',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch.`,
    inputSchema: github.ReposSetAppAccessRestrictionsParamsSchema,
    tags: ['repos']
  })
  async reposSetAppAccessRestrictions(
    params: github.ReposSetAppAccessRestrictionsParams
  ): Promise<github.ReposSetAppAccessRestrictionsResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/restrictions/apps`,
        {
          json: pick(params, 'apps')
        }
      )
      .json<github.ReposSetAppAccessRestrictionsResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Removes the ability of an app to push to this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch.
 */
  @aiFunction({
    name: 'github_repos_remove_app_access_restrictions',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Removes the ability of an app to push to this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch.`,
    inputSchema: github.ReposRemoveAppAccessRestrictionsParamsSchema,
    tags: ['repos']
  })
  async reposRemoveAppAccessRestrictions(
    params: github.ReposRemoveAppAccessRestrictionsParams
  ): Promise<github.ReposRemoveAppAccessRestrictionsResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/restrictions/apps`,
        {
          json: pick(params, 'apps')
        }
      )
      .json<github.ReposRemoveAppAccessRestrictionsResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Lists the teams who have push access to this branch. The list includes child teams.
 */
  @aiFunction({
    name: 'github_repos_get_teams_with_access_to_protected_branch',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Lists the teams who have push access to this branch. The list includes child teams.`,
    inputSchema: github.ReposGetTeamsWithAccessToProtectedBranchParamsSchema,
    tags: ['repos']
  })
  async reposGetTeamsWithAccessToProtectedBranch(
    params: github.ReposGetTeamsWithAccessToProtectedBranchParams
  ): Promise<github.ReposGetTeamsWithAccessToProtectedBranchResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/restrictions/teams`,
        {}
      )
      .json<github.ReposGetTeamsWithAccessToProtectedBranchResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Grants the specified teams push access for this branch. You can also give push access to child teams.
 */
  @aiFunction({
    name: 'github_repos_add_team_access_restrictions',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Grants the specified teams push access for this branch. You can also give push access to child teams.`,
    // TODO: Improve handling of union params
    inputSchema: github.ReposAddTeamAccessRestrictionsParamsSchema as any,
    tags: ['repos']
  })
  async reposAddTeamAccessRestrictions(
    params: github.ReposAddTeamAccessRestrictionsParams
  ): Promise<github.ReposAddTeamAccessRestrictionsResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/restrictions/teams`,
        {
          json: params
        }
      )
      .json<github.ReposAddTeamAccessRestrictionsResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams.
 */
  @aiFunction({
    name: 'github_repos_set_team_access_restrictions',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams.`,
    // TODO: Improve handling of union params
    inputSchema: github.ReposSetTeamAccessRestrictionsParamsSchema as any,
    tags: ['repos']
  })
  async reposSetTeamAccessRestrictions(
    params: github.ReposSetTeamAccessRestrictionsParams
  ): Promise<github.ReposSetTeamAccessRestrictionsResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/restrictions/teams`,
        {
          json: params
        }
      )
      .json<github.ReposSetTeamAccessRestrictionsResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Removes the ability of a team to push to this branch. You can also remove push access for child teams.
 */
  @aiFunction({
    name: 'github_repos_remove_team_access_restrictions',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Removes the ability of a team to push to this branch. You can also remove push access for child teams.`,
    // TODO: Improve handling of union params
    inputSchema: github.ReposRemoveTeamAccessRestrictionsParamsSchema as any,
    tags: ['repos']
  })
  async reposRemoveTeamAccessRestrictions(
    params: github.ReposRemoveTeamAccessRestrictionsParams
  ): Promise<github.ReposRemoveTeamAccessRestrictionsResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/restrictions/teams`,
        {
          json: params
        }
      )
      .json<github.ReposRemoveTeamAccessRestrictionsResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Lists the people who have push access to this branch.
 */
  @aiFunction({
    name: 'github_repos_get_users_with_access_to_protected_branch',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Lists the people who have push access to this branch.`,
    inputSchema: github.ReposGetUsersWithAccessToProtectedBranchParamsSchema,
    tags: ['repos']
  })
  async reposGetUsersWithAccessToProtectedBranch(
    params: github.ReposGetUsersWithAccessToProtectedBranchParams
  ): Promise<github.ReposGetUsersWithAccessToProtectedBranchResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/restrictions/users`,
        {}
      )
      .json<github.ReposGetUsersWithAccessToProtectedBranchResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Grants the specified people push access for this branch.

| Type    | Description                                                                                                                   |
| ------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |.
 */
  @aiFunction({
    name: 'github_repos_add_user_access_restrictions',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Grants the specified people push access for this branch.

| Type    | Description                                                                                                                   |
| ------- | ----------------------------------------------------------------------------------------------------------------------------- |
| \`array\` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |.`,
    inputSchema: github.ReposAddUserAccessRestrictionsParamsSchema,
    tags: ['repos']
  })
  async reposAddUserAccessRestrictions(
    params: github.ReposAddUserAccessRestrictionsParams
  ): Promise<github.ReposAddUserAccessRestrictionsResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/restrictions/users`,
        {
          json: pick(params, 'users')
        }
      )
      .json<github.ReposAddUserAccessRestrictionsResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people.

| Type    | Description                                                                                                                   |
| ------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |.
 */
  @aiFunction({
    name: 'github_repos_set_user_access_restrictions',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people.

| Type    | Description                                                                                                                   |
| ------- | ----------------------------------------------------------------------------------------------------------------------------- |
| \`array\` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |.`,
    inputSchema: github.ReposSetUserAccessRestrictionsParamsSchema,
    tags: ['repos']
  })
  async reposSetUserAccessRestrictions(
    params: github.ReposSetUserAccessRestrictionsParams
  ): Promise<github.ReposSetUserAccessRestrictionsResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/restrictions/users`,
        {
          json: pick(params, 'users')
        }
      )
      .json<github.ReposSetUserAccessRestrictionsResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Removes the ability of a user to push to this branch.

| Type    | Description                                                                                                                                   |
| ------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `array` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |.
 */
  @aiFunction({
    name: 'github_repos_remove_user_access_restrictions',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Removes the ability of a user to push to this branch.

| Type    | Description                                                                                                                                   |
| ------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| \`array\` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |.`,
    inputSchema: github.ReposRemoveUserAccessRestrictionsParamsSchema,
    tags: ['repos']
  })
  async reposRemoveUserAccessRestrictions(
    params: github.ReposRemoveUserAccessRestrictionsParams
  ): Promise<github.ReposRemoveUserAccessRestrictionsResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/protection/restrictions/users`,
        {
          json: pick(params, 'users')
        }
      )
      .json<github.ReposRemoveUserAccessRestrictionsResponse>()
  }

  /**
 * Renames a branch in a repository.

> [!NOTE]
> Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)".

The authenticated user must have push access to the branch. If the branch is the default branch, the authenticated user must also have admin or owner permissions.

In order to rename the default branch, fine-grained access tokens also need the `administration:write` repository permission.
 */
  @aiFunction({
    name: 'github_repos_rename_branch',
    description: `Renames a branch in a repository.

> [!NOTE]
> Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)".

The authenticated user must have push access to the branch. If the branch is the default branch, the authenticated user must also have admin or owner permissions.

In order to rename the default branch, fine-grained access tokens also need the \`administration:write\` repository permission.`,
    inputSchema: github.ReposRenameBranchParamsSchema,
    tags: ['repos']
  })
  async reposRenameBranch(
    params: github.ReposRenameBranchParams
  ): Promise<github.ReposRenameBranchResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/branches/${params.branch}/rename`,
        {
          json: pick(params, 'new_name')
        }
      )
      .json<github.ReposRenameBranchResponse>()
  }

  /**
 * Creates a new check run for a specific commit in a repository.

To create a check run, you must use a GitHub App. OAuth apps and authenticated users are not able to create a check suite.

In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs.

> [!NOTE]
> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.
 */
  @aiFunction({
    name: 'github_checks_create',
    description: `Creates a new check run for a specific commit in a repository.

To create a check run, you must use a GitHub App. OAuth apps and authenticated users are not able to create a check suite.

In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs.

> [!NOTE]
> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array.`,
    // TODO: Improve handling of union params
    inputSchema: github.ChecksCreateParamsSchema as any,
    tags: ['checks']
  })
  async checksCreate(
    params: github.ChecksCreateParams
  ): Promise<github.ChecksCreateResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/check-runs`, {
        json: params
      })
      .json<github.ChecksCreateResponse>()
  }

  /**
 * Gets a single check run using its `id`.

> [!NOTE]
> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository.
 */
  @aiFunction({
    name: 'github_checks_get',
    description: `Gets a single check run using its \`id\`.

> [!NOTE]
> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint on a private repository.`,
    inputSchema: github.ChecksGetParamsSchema,
    tags: ['checks']
  })
  async checksGet(
    params: github.ChecksGetParams
  ): Promise<github.ChecksGetResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/check-runs/${params.check_run_id}`,
        {}
      )
      .json<github.ChecksGetResponse>()
  }

  /**
 * Updates a check run for a specific commit in a repository.

> [!NOTE]
> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.

OAuth apps and personal access tokens (classic) cannot use this endpoint.
 */
  @aiFunction({
    name: 'github_checks_update',
    description: `Updates a check run for a specific commit in a repository.

> [!NOTE]
> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array.

OAuth apps and personal access tokens (classic) cannot use this endpoint.`,
    // TODO: Improve handling of union params
    inputSchema: github.ChecksUpdateParamsSchema as any,
    tags: ['checks']
  })
  async checksUpdate(
    params: github.ChecksUpdateParams
  ): Promise<github.ChecksUpdateResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/check-runs/${params.check_run_id}`,
        {
          json: params
        }
      )
      .json<github.ChecksUpdateResponse>()
  }

  /**
 * Lists annotations for a check run using the annotation `id`.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository.
 */
  @aiFunction({
    name: 'github_checks_list_annotations',
    description: `Lists annotations for a check run using the annotation \`id\`.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint on a private repository.`,
    inputSchema: github.ChecksListAnnotationsParamsSchema,
    tags: ['checks']
  })
  async checksListAnnotations(
    params: github.ChecksListAnnotationsParams
  ): Promise<github.ChecksListAnnotationsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/check-runs/${params.check_run_id}/annotations`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ChecksListAnnotationsResponse>()
  }

  /**
 * Triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) event with the action `rerequested`. When a check run is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.

For more information about how to re-run GitHub Actions jobs, see "[Re-run a job from a workflow run](https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)".

OAuth apps and personal access tokens (classic) cannot use this endpoint.
 */
  @aiFunction({
    name: 'github_checks_rerequest_run',
    description: `Triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [\`check_run\` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) event with the action \`rerequested\`. When a check run is \`rerequested\`, its \`status\` is reset to \`queued\` and the \`conclusion\` is cleared.

For more information about how to re-run GitHub Actions jobs, see "[Re-run a job from a workflow run](https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)".

OAuth apps and personal access tokens (classic) cannot use this endpoint.`,
    inputSchema: github.ChecksRerequestRunParamsSchema,
    tags: ['checks']
  })
  async checksRerequestRun(
    params: github.ChecksRerequestRunParams
  ): Promise<github.ChecksRerequestRunResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/check-runs/${params.check_run_id}/rerequest`,
        {}
      )
      .json<github.ChecksRerequestRunResponse>()
  }

  /**
 * Creates a check suite manually. By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/checks/runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites)".

> [!NOTE]
> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.

OAuth apps and personal access tokens (classic) cannot use this endpoint.
 */
  @aiFunction({
    name: 'github_checks_create_suite',
    description: `Creates a check suite manually. By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/checks/runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites)".

> [!NOTE]
> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`.

OAuth apps and personal access tokens (classic) cannot use this endpoint.`,
    inputSchema: github.ChecksCreateSuiteParamsSchema,
    tags: ['checks']
  })
  async checksCreateSuite(
    params: github.ChecksCreateSuiteParams
  ): Promise<github.ChecksCreateSuiteResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/check-suites`, {
        json: pick(params, 'head_sha')
      })
      .json<github.ChecksCreateSuiteResponse>()
  }

  /**
 * Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/rest/checks/suites#create-a-check-suite).
You must have admin permissions in the repository to set preferences for check suites.
 */
  @aiFunction({
    name: 'github_checks_set_suites_preferences',
    description: `Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/rest/checks/suites#create-a-check-suite).
You must have admin permissions in the repository to set preferences for check suites.`,
    inputSchema: github.ChecksSetSuitesPreferencesParamsSchema,
    tags: ['checks']
  })
  async checksSetSuitesPreferences(
    params: github.ChecksSetSuitesPreferencesParams
  ): Promise<github.ChecksSetSuitesPreferencesResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/check-suites/preferences`,
        {
          json: pick(params, 'auto_trigger_checks')
        }
      )
      .json<github.ChecksSetSuitesPreferencesResponse>()
  }

  /**
 * Gets a single check suite using its `id`.

> [!NOTE]
> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository.
 */
  @aiFunction({
    name: 'github_checks_get_suite',
    description: `Gets a single check suite using its \`id\`.

> [!NOTE]
> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint on a private repository.`,
    inputSchema: github.ChecksGetSuiteParamsSchema,
    tags: ['checks']
  })
  async checksGetSuite(
    params: github.ChecksGetSuiteParams
  ): Promise<github.ChecksGetSuiteResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/check-suites/${params.check_suite_id}`,
        {}
      )
      .json<github.ChecksGetSuiteResponse>()
  }

  /**
 * Lists check runs for a check suite using its `id`.

> [!NOTE]
> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository.
 */
  @aiFunction({
    name: 'github_checks_list_for_suite',
    description: `Lists check runs for a check suite using its \`id\`.

> [!NOTE]
> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint on a private repository.`,
    inputSchema: github.ChecksListForSuiteParamsSchema,
    tags: ['checks']
  })
  async checksListForSuite(
    params: github.ChecksListForSuiteParams
  ): Promise<github.ChecksListForSuiteResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/check-suites/${params.check_suite_id}/check-runs`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'check_name', 'status', 'filter', 'per_page', 'page')
          )
        }
      )
      .json<github.ChecksListForSuiteResponse>()
  }

  /**
 * Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.

OAuth apps and personal access tokens (classic) cannot use this endpoint.
 */
  @aiFunction({
    name: 'github_checks_rerequest_suite',
    description: `Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [\`check_suite\` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action \`rerequested\`. When a check suite is \`rerequested\`, its \`status\` is reset to \`queued\` and the \`conclusion\` is cleared.

OAuth apps and personal access tokens (classic) cannot use this endpoint.`,
    inputSchema: github.ChecksRerequestSuiteParamsSchema,
    tags: ['checks']
  })
  async checksRerequestSuite(
    params: github.ChecksRerequestSuiteParams
  ): Promise<github.ChecksRerequestSuiteResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/check-suites/${params.check_suite_id}/rerequest`,
        {}
      )
      .json<github.ChecksRerequestSuiteResponse>()
  }

  /**
 * Lists code scanning alerts.

The response includes a `most_recent_instance` object.
This provides details of the most recent instance of this alert
for the default branch (or for the specified Git reference if you used `ref` in the request).

OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_list_alerts_for_repo',
    description: `Lists code scanning alerts.

The response includes a \`most_recent_instance\` object.
This provides details of the most recent instance of this alert
for the default branch (or for the specified Git reference if you used \`ref\` in the request).

OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningListAlertsForRepoParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningListAlertsForRepo(
    params: github.CodeScanningListAlertsForRepoParams
  ): Promise<github.CodeScanningListAlertsForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/code-scanning/alerts`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'tool_name',
            'tool_guid',
            'page',
            'per_page',
            'ref',
            'pr',
            'direction',
            'before',
            'after',
            'sort',
            'state',
            'severity'
          )
        )
      })
      .json<github.CodeScanningListAlertsForRepoResponse>()
  }

  /**
 * Gets a single code scanning alert.

OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_get_alert',
    description: `Gets a single code scanning alert.

OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningGetAlertParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningGetAlert(
    params: github.CodeScanningGetAlertParams
  ): Promise<github.CodeScanningGetAlertResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/code-scanning/alerts/${params.alert_number}`,
        {}
      )
      .json<github.CodeScanningGetAlertResponse>()
  }

  /**
 * Updates the status of a single code scanning alert.
OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_update_alert',
    description: `Updates the status of a single code scanning alert.
OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningUpdateAlertParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningUpdateAlert(
    params: github.CodeScanningUpdateAlertParams
  ): Promise<github.CodeScanningUpdateAlertResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/code-scanning/alerts/${params.alert_number}`,
        {
          json: pick(
            params,
            'state',
            'dismissed_reason',
            'dismissed_comment',
            'create_request'
          )
        }
      )
      .json<github.CodeScanningUpdateAlertResponse>()
  }

  /**
 * Gets the status and description of an autofix for a code scanning alert.

OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_get_autofix',
    description: `Gets the status and description of an autofix for a code scanning alert.

OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningGetAutofixParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningGetAutofix(
    params: github.CodeScanningGetAutofixParams
  ): Promise<github.CodeScanningGetAutofixResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/code-scanning/alerts/${params.alert_number}/autofix`,
        {}
      )
      .json<github.CodeScanningGetAutofixResponse>()
  }

  /**
 * Creates an autofix for a code scanning alert.

If a new autofix is to be created as a result of this request or is currently being generated, then this endpoint will return a 202 Accepted response.

If an autofix already exists for a given alert, then this endpoint will return a 200 OK response.

OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_create_autofix',
    description: `Creates an autofix for a code scanning alert.

If a new autofix is to be created as a result of this request or is currently being generated, then this endpoint will return a 202 Accepted response.

If an autofix already exists for a given alert, then this endpoint will return a 200 OK response.

OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningCreateAutofixParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningCreateAutofix(
    params: github.CodeScanningCreateAutofixParams
  ): Promise<github.CodeScanningCreateAutofixResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/code-scanning/alerts/${params.alert_number}/autofix`,
        {}
      )
      .json<github.CodeScanningCreateAutofixResponse>()
  }

  /**
 * Commits an autofix for a code scanning alert.

If an autofix is committed as a result of this request, then this endpoint will return a 201 Created response.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_commit_autofix',
    description: `Commits an autofix for a code scanning alert.

If an autofix is committed as a result of this request, then this endpoint will return a 201 Created response.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningCommitAutofixParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningCommitAutofix(
    params: github.CodeScanningCommitAutofixParams
  ): Promise<github.CodeScanningCommitAutofixResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/code-scanning/alerts/${params.alert_number}/autofix/commits`,
        {
          json: pick(params, 'target_ref', 'message')
        }
      )
      .json<github.CodeScanningCommitAutofixResponse>()
  }

  /**
 * Lists all instances of the specified code scanning alert.

OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_list_alert_instances',
    description: `Lists all instances of the specified code scanning alert.

OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningListAlertInstancesParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningListAlertInstances(
    params: github.CodeScanningListAlertInstancesParams
  ): Promise<github.CodeScanningListAlertInstancesResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/code-scanning/alerts/${params.alert_number}/instances`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'page', 'per_page', 'ref', 'pr')
          )
        }
      )
      .json<github.CodeScanningListAlertInstancesResponse>()
  }

  /**
 * Lists the details of all code scanning analyses for a repository,
starting with the most recent.
The response is paginated and you can use the `page` and `per_page` parameters
to list the analyses you're interested in.
By default 30 analyses are listed per page.

The `rules_count` field in the response give the number of rules
that were run in the analysis.
For very old analyses this data is not available,
and `0` is returned in this field.

> [!WARNING]
> **Closing down notice:** The `tool_name` field is closing down and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.

OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_list_recent_analyses',
    description: `Lists the details of all code scanning analyses for a repository,
starting with the most recent.
The response is paginated and you can use the \`page\` and \`per_page\` parameters
to list the analyses you're interested in.
By default 30 analyses are listed per page.

The \`rules_count\` field in the response give the number of rules
that were run in the analysis.
For very old analyses this data is not available,
and \`0\` is returned in this field.

> [!WARNING]
> **Closing down notice:** The \`tool_name\` field is closing down and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the \`tool\` field.

OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningListRecentAnalysesParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningListRecentAnalyses(
    params: github.CodeScanningListRecentAnalysesParams
  ): Promise<github.CodeScanningListRecentAnalysesResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/code-scanning/analyses`,
        {
          searchParams: sanitizeSearchParams(
            pick(
              params,
              'tool_name',
              'tool_guid',
              'page',
              'per_page',
              'pr',
              'ref',
              'sarif_id',
              'direction',
              'sort'
            )
          )
        }
      )
      .json<github.CodeScanningListRecentAnalysesResponse>()
  }

  /**
 * Gets a specified code scanning analysis for a repository.

The default JSON response contains fields that describe the analysis.
This includes the Git reference and commit SHA to which the analysis relates,
the datetime of the analysis, the name of the code scanning tool,
and the number of alerts.

The `rules_count` field in the default response give the number of rules
that were run in the analysis.
For very old analyses this data is not available,
and `0` is returned in this field.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/sarif+json`**: Instead of returning a summary of the analysis, this endpoint returns a subset of the analysis data that was uploaded. The data is formatted as [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). It also returns additional data such as the `github/alertNumber` and `github/alertUrl` properties.

OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_get_analysis',
    description: `Gets a specified code scanning analysis for a repository.

The default JSON response contains fields that describe the analysis.
This includes the Git reference and commit SHA to which the analysis relates,
the datetime of the analysis, the name of the code scanning tool,
and the number of alerts.

The \`rules_count\` field in the default response give the number of rules
that were run in the analysis.
For very old analyses this data is not available,
and \`0\` is returned in this field.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/sarif+json\`**: Instead of returning a summary of the analysis, this endpoint returns a subset of the analysis data that was uploaded. The data is formatted as [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). It also returns additional data such as the \`github/alertNumber\` and \`github/alertUrl\` properties.

OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningGetAnalysisParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningGetAnalysis(
    params: github.CodeScanningGetAnalysisParams
  ): Promise<github.CodeScanningGetAnalysisResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/code-scanning/analyses/${params.analysis_id}`,
        {}
      )
      .json<github.CodeScanningGetAnalysisResponse>()
  }

  /**
 * Deletes a specified code scanning analysis from a repository.

You can delete one analysis at a time.
To delete a series of analyses, start with the most recent analysis and work backwards.
Conceptually, the process is similar to the undo function in a text editor.

When you list the analyses for a repository,
one or more will be identified as deletable in the response:

```
"deletable": true
```

An analysis is deletable when it's the most recent in a set of analyses.
Typically, a repository will have multiple sets of analyses
for each enabled code scanning tool,
where a set is determined by a unique combination of analysis values:

* `ref`
* `tool`
* `category`

If you attempt to delete an analysis that is not the most recent in a set,
you'll get a 400 response with the message:

```
Analysis specified is not deletable.
```

The response from a successful `DELETE` operation provides you with
two alternative URLs for deleting the next analysis in the set:
`next_analysis_url` and `confirm_delete_url`.
Use the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysis
in a set. This is a useful option if you want to preserve at least one analysis
for the specified tool in your repository.
Use the `confirm_delete_url` URL if you are content to remove all analyses for a tool.
When you delete the last analysis in a set, the value of `next_analysis_url` and `confirm_delete_url`
in the 200 response is `null`.

As an example of the deletion process,
let's imagine that you added a workflow that configured a particular code scanning tool
to analyze the code in a repository. This tool has added 15 analyses:
10 on the default branch, and another 5 on a topic branch.
You therefore have two separate sets of analyses for this tool.
You've now decided that you want to remove all of the analyses for the tool.
To do this you must make 15 separate deletion requests.
To start, you must find an analysis that's identified as deletable.
Each set of analyses always has one that's identified as deletable.
Having found the deletable analysis for one of the two sets,
delete this analysis and then continue deleting the next analysis in the set until they're all deleted.
Then repeat the process for the second set.
The procedure therefore consists of a nested loop:

**Outer loop**:
* List the analyses for the repository, filtered by tool.
* Parse this list to find a deletable analysis. If found:

  **Inner loop**:
  * Delete the identified analysis.
  * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration.

The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_delete_analysis',
    description: `Deletes a specified code scanning analysis from a repository.

You can delete one analysis at a time.
To delete a series of analyses, start with the most recent analysis and work backwards.
Conceptually, the process is similar to the undo function in a text editor.

When you list the analyses for a repository,
one or more will be identified as deletable in the response:

\`\`\`
"deletable": true
\`\`\`

An analysis is deletable when it's the most recent in a set of analyses.
Typically, a repository will have multiple sets of analyses
for each enabled code scanning tool,
where a set is determined by a unique combination of analysis values:

* \`ref\`
* \`tool\`
* \`category\`

If you attempt to delete an analysis that is not the most recent in a set,
you'll get a 400 response with the message:

\`\`\`
Analysis specified is not deletable.
\`\`\`

The response from a successful \`DELETE\` operation provides you with
two alternative URLs for deleting the next analysis in the set:
\`next_analysis_url\` and \`confirm_delete_url\`.
Use the \`next_analysis_url\` URL if you want to avoid accidentally deleting the final analysis
in a set. This is a useful option if you want to preserve at least one analysis
for the specified tool in your repository.
Use the \`confirm_delete_url\` URL if you are content to remove all analyses for a tool.
When you delete the last analysis in a set, the value of \`next_analysis_url\` and \`confirm_delete_url\`
in the 200 response is \`null\`.

As an example of the deletion process,
let's imagine that you added a workflow that configured a particular code scanning tool
to analyze the code in a repository. This tool has added 15 analyses:
10 on the default branch, and another 5 on a topic branch.
You therefore have two separate sets of analyses for this tool.
You've now decided that you want to remove all of the analyses for the tool.
To do this you must make 15 separate deletion requests.
To start, you must find an analysis that's identified as deletable.
Each set of analyses always has one that's identified as deletable.
Having found the deletable analysis for one of the two sets,
delete this analysis and then continue deleting the next analysis in the set until they're all deleted.
Then repeat the process for the second set.
The procedure therefore consists of a nested loop:

**Outer loop**:
* List the analyses for the repository, filtered by tool.
* Parse this list to find a deletable analysis. If found:

  **Inner loop**:
  * Delete the identified analysis.
  * Parse the response for the value of \`confirm_delete_url\` and, if found, use this in the next iteration.

The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the \`confirm_delete_url\` value. Alternatively, you could use the \`next_analysis_url\` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningDeleteAnalysisParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningDeleteAnalysis(
    params: github.CodeScanningDeleteAnalysisParams
  ): Promise<github.CodeScanningDeleteAnalysisResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/code-scanning/analyses/${params.analysis_id}`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'confirm_delete'))
        }
      )
      .json<github.CodeScanningDeleteAnalysisResponse>()
  }

  /**
 * Lists the CodeQL databases that are available in a repository.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_list_codeql_databases',
    description: `Lists the CodeQL databases that are available in a repository.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningListCodeqlDatabasesParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningListCodeqlDatabases(
    params: github.CodeScanningListCodeqlDatabasesParams
  ): Promise<github.CodeScanningListCodeqlDatabasesResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/code-scanning/codeql/databases`,
        {}
      )
      .json<github.CodeScanningListCodeqlDatabasesResponse>()
  }

  /**
 * Gets a CodeQL database for a language in a repository.

By default this endpoint returns JSON metadata about the CodeQL database. To
download the CodeQL database binary content, set the `Accept` header of the request
to [`application/zip`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types), and make sure
your HTTP client is configured to follow redirects or use the `Location` header
to make a second request to get the redirect URL.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_get_codeql_database',
    description: `Gets a CodeQL database for a language in a repository.

By default this endpoint returns JSON metadata about the CodeQL database. To
download the CodeQL database binary content, set the \`Accept\` header of the request
to [\`application/zip\`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types), and make sure
your HTTP client is configured to follow redirects or use the \`Location\` header
to make a second request to get the redirect URL.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningGetCodeqlDatabaseParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningGetCodeqlDatabase(
    params: github.CodeScanningGetCodeqlDatabaseParams
  ): Promise<github.CodeScanningGetCodeqlDatabaseResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/code-scanning/codeql/databases/${params.language}`,
        {}
      )
      .json<github.CodeScanningGetCodeqlDatabaseResponse>()
  }

  /**
 * Deletes a CodeQL database for a language in a repository.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_delete_codeql_database',
    description: `Deletes a CodeQL database for a language in a repository.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningDeleteCodeqlDatabaseParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningDeleteCodeqlDatabase(
    params: github.CodeScanningDeleteCodeqlDatabaseParams
  ): Promise<github.CodeScanningDeleteCodeqlDatabaseResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/code-scanning/codeql/databases/${params.language}`,
        {}
      )
      .json<github.CodeScanningDeleteCodeqlDatabaseResponse>()
  }

  /**
 * Creates a new CodeQL variant analysis, which will run a CodeQL query against one or more repositories.

Get started by learning more about [running CodeQL queries at scale with Multi-Repository Variant Analysis](https://docs.github.com/code-security/codeql-for-vs-code/getting-started-with-codeql-for-vs-code/running-codeql-queries-at-scale-with-multi-repository-variant-analysis).

Use the `owner` and `repo` parameters in the URL to specify the controller repository that
will be used for running GitHub Actions workflows and storing the results of the CodeQL variant analysis.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_scanning_create_variant_analysis',
    description: `Creates a new CodeQL variant analysis, which will run a CodeQL query against one or more repositories.

Get started by learning more about [running CodeQL queries at scale with Multi-Repository Variant Analysis](https://docs.github.com/code-security/codeql-for-vs-code/getting-started-with-codeql-for-vs-code/running-codeql-queries-at-scale-with-multi-repository-variant-analysis).

Use the \`owner\` and \`repo\` parameters in the URL to specify the controller repository that
will be used for running GitHub Actions workflows and storing the results of the CodeQL variant analysis.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    // TODO: Improve handling of union params
    inputSchema: github.CodeScanningCreateVariantAnalysisParamsSchema as any,
    tags: ['code-scanning']
  })
  async codeScanningCreateVariantAnalysis(
    params: github.CodeScanningCreateVariantAnalysisParams
  ): Promise<github.CodeScanningCreateVariantAnalysisResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/code-scanning/codeql/variant-analyses`,
        {
          json: params
        }
      )
      .json<github.CodeScanningCreateVariantAnalysisResponse>()
  }

  /**
 * Gets the summary of a CodeQL variant analysis.

OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_get_variant_analysis',
    description: `Gets the summary of a CodeQL variant analysis.

OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningGetVariantAnalysisParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningGetVariantAnalysis(
    params: github.CodeScanningGetVariantAnalysisParams
  ): Promise<github.CodeScanningGetVariantAnalysisResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/code-scanning/codeql/variant-analyses/${params.codeql_variant_analysis_id}`,
        {}
      )
      .json<github.CodeScanningGetVariantAnalysisResponse>()
  }

  /**
 * Gets the analysis status of a repository in a CodeQL variant analysis.

OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_get_variant_analysis_repo_task',
    description: `Gets the analysis status of a repository in a CodeQL variant analysis.

OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningGetVariantAnalysisRepoTaskParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningGetVariantAnalysisRepoTask(
    params: github.CodeScanningGetVariantAnalysisRepoTaskParams
  ): Promise<github.CodeScanningGetVariantAnalysisRepoTaskResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/code-scanning/codeql/variant-analyses/${params.codeql_variant_analysis_id}/repos/${params.repo_owner}/${params.repo_name}`,
        {}
      )
      .json<github.CodeScanningGetVariantAnalysisRepoTaskResponse>()
  }

  /**
 * Gets a code scanning default setup configuration.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_get_default_setup',
    description: `Gets a code scanning default setup configuration.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningGetDefaultSetupParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningGetDefaultSetup(
    params: github.CodeScanningGetDefaultSetupParams
  ): Promise<github.CodeScanningGetDefaultSetupResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/code-scanning/default-setup`,
        {}
      )
      .json<github.CodeScanningGetDefaultSetupResponse>()
  }

  /**
 * Updates a code scanning default setup configuration.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_update_default_setup',
    description: `Updates a code scanning default setup configuration.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningUpdateDefaultSetupParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningUpdateDefaultSetup(
    params: github.CodeScanningUpdateDefaultSetupParams
  ): Promise<github.CodeScanningUpdateDefaultSetupResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/code-scanning/default-setup`,
        {
          json: pick(
            params,
            'state',
            'runner_type',
            'runner_label',
            'query_suite',
            'languages'
          )
        }
      )
      .json<github.CodeScanningUpdateDefaultSetupResponse>()
  }

  /**
 * Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. For troubleshooting information, see "[Troubleshooting SARIF uploads](https://docs.github.com/code-security/code-scanning/troubleshooting-sarif)."

There are two places where you can upload code scanning results.
 - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see "[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)."
 - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see "[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository)."

You must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example:

```
gzip -c analysis-data.sarif | base64 -w0
```

SARIF upload supports a maximum number of entries per the following data objects, and an analysis will be rejected if any of these objects is above its maximum value. For some objects, there are additional values over which the entries will be ignored while keeping the most important entries whenever applicable.
To get the most out of your analysis when it includes data above the supported limits, try to optimize the analysis configuration. For example, for the CodeQL tool, identify and remove the most noisy queries. For more information, see "[SARIF results exceed one or more limits](https://docs.github.com/code-security/code-scanning/troubleshooting-sarif/results-exceed-limit)."


| **SARIF data**                   | **Maximum values** | **Additional limits**                                                            |
|----------------------------------|:------------------:|----------------------------------------------------------------------------------|
| Runs per file                    |         20         |                                                                                  |
| Results per run                  |       25,000       | Only the top 5,000 results will be included, prioritized by severity.            |
| Rules per run                    |       25,000       |                                                                                  |
| Tool extensions per run          |        100         |                                                                                  |
| Thread Flow Locations per result |       10,000       | Only the top 1,000 Thread Flow Locations will be included, using prioritization. |
| Location per result	             |       1,000        | Only 100 locations will be included.                                             |
| Tags per rule	                   |         20         | Only 10 tags will be included.                                                   |


The `202 Accepted` response includes an `id` value.
You can use this ID to check the status of the upload by using it in the `/sarifs/{sarif_id}` endpoint.
For more information, see "[Get information about a SARIF upload](/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload)."

OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.

This endpoint is limited to 1,000 requests per hour for each user or app installation calling it.
 */
  @aiFunction({
    name: 'github_code_scanning_upload_sarif',
    description: `Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. For troubleshooting information, see "[Troubleshooting SARIF uploads](https://docs.github.com/code-security/code-scanning/troubleshooting-sarif)."

There are two places where you can upload code scanning results.
 - If you upload to a pull request, for example \`--ref refs/pull/42/merge\` or \`--ref refs/pull/42/head\`, then the results appear as alerts in a pull request check. For more information, see "[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)."
 - If you upload to a branch, for example \`--ref refs/heads/my-branch\`, then the results appear in the **Security** tab for your repository. For more information, see "[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository)."

You must compress the SARIF-formatted analysis data that you want to upload, using \`gzip\`, and then encode it as a Base64 format string. For example:

\`\`\`
gzip -c analysis-data.sarif | base64 -w0
\`\`\`

SARIF upload supports a maximum number of entries per the following data objects, and an analysis will be rejected if any of these objects is above its maximum value. For some objects, there are additional values over which the entries will be ignored while keeping the most important entries whenever applicable.
To get the most out of your analysis when it includes data above the supported limits, try to optimize the analysis configuration. For example, for the CodeQL tool, identify and remove the most noisy queries. For more information, see "[SARIF results exceed one or more limits](https://docs.github.com/code-security/code-scanning/troubleshooting-sarif/results-exceed-limit)."


| **SARIF data**                   | **Maximum values** | **Additional limits**                                                            |
|----------------------------------|:------------------:|----------------------------------------------------------------------------------|
| Runs per file                    |         20         |                                                                                  |
| Results per run                  |       25,000       | Only the top 5,000 results will be included, prioritized by severity.            |
| Rules per run                    |       25,000       |                                                                                  |
| Tool extensions per run          |        100         |                                                                                  |
| Thread Flow Locations per result |       10,000       | Only the top 1,000 Thread Flow Locations will be included, using prioritization. |
| Location per result	             |       1,000        | Only 100 locations will be included.                                             |
| Tags per rule	                   |         20         | Only 10 tags will be included.                                                   |


The \`202 Accepted\` response includes an \`id\` value.
You can use this ID to check the status of the upload by using it in the \`/sarifs/{sarif_id}\` endpoint.
For more information, see "[Get information about a SARIF upload](/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload)."

OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.

This endpoint is limited to 1,000 requests per hour for each user or app installation calling it.`,
    inputSchema: github.CodeScanningUploadSarifParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningUploadSarif(
    params: github.CodeScanningUploadSarifParams
  ): Promise<github.CodeScanningUploadSarifResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/code-scanning/sarifs`,
        {
          json: pick(
            params,
            'commit_sha',
            'ref',
            'sarif',
            'checkout_uri',
            'started_at',
            'tool_name',
            'validate'
          )
        }
      )
      .json<github.CodeScanningUploadSarifResponse>()
  }

  /**
 * Gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see "[Get a code scanning analysis for a repository](/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository)."
OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.
 */
  @aiFunction({
    name: 'github_code_scanning_get_sarif',
    description: `Gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see "[Get a code scanning analysis for a repository](/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository)."
OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint with private or public repositories, or the \`public_repo\` scope to use this endpoint with only public repositories.`,
    inputSchema: github.CodeScanningGetSarifParamsSchema,
    tags: ['code-scanning']
  })
  async codeScanningGetSarif(
    params: github.CodeScanningGetSarifParams
  ): Promise<github.CodeScanningGetSarifResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/code-scanning/sarifs/${params.sarif_id}`,
        {}
      )
      .json<github.CodeScanningGetSarifResponse>()
  }

  /**
 * Get the code security configuration that manages a repository's code security settings.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_code_security_get_configuration_for_repository',
    description: `Get the code security configuration that manages a repository's code security settings.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.CodeSecurityGetConfigurationForRepositoryParamsSchema,
    tags: ['code-security']
  })
  async codeSecurityGetConfigurationForRepository(
    params: github.CodeSecurityGetConfigurationForRepositoryParams
  ): Promise<github.CodeSecurityGetConfigurationForRepositoryResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/code-security-configuration`,
        {}
      )
      .json<github.CodeSecurityGetConfigurationForRepositoryResponse>()
  }

  /**
 * List any syntax errors that are detected in the CODEOWNERS
file.

For more information about the correct CODEOWNERS syntax,
see "[About code owners](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners).".
 */
  @aiFunction({
    name: 'github_repos_codeowners_errors',
    description: `List any syntax errors that are detected in the CODEOWNERS
file.

For more information about the correct CODEOWNERS syntax,
see "[About code owners](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners).".`,
    inputSchema: github.ReposCodeownersErrorsParamsSchema,
    tags: ['repos']
  })
  async reposCodeownersErrors(
    params: github.ReposCodeownersErrorsParams
  ): Promise<github.ReposCodeownersErrorsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/codeowners/errors`, {
        searchParams: sanitizeSearchParams(pick(params, 'ref'))
      })
      .json<github.ReposCodeownersErrorsResponse>()
  }

  /**
 * Lists the codespaces associated to a specified repository and the authenticated user.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_list_in_repository_for_authenticated_user',
    description: `Lists the codespaces associated to a specified repository and the authenticated user.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema:
      github.CodespacesListInRepositoryForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesListInRepositoryForAuthenticatedUser(
    params: github.CodespacesListInRepositoryForAuthenticatedUserParams
  ): Promise<github.CodespacesListInRepositoryForAuthenticatedUserResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/codespaces`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.CodespacesListInRepositoryForAuthenticatedUserResponse>()
  }

  /**
 * Creates a codespace owned by the authenticated user in the specified repository.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_create_with_repo_for_authenticated_user',
    description: `Creates a codespace owned by the authenticated user in the specified repository.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema:
      github.CodespacesCreateWithRepoForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesCreateWithRepoForAuthenticatedUser(
    params: github.CodespacesCreateWithRepoForAuthenticatedUserParams
  ): Promise<github.CodespacesCreateWithRepoForAuthenticatedUserResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/codespaces`, {
        json: pick(
          params,
          'ref',
          'location',
          'geo',
          'client_ip',
          'machine',
          'devcontainer_path',
          'multi_repo_permissions_opt_out',
          'working_directory',
          'idle_timeout_minutes',
          'display_name',
          'retention_period_minutes'
        )
      })
      .json<github.CodespacesCreateWithRepoForAuthenticatedUserResponse>()
  }

  /**
 * Lists the devcontainer.json files associated with a specified repository and the authenticated user. These files
specify launchpoint configurations for codespaces created within the repository.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_list_devcontainers_in_repository_for_authenticated_user',
    description: `Lists the devcontainer.json files associated with a specified repository and the authenticated user. These files
specify launchpoint configurations for codespaces created within the repository.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema:
      github.CodespacesListDevcontainersInRepositoryForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesListDevcontainersInRepositoryForAuthenticatedUser(
    params: github.CodespacesListDevcontainersInRepositoryForAuthenticatedUserParams
  ): Promise<github.CodespacesListDevcontainersInRepositoryForAuthenticatedUserResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/codespaces/devcontainers`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.CodespacesListDevcontainersInRepositoryForAuthenticatedUserResponse>()
  }

  /**
 * List the machine types available for a given repository based on its configuration.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_repo_machines_for_authenticated_user',
    description: `List the machine types available for a given repository based on its configuration.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema: github.CodespacesRepoMachinesForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesRepoMachinesForAuthenticatedUser(
    params: github.CodespacesRepoMachinesForAuthenticatedUserParams
  ): Promise<github.CodespacesRepoMachinesForAuthenticatedUserResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/codespaces/machines`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'location', 'client_ip', 'ref')
        )
      })
      .json<github.CodespacesRepoMachinesForAuthenticatedUserResponse>()
  }

  /**
 * Gets the default attributes for codespaces created by the user with the repository.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_pre_flight_with_repo_for_authenticated_user',
    description: `Gets the default attributes for codespaces created by the user with the repository.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema:
      github.CodespacesPreFlightWithRepoForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesPreFlightWithRepoForAuthenticatedUser(
    params: github.CodespacesPreFlightWithRepoForAuthenticatedUserParams
  ): Promise<github.CodespacesPreFlightWithRepoForAuthenticatedUserResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/codespaces/new`, {
        searchParams: sanitizeSearchParams(pick(params, 'ref', 'client_ip'))
      })
      .json<github.CodespacesPreFlightWithRepoForAuthenticatedUserResponse>()
  }

  /**
 * Checks whether the permissions defined by a given devcontainer configuration have been accepted by the authenticated user.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_check_permissions_for_devcontainer',
    description: `Checks whether the permissions defined by a given devcontainer configuration have been accepted by the authenticated user.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema: github.CodespacesCheckPermissionsForDevcontainerParamsSchema,
    tags: ['codespaces']
  })
  async codespacesCheckPermissionsForDevcontainer(
    params: github.CodespacesCheckPermissionsForDevcontainerParams
  ): Promise<github.CodespacesCheckPermissionsForDevcontainerResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/codespaces/permissions_check`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'ref', 'devcontainer_path')
          )
        }
      )
      .json<github.CodespacesCheckPermissionsForDevcontainerResponse>()
  }

  /**
 * Lists all development environment secrets available in a repository without revealing their encrypted
values.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_list_repo_secrets',
    description: `Lists all development environment secrets available in a repository without revealing their encrypted
values.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.CodespacesListRepoSecretsParamsSchema,
    tags: ['codespaces']
  })
  async codespacesListRepoSecrets(
    params: github.CodespacesListRepoSecretsParams
  ): Promise<github.CodespacesListRepoSecretsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/codespaces/secrets`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.CodespacesListRepoSecretsResponse>()
  }

  /**
 * Gets your public key, which you need to encrypt secrets. You need to
encrypt a secret before you can create or update secrets.

If the repository is private, OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_get_repo_public_key',
    description: `Gets your public key, which you need to encrypt secrets. You need to
encrypt a secret before you can create or update secrets.

If the repository is private, OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.CodespacesGetRepoPublicKeyParamsSchema,
    tags: ['codespaces']
  })
  async codespacesGetRepoPublicKey(
    params: github.CodespacesGetRepoPublicKeyParams
  ): Promise<github.CodespacesGetRepoPublicKeyResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/codespaces/secrets/public-key`,
        {}
      )
      .json<github.CodespacesGetRepoPublicKeyResponse>()
  }

  /**
 * Gets a single repository development environment secret without revealing its encrypted value.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_get_repo_secret',
    description: `Gets a single repository development environment secret without revealing its encrypted value.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.CodespacesGetRepoSecretParamsSchema,
    tags: ['codespaces']
  })
  async codespacesGetRepoSecret(
    params: github.CodespacesGetRepoSecretParams
  ): Promise<github.CodespacesGetRepoSecretResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/codespaces/secrets/${params.secret_name}`,
        {}
      )
      .json<github.CodespacesGetRepoSecretResponse>()
  }

  /**
 * Creates or updates a repository development environment secret with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The associated user must be a repository admin.
 */
  @aiFunction({
    name: 'github_codespaces_create_or_update_repo_secret',
    description: `Creates or updates a repository development environment secret with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint. The associated user must be a repository admin.`,
    inputSchema: github.CodespacesCreateOrUpdateRepoSecretParamsSchema,
    tags: ['codespaces']
  })
  async codespacesCreateOrUpdateRepoSecret(
    params: github.CodespacesCreateOrUpdateRepoSecretParams
  ): Promise<github.CodespacesCreateOrUpdateRepoSecretResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/codespaces/secrets/${params.secret_name}`,
        {
          json: pick(params, 'encrypted_value', 'key_id')
        }
      )
      .json<github.CodespacesCreateOrUpdateRepoSecretResponse>()
  }

  /**
 * Deletes a development environment secret in a repository using the secret name.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The associated user must be a repository admin.
 */
  @aiFunction({
    name: 'github_codespaces_delete_repo_secret',
    description: `Deletes a development environment secret in a repository using the secret name.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint. The associated user must be a repository admin.`,
    inputSchema: github.CodespacesDeleteRepoSecretParamsSchema,
    tags: ['codespaces']
  })
  async codespacesDeleteRepoSecret(
    params: github.CodespacesDeleteRepoSecretParams
  ): Promise<github.CodespacesDeleteRepoSecretResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/codespaces/secrets/${params.secret_name}`,
        {}
      )
      .json<github.CodespacesDeleteRepoSecretResponse>()
  }

  /**
 * For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.
Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint.

Team members will include the members of child teams.

The authenticated user must have push access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_list_collaborators',
    description: `For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.
Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint.

Team members will include the members of child teams.

The authenticated user must have push access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`read:org\` and \`repo\` scopes to use this endpoint.`,
    inputSchema: github.ReposListCollaboratorsParamsSchema,
    tags: ['repos']
  })
  async reposListCollaborators(
    params: github.ReposListCollaboratorsParams
  ): Promise<github.ReposListCollaboratorsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/collaborators`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'affiliation', 'permission', 'per_page', 'page')
        )
      })
      .json<github.ReposListCollaboratorsResponse>()
  }

  /**
 * For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.

Team members will include the members of child teams.

The authenticated user must have push access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_check_collaborator',
    description: `For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.

Team members will include the members of child teams.

The authenticated user must have push access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`read:org\` and \`repo\` scopes to use this endpoint.`,
    inputSchema: github.ReposCheckCollaboratorParamsSchema,
    tags: ['repos']
  })
  async reposCheckCollaborator(
    params: github.ReposCheckCollaboratorParams
  ): Promise<github.ReposCheckCollaboratorResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/collaborators/${params.username}`,
        {}
      )
      .json<github.ReposCheckCollaboratorResponse>()
  }

  /**
 * This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

Adding an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)."

For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with:

```
Cannot assign {member} permission of {role name}
```

Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."

The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [API](https://docs.github.com/rest/collaborators/invitations).

**Updating an existing collaborator's permission level**

The endpoint can also be used to change the permissions of an existing collaborator without first removing and re-adding the collaborator. To change the permissions, use the same endpoint and pass a different `permission` parameter. The response will be a `204`, with no other indication that the permission level changed.

**Rate limits**

You are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository.
 */
  @aiFunction({
    name: 'github_repos_add_collaborator',
    description: `This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

Adding an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)."

For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with:

\`\`\`
Cannot assign {member} permission of {role name}
\`\`\`

Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."

The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [API](https://docs.github.com/rest/collaborators/invitations).

**Updating an existing collaborator's permission level**

The endpoint can also be used to change the permissions of an existing collaborator without first removing and re-adding the collaborator. To change the permissions, use the same endpoint and pass a different \`permission\` parameter. The response will be a \`204\`, with no other indication that the permission level changed.

**Rate limits**

You are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository.`,
    inputSchema: github.ReposAddCollaboratorParamsSchema,
    tags: ['repos']
  })
  async reposAddCollaborator(
    params: github.ReposAddCollaboratorParams
  ): Promise<github.ReposAddCollaboratorResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/collaborators/${params.username}`,
        {
          json: pick(params, 'permission')
        }
      )
      .json<github.ReposAddCollaboratorResponse>()
  }

  /**
 * Removes a collaborator from a repository.

To use this endpoint, the authenticated user must either be an administrator of the repository or target themselves for removal.

This endpoint also:
- Cancels any outstanding invitations
- Unasigns the user from any issues
- Removes access to organization projects if the user is not an organization member and is not a collaborator on any other organization repositories.
- Unstars the repository
- Updates access permissions to packages

Removing a user as a collaborator has the following effects on forks:
 - If the user had access to a fork through their membership to this repository, the user will also be removed from the fork.
 - If the user had their own fork of the repository, the fork will be deleted.
 - If the user still has read access to the repository, open pull requests by this user from a fork will be denied.

> [!NOTE]
> A user can still have access to the repository through organization permissions like base repository permissions.

Although the API responds immediately, the additional permission updates might take some extra time to complete in the background.

For more information on fork permissions, see "[About permissions and visibility of forks](https://docs.github.com/pull-requests/collaborating-with-pull-requests/working-with-forks/about-permissions-and-visibility-of-forks)".
 */
  @aiFunction({
    name: 'github_repos_remove_collaborator',
    description: `Removes a collaborator from a repository.

To use this endpoint, the authenticated user must either be an administrator of the repository or target themselves for removal.

This endpoint also:
- Cancels any outstanding invitations
- Unasigns the user from any issues
- Removes access to organization projects if the user is not an organization member and is not a collaborator on any other organization repositories.
- Unstars the repository
- Updates access permissions to packages

Removing a user as a collaborator has the following effects on forks:
 - If the user had access to a fork through their membership to this repository, the user will also be removed from the fork.
 - If the user had their own fork of the repository, the fork will be deleted.
 - If the user still has read access to the repository, open pull requests by this user from a fork will be denied.

> [!NOTE]
> A user can still have access to the repository through organization permissions like base repository permissions.

Although the API responds immediately, the additional permission updates might take some extra time to complete in the background.

For more information on fork permissions, see "[About permissions and visibility of forks](https://docs.github.com/pull-requests/collaborating-with-pull-requests/working-with-forks/about-permissions-and-visibility-of-forks)".`,
    inputSchema: github.ReposRemoveCollaboratorParamsSchema,
    tags: ['repos']
  })
  async reposRemoveCollaborator(
    params: github.ReposRemoveCollaboratorParams
  ): Promise<github.ReposRemoveCollaboratorResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/collaborators/${params.username}`,
        {}
      )
      .json<github.ReposRemoveCollaboratorResponse>()
  }

  /**
 * Checks the repository permission of a collaborator. The possible repository
permissions are `admin`, `write`, `read`, and `none`.

*Note*: The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the
`maintain` role is mapped to `write` and the `triage` role is mapped to `read`. To determine the role assigned to the
collaborator, see the `role_name` attribute, which will provide the full role name, including custom roles. The
`permissions` hash can also be used to determine which base level of access the collaborator has to the repository.
 */
  @aiFunction({
    name: 'github_repos_get_collaborator_permission_level',
    description: `Checks the repository permission of a collaborator. The possible repository
permissions are \`admin\`, \`write\`, \`read\`, and \`none\`.

*Note*: The \`permission\` attribute provides the legacy base roles of \`admin\`, \`write\`, \`read\`, and \`none\`, where the
\`maintain\` role is mapped to \`write\` and the \`triage\` role is mapped to \`read\`. To determine the role assigned to the
collaborator, see the \`role_name\` attribute, which will provide the full role name, including custom roles. The
\`permissions\` hash can also be used to determine which base level of access the collaborator has to the repository.`,
    inputSchema: github.ReposGetCollaboratorPermissionLevelParamsSchema,
    tags: ['repos']
  })
  async reposGetCollaboratorPermissionLevel(
    params: github.ReposGetCollaboratorPermissionLevelParams
  ): Promise<github.ReposGetCollaboratorPermissionLevelResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/collaborators/${params.username}/permission`,
        {}
      )
      .json<github.ReposGetCollaboratorPermissionLevelResponse>()
  }

  /**
 * Lists the commit comments for a specified repository. Comments are ordered by ascending ID.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_repos_list_commit_comments_for_repo',
    description: `Lists the commit comments for a specified repository. Comments are ordered by ascending ID.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.ReposListCommitCommentsForRepoParamsSchema,
    tags: ['repos']
  })
  async reposListCommitCommentsForRepo(
    params: github.ReposListCommitCommentsForRepoParams
  ): Promise<github.ReposListCommitCommentsForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/comments`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ReposListCommitCommentsForRepoResponse>()
  }

  /**
 * Gets a specified commit comment.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_repos_get_commit_comment',
    description: `Gets a specified commit comment.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.ReposGetCommitCommentParamsSchema,
    tags: ['repos']
  })
  async reposGetCommitComment(
    params: github.ReposGetCommitCommentParams
  ): Promise<github.ReposGetCommitCommentResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/comments/${params.comment_id}`,
        {}
      )
      .json<github.ReposGetCommitCommentResponse>()
  }

  /**
   * Delete a commit comment.
   */
  @aiFunction({
    name: 'github_repos_delete_commit_comment',
    description: `Delete a commit comment.`,
    inputSchema: github.ReposDeleteCommitCommentParamsSchema,
    tags: ['repos']
  })
  async reposDeleteCommitComment(
    params: github.ReposDeleteCommitCommentParams
  ): Promise<github.ReposDeleteCommitCommentResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/comments/${params.comment_id}`,
        {}
      )
      .json<github.ReposDeleteCommitCommentResponse>()
  }

  /**
 * Updates the contents of a specified commit comment.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_repos_update_commit_comment',
    description: `Updates the contents of a specified commit comment.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.ReposUpdateCommitCommentParamsSchema,
    tags: ['repos']
  })
  async reposUpdateCommitComment(
    params: github.ReposUpdateCommitCommentParams
  ): Promise<github.ReposUpdateCommitCommentResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/comments/${params.comment_id}`,
        {
          json: pick(params, 'body')
        }
      )
      .json<github.ReposUpdateCommitCommentResponse>()
  }

  /**
   * List the reactions to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment).
   */
  @aiFunction({
    name: 'github_reactions_list_for_commit_comment',
    description: `List the reactions to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment).`,
    inputSchema: github.ReactionsListForCommitCommentParamsSchema,
    tags: ['reactions']
  })
  async reactionsListForCommitComment(
    params: github.ReactionsListForCommitCommentParams
  ): Promise<github.ReactionsListForCommitCommentResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/comments/${params.comment_id}/reactions`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'content', 'per_page', 'page')
          )
        }
      )
      .json<github.ReactionsListForCommitCommentResponse>()
  }

  /**
   * Create a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). A response with an HTTP `200` status means that you already added the reaction type to this commit comment.
   */
  @aiFunction({
    name: 'github_reactions_create_for_commit_comment',
    description: `Create a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). A response with an HTTP \`200\` status means that you already added the reaction type to this commit comment.`,
    inputSchema: github.ReactionsCreateForCommitCommentParamsSchema,
    tags: ['reactions']
  })
  async reactionsCreateForCommitComment(
    params: github.ReactionsCreateForCommitCommentParams
  ): Promise<github.ReactionsCreateForCommitCommentResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/comments/${params.comment_id}/reactions`,
        {
          json: pick(params, 'content')
        }
      )
      .json<github.ReactionsCreateForCommitCommentResponse>()
  }

  /**
 * > [!NOTE]
> You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`.

Delete a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment).
 */
  @aiFunction({
    name: 'github_reactions_delete_for_commit_comment',
    description: `> [!NOTE]
> You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id\`.

Delete a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment).`,
    inputSchema: github.ReactionsDeleteForCommitCommentParamsSchema,
    tags: ['reactions']
  })
  async reactionsDeleteForCommitComment(
    params: github.ReactionsDeleteForCommitCommentParams
  ): Promise<github.ReactionsDeleteForCommitCommentResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/comments/${params.comment_id}/reactions/${params.reaction_id}`,
        {}
      )
      .json<github.ReactionsDeleteForCommitCommentResponse>()
  }

  /**
 * **Signature verification object**

The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:

| Name | Type | Description |
| ---- | ---- | ----------- |
| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |
| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |
| `signature` | `string` | The signature that was extracted from the commit. |
| `payload` | `string` | The value that was signed. |
| `verified_at` | `string` | The date the signature was verified by GitHub. |

These are the possible values for `reason` in the `verification` object:

| Value | Description |
| ----- | ----------- |
| `expired_key` | The key that made the signature is expired. |
| `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
| `gpgverify_error` | There was an error communicating with the signature verification service. |
| `gpgverify_unavailable` | The signature verification service is currently unavailable. |
| `unsigned` | The object does not include a signature. |
| `unknown_signature_type` | A non-PGP signature was found in the commit. |
| `no_user` | No user was associated with the `committer` email address in the commit. |
| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. |
| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |
| `unknown_key` | The key that made the signature has not been registered with any user's account. |
| `malformed_signature` | There was an error parsing the signature. |
| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
| `valid` | None of the above errors applied, so the signature is considered to be verified. |.
 */
  @aiFunction({
    name: 'github_repos_list_commits',
    description: `**Signature verification object**

The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object:

| Name | Type | Description |
| ---- | ---- | ----------- |
| \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. |
| \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. |
| \`signature\` | \`string\` | The signature that was extracted from the commit. |
| \`payload\` | \`string\` | The value that was signed. |
| \`verified_at\` | \`string\` | The date the signature was verified by GitHub. |

These are the possible values for \`reason\` in the \`verification\` object:

| Value | Description |
| ----- | ----------- |
| \`expired_key\` | The key that made the signature is expired. |
| \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
| \`gpgverify_error\` | There was an error communicating with the signature verification service. |
| \`gpgverify_unavailable\` | The signature verification service is currently unavailable. |
| \`unsigned\` | The object does not include a signature. |
| \`unknown_signature_type\` | A non-PGP signature was found in the commit. |
| \`no_user\` | No user was associated with the \`committer\` email address in the commit. |
| \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on their account. |
| \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. |
| \`unknown_key\` | The key that made the signature has not been registered with any user's account. |
| \`malformed_signature\` | There was an error parsing the signature. |
| \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
| \`valid\` | None of the above errors applied, so the signature is considered to be verified. |.`,
    inputSchema: github.ReposListCommitsParamsSchema,
    tags: ['repos']
  })
  async reposListCommits(
    params: github.ReposListCommitsParams
  ): Promise<github.ReposListCommitsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/commits`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'sha',
            'path',
            'author',
            'committer',
            'since',
            'until',
            'per_page',
            'page'
          )
        )
      })
      .json<github.ReposListCommitsResponse>()
  }

  /**
 * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch.
 */
  @aiFunction({
    name: 'github_repos_list_branches_for_head_commit',
    description: `Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch.`,
    inputSchema: github.ReposListBranchesForHeadCommitParamsSchema,
    tags: ['repos']
  })
  async reposListBranchesForHeadCommit(
    params: github.ReposListBranchesForHeadCommitParams
  ): Promise<github.ReposListBranchesForHeadCommitResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/commits/${params.commit_sha}/branches-where-head`,
        {}
      )
      .json<github.ReposListBranchesForHeadCommitResponse>()
  }

  /**
 * Lists the comments for a specified commit.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_repos_list_comments_for_commit',
    description: `Lists the comments for a specified commit.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.ReposListCommentsForCommitParamsSchema,
    tags: ['repos']
  })
  async reposListCommentsForCommit(
    params: github.ReposListCommentsForCommitParams
  ): Promise<github.ReposListCommentsForCommitResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/commits/${params.commit_sha}/comments`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ReposListCommentsForCommitResponse>()
  }

  /**
 * Create a comment for a commit using its `:commit_sha`.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_repos_create_commit_comment',
    description: `Create a comment for a commit using its \`:commit_sha\`.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.ReposCreateCommitCommentParamsSchema,
    tags: ['repos']
  })
  async reposCreateCommitComment(
    params: github.ReposCreateCommitCommentParams
  ): Promise<github.ReposCreateCommitCommentResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/commits/${params.commit_sha}/comments`,
        {
          json: pick(params, 'body', 'path', 'position', 'line')
        }
      )
      .json<github.ReposCreateCommitCommentResponse>()
  }

  /**
 * Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, will only return open pull requests associated with the commit.

To list the open or merged pull requests associated with a branch, you can set the `commit_sha` parameter to the branch name.
 */
  @aiFunction({
    name: 'github_repos_list_pull_requests_associated_with_commit',
    description: `Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, will only return open pull requests associated with the commit.

To list the open or merged pull requests associated with a branch, you can set the \`commit_sha\` parameter to the branch name.`,
    inputSchema: github.ReposListPullRequestsAssociatedWithCommitParamsSchema,
    tags: ['repos']
  })
  async reposListPullRequestsAssociatedWithCommit(
    params: github.ReposListPullRequestsAssociatedWithCommitParams
  ): Promise<github.ReposListPullRequestsAssociatedWithCommitResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/commits/${params.commit_sha}/pulls`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ReposListPullRequestsAssociatedWithCommitResponse>()
  }

  /**
 * Returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.

> [!NOTE]
> If there are more than 300 files in the commit diff and the default JSON media type is requested, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." Pagination query parameters are not supported for these media types.

- **`application/vnd.github.diff`**: Returns the diff of the commit. Larger diffs may time out and return a 5xx status code.
- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property. Larger diffs may time out and return a 5xx status code.
- **`application/vnd.github.sha`**: Returns the commit's SHA-1 hash. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.

**Signature verification object**

The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:

| Name | Type | Description |
| ---- | ---- | ----------- |
| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |
| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |
| `signature` | `string` | The signature that was extracted from the commit. |
| `payload` | `string` | The value that was signed. |
| `verified_at` | `string` | The date the signature was verified by GitHub. |

These are the possible values for `reason` in the `verification` object:

| Value | Description |
| ----- | ----------- |
| `expired_key` | The key that made the signature is expired. |
| `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
| `gpgverify_error` | There was an error communicating with the signature verification service. |
| `gpgverify_unavailable` | The signature verification service is currently unavailable. |
| `unsigned` | The object does not include a signature. |
| `unknown_signature_type` | A non-PGP signature was found in the commit. |
| `no_user` | No user was associated with the `committer` email address in the commit. |
| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. |
| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |
| `unknown_key` | The key that made the signature has not been registered with any user's account. |
| `malformed_signature` | There was an error parsing the signature. |
| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
| `valid` | None of the above errors applied, so the signature is considered to be verified. |.
 */
  @aiFunction({
    name: 'github_repos_get_commit',
    description: `Returns the contents of a single commit reference. You must have \`read\` access for the repository to use this endpoint.

> [!NOTE]
> If there are more than 300 files in the commit diff and the default JSON media type is requested, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." Pagination query parameters are not supported for these media types.

- **\`application/vnd.github.diff\`**: Returns the diff of the commit. Larger diffs may time out and return a 5xx status code.
- **\`application/vnd.github.patch\`**: Returns the patch of the commit. Diffs with binary data will have no \`patch\` property. Larger diffs may time out and return a 5xx status code.
- **\`application/vnd.github.sha\`**: Returns the commit's SHA-1 hash. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.

**Signature verification object**

The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object:

| Name | Type | Description |
| ---- | ---- | ----------- |
| \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. |
| \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. |
| \`signature\` | \`string\` | The signature that was extracted from the commit. |
| \`payload\` | \`string\` | The value that was signed. |
| \`verified_at\` | \`string\` | The date the signature was verified by GitHub. |

These are the possible values for \`reason\` in the \`verification\` object:

| Value | Description |
| ----- | ----------- |
| \`expired_key\` | The key that made the signature is expired. |
| \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
| \`gpgverify_error\` | There was an error communicating with the signature verification service. |
| \`gpgverify_unavailable\` | The signature verification service is currently unavailable. |
| \`unsigned\` | The object does not include a signature. |
| \`unknown_signature_type\` | A non-PGP signature was found in the commit. |
| \`no_user\` | No user was associated with the \`committer\` email address in the commit. |
| \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on their account. |
| \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. |
| \`unknown_key\` | The key that made the signature has not been registered with any user's account. |
| \`malformed_signature\` | There was an error parsing the signature. |
| \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
| \`valid\` | None of the above errors applied, so the signature is considered to be verified. |.`,
    inputSchema: github.ReposGetCommitParamsSchema,
    tags: ['repos']
  })
  async reposGetCommit(
    params: github.ReposGetCommitParams
  ): Promise<github.ReposGetCommitResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/commits/${params.ref}`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'page', 'per_page'))
        }
      )
      .json<github.ReposGetCommitResponse>()
  }

  /**
 * Lists check runs for a commit ref. The `ref` can be a SHA, branch name, or a tag name.

> [!NOTE]
> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.

If there are more than 1000 check suites on a single git reference, this endpoint will limit check runs to the 1000 most recent check suites. To iterate over all possible check runs, use the [List check suites for a Git reference](https://docs.github.com/rest/reference/checks#list-check-suites-for-a-git-reference) endpoint and provide the `check_suite_id` parameter to the [List check runs in a check suite](https://docs.github.com/rest/reference/checks#list-check-runs-in-a-check-suite) endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository.
 */
  @aiFunction({
    name: 'github_checks_list_for_ref',
    description: `Lists check runs for a commit ref. The \`ref\` can be a SHA, branch name, or a tag name.

> [!NOTE]
> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array.

If there are more than 1000 check suites on a single git reference, this endpoint will limit check runs to the 1000 most recent check suites. To iterate over all possible check runs, use the [List check suites for a Git reference](https://docs.github.com/rest/reference/checks#list-check-suites-for-a-git-reference) endpoint and provide the \`check_suite_id\` parameter to the [List check runs in a check suite](https://docs.github.com/rest/reference/checks#list-check-runs-in-a-check-suite) endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint on a private repository.`,
    inputSchema: github.ChecksListForRefParamsSchema,
    tags: ['checks']
  })
  async checksListForRef(
    params: github.ChecksListForRefParams
  ): Promise<github.ChecksListForRefResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/commits/${params.ref}/check-runs`,
        {
          searchParams: sanitizeSearchParams(
            pick(
              params,
              'check_name',
              'status',
              'filter',
              'per_page',
              'page',
              'app_id'
            )
          )
        }
      )
      .json<github.ChecksListForRefResponse>()
  }

  /**
 * Lists check suites for a commit `ref`. The `ref` can be a SHA, branch name, or a tag name.

> [!NOTE]
> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository.
 */
  @aiFunction({
    name: 'github_checks_list_suites_for_ref',
    description: `Lists check suites for a commit \`ref\`. The \`ref\` can be a SHA, branch name, or a tag name.

> [!NOTE]
> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty \`pull_requests\` array and a \`null\` value for \`head_branch\`.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint on a private repository.`,
    inputSchema: github.ChecksListSuitesForRefParamsSchema,
    tags: ['checks']
  })
  async checksListSuitesForRef(
    params: github.ChecksListSuitesForRefParams
  ): Promise<github.ChecksListSuitesForRefResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/commits/${params.ref}/check-suites`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'app_id', 'check_name', 'per_page', 'page')
          )
        }
      )
      .json<github.ChecksListSuitesForRefResponse>()
  }

  /**
 * Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name.


Additionally, a combined `state` is returned. The `state` is one of:

*   **failure** if any of the contexts report as `error` or `failure`
*   **pending** if there are no statuses or a context is `pending`
*   **success** if the latest status for all contexts is `success`.
 */
  @aiFunction({
    name: 'github_repos_get_combined_status_for_ref',
    description: `Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name.


Additionally, a combined \`state\` is returned. The \`state\` is one of:

*   **failure** if any of the contexts report as \`error\` or \`failure\`
*   **pending** if there are no statuses or a context is \`pending\`
*   **success** if the latest status for all contexts is \`success\`.`,
    inputSchema: github.ReposGetCombinedStatusForRefParamsSchema,
    tags: ['repos']
  })
  async reposGetCombinedStatusForRef(
    params: github.ReposGetCombinedStatusForRefParams
  ): Promise<github.ReposGetCombinedStatusForRefResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/commits/${params.ref}/status`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ReposGetCombinedStatusForRefResponse>()
  }

  /**
 * Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.

This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`.
 */
  @aiFunction({
    name: 'github_repos_list_commit_statuses_for_ref',
    description: `Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.

This resource is also available via a legacy route: \`GET /repos/:owner/:repo/statuses/:ref\`.`,
    inputSchema: github.ReposListCommitStatusesForRefParamsSchema,
    tags: ['repos']
  })
  async reposListCommitStatusesForRef(
    params: github.ReposListCommitStatusesForRefParams
  ): Promise<github.ReposListCommitStatusesForRefResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/commits/${params.ref}/statuses`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ReposListCommitStatusesForRefResponse>()
  }

  /**
 * Returns all community profile metrics for a repository. The repository cannot be a fork.

The returned metrics include an overall health score, the repository description, the presence of documentation, the
detected code of conduct, the detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE,
README, and CONTRIBUTING files.

The `health_percentage` score is defined as a percentage of how many of
the recommended community health files are present. For more information, see
"[About community profiles for public repositories](https://docs.github.com/communities/setting-up-your-project-for-healthy-contributions/about-community-profiles-for-public-repositories)."

`content_reports_enabled` is only returned for organization-owned repositories.
 */
  @aiFunction({
    name: 'github_repos_get_community_profile_metrics',
    description: `Returns all community profile metrics for a repository. The repository cannot be a fork.

The returned metrics include an overall health score, the repository description, the presence of documentation, the
detected code of conduct, the detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE,
README, and CONTRIBUTING files.

The \`health_percentage\` score is defined as a percentage of how many of
the recommended community health files are present. For more information, see
"[About community profiles for public repositories](https://docs.github.com/communities/setting-up-your-project-for-healthy-contributions/about-community-profiles-for-public-repositories)."

\`content_reports_enabled\` is only returned for organization-owned repositories.`,
    inputSchema: github.ReposGetCommunityProfileMetricsParamsSchema,
    tags: ['repos']
  })
  async reposGetCommunityProfileMetrics(
    params: github.ReposGetCommunityProfileMetricsParams
  ): Promise<github.ReposGetCommunityProfileMetricsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/community/profile`, {})
      .json<github.ReposGetCommunityProfileMetricsResponse>()
  }

  /**
 * Compares two commits against one another. You can compare refs (branches or tags) and commit SHAs in the same repository, or you can compare refs and commit SHAs that exist in different repositories within the same repository network, including fork branches. For more information about how to view a repository's network, see "[Understanding connections between repositories](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository/understanding-connections-between-repositories)."

This endpoint is equivalent to running the `git log BASE..HEAD` command, but it returns commits in a different order. The `git log BASE..HEAD` command returns commits in reverse chronological order, whereas the API returns commits in chronological order.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.diff`**: Returns the diff of the commit.
- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property.

The API response includes details about the files that were changed between the two commits. This includes the status of the change (if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file.

When calling this endpoint without any paging parameter (`per_page` or `page`), the returned list is limited to 250 commits, and the last commit in the list is the most recent of the entire comparison.

**Working with large comparisons**

To process a response with a large number of commits, use a query parameter (`per_page` or `page`) to paginate the results. When using pagination:

- The list of changed files is only shown on the first page of results, and it includes up to 300 changed files for the entire comparison.
- The results are returned in chronological order, but the last commit in the returned list may not be the most recent one in the entire set if there are more pages of results.

For more information on working with pagination, see "[Using pagination in the REST API](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api)."

**Signature verification object**

The response will include a `verification` object that describes the result of verifying the commit's signature. The `verification` object includes the following fields:

| Name | Type | Description |
| ---- | ---- | ----------- |
| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |
| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |
| `signature` | `string` | The signature that was extracted from the commit. |
| `payload` | `string` | The value that was signed. |
| `verified_at` | `string` | The date the signature was verified by GitHub. |

These are the possible values for `reason` in the `verification` object:

| Value | Description |
| ----- | ----------- |
| `expired_key` | The key that made the signature is expired. |
| `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
| `gpgverify_error` | There was an error communicating with the signature verification service. |
| `gpgverify_unavailable` | The signature verification service is currently unavailable. |
| `unsigned` | The object does not include a signature. |
| `unknown_signature_type` | A non-PGP signature was found in the commit. |
| `no_user` | No user was associated with the `committer` email address in the commit. |
| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. |
| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |
| `unknown_key` | The key that made the signature has not been registered with any user's account. |
| `malformed_signature` | There was an error parsing the signature. |
| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
| `valid` | None of the above errors applied, so the signature is considered to be verified. |.
 */
  @aiFunction({
    name: 'github_repos_compare_commits',
    description: `Compares two commits against one another. You can compare refs (branches or tags) and commit SHAs in the same repository, or you can compare refs and commit SHAs that exist in different repositories within the same repository network, including fork branches. For more information about how to view a repository's network, see "[Understanding connections between repositories](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository/understanding-connections-between-repositories)."

This endpoint is equivalent to running the \`git log BASE..HEAD\` command, but it returns commits in a different order. The \`git log BASE..HEAD\` command returns commits in reverse chronological order, whereas the API returns commits in chronological order.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.diff\`**: Returns the diff of the commit.
- **\`application/vnd.github.patch\`**: Returns the patch of the commit. Diffs with binary data will have no \`patch\` property.

The API response includes details about the files that were changed between the two commits. This includes the status of the change (if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a \`renamed\` status have a \`previous_filename\` field showing the previous filename of the file, and files with a \`modified\` status have a \`patch\` field showing the changes made to the file.

When calling this endpoint without any paging parameter (\`per_page\` or \`page\`), the returned list is limited to 250 commits, and the last commit in the list is the most recent of the entire comparison.

**Working with large comparisons**

To process a response with a large number of commits, use a query parameter (\`per_page\` or \`page\`) to paginate the results. When using pagination:

- The list of changed files is only shown on the first page of results, and it includes up to 300 changed files for the entire comparison.
- The results are returned in chronological order, but the last commit in the returned list may not be the most recent one in the entire set if there are more pages of results.

For more information on working with pagination, see "[Using pagination in the REST API](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api)."

**Signature verification object**

The response will include a \`verification\` object that describes the result of verifying the commit's signature. The \`verification\` object includes the following fields:

| Name | Type | Description |
| ---- | ---- | ----------- |
| \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. |
| \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. |
| \`signature\` | \`string\` | The signature that was extracted from the commit. |
| \`payload\` | \`string\` | The value that was signed. |
| \`verified_at\` | \`string\` | The date the signature was verified by GitHub. |

These are the possible values for \`reason\` in the \`verification\` object:

| Value | Description |
| ----- | ----------- |
| \`expired_key\` | The key that made the signature is expired. |
| \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
| \`gpgverify_error\` | There was an error communicating with the signature verification service. |
| \`gpgverify_unavailable\` | The signature verification service is currently unavailable. |
| \`unsigned\` | The object does not include a signature. |
| \`unknown_signature_type\` | A non-PGP signature was found in the commit. |
| \`no_user\` | No user was associated with the \`committer\` email address in the commit. |
| \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on their account. |
| \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. |
| \`unknown_key\` | The key that made the signature has not been registered with any user's account. |
| \`malformed_signature\` | There was an error parsing the signature. |
| \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
| \`valid\` | None of the above errors applied, so the signature is considered to be verified. |.`,
    inputSchema: github.ReposCompareCommitsParamsSchema,
    tags: ['repos']
  })
  async reposCompareCommits(
    params: github.ReposCompareCommitsParams
  ): Promise<github.ReposCompareCommitsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/compare/${params.basehead}`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'page', 'per_page'))
        }
      )
      .json<github.ReposCompareCommitsResponse>()
  }

  /**
 * Gets the contents of a file or directory in a repository. Specify the file path or directory with the `path` parameter. If you omit the `path` parameter, you will receive the contents of the repository's root directory.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw file contents for files and symlinks.
- **`application/vnd.github.html+json`**: Returns the file contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).
- **`application/vnd.github.object+json`**: Returns the contents in a consistent object format regardless of the content type. For example, instead of an array of objects for a directory, the response will be an object with an `entries` attribute containing the array of objects.

If the content is a directory, the response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value _should_ be "submodule". This behavior exists [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as "submodule".

If the content is a symlink and the symlink's target is a normal file in the repository, then the API responds with the content of the file. Otherwise, the API responds with an object describing the symlink itself.

If the content is a submodule, the `submodule_git_url` field identifies the location of the submodule repository, and the `sha` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links["git"]`) and the github.com URLs (`html_url` and `_links["html"]`) will have null values.

**Notes**:

- To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/git/trees#get-a-tree).
- This API has an upper limit of 1,000 files for a directory. If you need to retrieve
more files, use the [Git Trees API](https://docs.github.com/rest/git/trees#get-a-tree).
- Download URLs expire and are meant to be used just once. To ensure the download URL does not expire, please use the contents API to obtain a fresh download URL for each download.
- If the requested file's size is:
  - 1 MB or smaller: All features of this endpoint are supported.
  - Between 1-100 MB: Only the `raw` or `object` custom media types are supported. Both will work as normal, except that when using the `object` media type, the `content` field will be an empty
string and the `encoding` field will be `"none"`. To get the contents of these larger files, use the `raw` media type.
  - Greater than 100 MB: This endpoint is not supported.
 */
  @aiFunction({
    name: 'github_repos_get_content',
    description: `Gets the contents of a file or directory in a repository. Specify the file path or directory with the \`path\` parameter. If you omit the \`path\` parameter, you will receive the contents of the repository's root directory.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw file contents for files and symlinks.
- **\`application/vnd.github.html+json\`**: Returns the file contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).
- **\`application/vnd.github.object+json\`**: Returns the contents in a consistent object format regardless of the content type. For example, instead of an array of objects for a directory, the response will be an object with an \`entries\` attribute containing the array of objects.

If the content is a directory, the response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value _should_ be "submodule". This behavior exists [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as "submodule".

If the content is a symlink and the symlink's target is a normal file in the repository, then the API responds with the content of the file. Otherwise, the API responds with an object describing the symlink itself.

If the content is a submodule, the \`submodule_git_url\` field identifies the location of the submodule repository, and the \`sha\` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (\`git_url\` and \`_links["git"]\`) and the github.com URLs (\`html_url\` and \`_links["html"]\`) will have null values.

**Notes**:

- To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/git/trees#get-a-tree).
- This API has an upper limit of 1,000 files for a directory. If you need to retrieve
more files, use the [Git Trees API](https://docs.github.com/rest/git/trees#get-a-tree).
- Download URLs expire and are meant to be used just once. To ensure the download URL does not expire, please use the contents API to obtain a fresh download URL for each download.
- If the requested file's size is:
  - 1 MB or smaller: All features of this endpoint are supported.
  - Between 1-100 MB: Only the \`raw\` or \`object\` custom media types are supported. Both will work as normal, except that when using the \`object\` media type, the \`content\` field will be an empty
string and the \`encoding\` field will be \`"none"\`. To get the contents of these larger files, use the \`raw\` media type.
  - Greater than 100 MB: This endpoint is not supported.`,
    inputSchema: github.ReposGetContentParamsSchema,
    tags: ['repos']
  })
  async reposGetContent(
    params: github.ReposGetContentParams
  ): Promise<github.ReposGetContentResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/contents/${params.path}`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'ref'))
        }
      )
      .json<github.ReposGetContentResponse>()
  }

  /**
 * Creates a new file or replaces an existing file in a repository.

> [!NOTE]
> If you use this endpoint and the "[Delete a file](https://docs.github.com/rest/repos/contents/#delete-a-file)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The `workflow` scope is also required in order to modify files in the `.github/workflows` directory.
 */
  @aiFunction({
    name: 'github_repos_create_or_update_file_contents',
    description: `Creates a new file or replaces an existing file in a repository.

> [!NOTE]
> If you use this endpoint and the "[Delete a file](https://docs.github.com/rest/repos/contents/#delete-a-file)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint. The \`workflow\` scope is also required in order to modify files in the \`.github/workflows\` directory.`,
    inputSchema: github.ReposCreateOrUpdateFileContentsParamsSchema,
    tags: ['repos']
  })
  async reposCreateOrUpdateFileContents(
    params: github.ReposCreateOrUpdateFileContentsParams
  ): Promise<github.ReposCreateOrUpdateFileContentsResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/contents/${params.path}`,
        {
          json: pick(
            params,
            'message',
            'content',
            'sha',
            'branch',
            'committer',
            'author'
          )
        }
      )
      .json<github.ReposCreateOrUpdateFileContentsResponse>()
  }

  /**
 * Deletes a file in a repository.

You can provide an additional `committer` parameter, which is an object containing information about the committer. Or, you can provide an `author` parameter, which is an object containing information about the author.

The `author` section is optional and is filled in with the `committer` information if omitted. If the `committer` information is omitted, the authenticated user's information is used.

You must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you'll receive a `422` status code.

> [!NOTE]
> If you use this endpoint and the "[Create or update file contents](https://docs.github.com/rest/repos/contents/#create-or-update-file-contents)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead.
 */
  @aiFunction({
    name: 'github_repos_delete_file',
    description: `Deletes a file in a repository.

You can provide an additional \`committer\` parameter, which is an object containing information about the committer. Or, you can provide an \`author\` parameter, which is an object containing information about the author.

The \`author\` section is optional and is filled in with the \`committer\` information if omitted. If the \`committer\` information is omitted, the authenticated user's information is used.

You must provide values for both \`name\` and \`email\`, whether you choose to use \`author\` or \`committer\`. Otherwise, you'll receive a \`422\` status code.

> [!NOTE]
> If you use this endpoint and the "[Create or update file contents](https://docs.github.com/rest/repos/contents/#create-or-update-file-contents)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead.`,
    inputSchema: github.ReposDeleteFileParamsSchema,
    tags: ['repos']
  })
  async reposDeleteFile(
    params: github.ReposDeleteFileParams
  ): Promise<github.ReposDeleteFileResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/contents/${params.path}`,
        {
          json: pick(params, 'message', 'sha', 'branch', 'committer', 'author')
        }
      )
      .json<github.ReposDeleteFileResponse>()
  }

  /**
 * Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API caches contributor data to improve performance.

GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information.
 */
  @aiFunction({
    name: 'github_repos_list_contributors',
    description: `Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API caches contributor data to improve performance.

GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information.`,
    inputSchema: github.ReposListContributorsParamsSchema,
    tags: ['repos']
  })
  async reposListContributors(
    params: github.ReposListContributorsParams
  ): Promise<github.ReposListContributorsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/contributors`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'anon', 'per_page', 'page')
        )
      })
      .json<github.ReposListContributorsResponse>()
  }

  /**
   * OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
   */
  @aiFunction({
    name: 'github_dependabot_list_alerts_for_repo',
    description: `OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the \`public_repo\` scope instead.`,
    inputSchema: github.DependabotListAlertsForRepoParamsSchema,
    tags: ['dependabot']
  })
  async dependabotListAlertsForRepo(
    params: github.DependabotListAlertsForRepoParams
  ): Promise<github.DependabotListAlertsForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/dependabot/alerts`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'state',
            'severity',
            'ecosystem',
            'package',
            'manifest',
            'epss_percentage',
            'scope',
            'sort',
            'direction',
            'page',
            'per_page',
            'before',
            'after',
            'first',
            'last'
          )
        )
      })
      .json<github.DependabotListAlertsForRepoResponse>()
  }

  /**
   * OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
   */
  @aiFunction({
    name: 'github_dependabot_get_alert',
    description: `OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the \`public_repo\` scope instead.`,
    inputSchema: github.DependabotGetAlertParamsSchema,
    tags: ['dependabot']
  })
  async dependabotGetAlert(
    params: github.DependabotGetAlertParams
  ): Promise<github.DependabotGetAlertResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/dependabot/alerts/${params.alert_number}`,
        {}
      )
      .json<github.DependabotGetAlertResponse>()
  }

  /**
 * The authenticated user must have access to security alerts for the repository to use this endpoint. For more information, see "[Granting access to security alerts](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)."

OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
 */
  @aiFunction({
    name: 'github_dependabot_update_alert',
    description: `The authenticated user must have access to security alerts for the repository to use this endpoint. For more information, see "[Granting access to security alerts](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)."

OAuth app tokens and personal access tokens (classic) need the \`security_events\` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the \`public_repo\` scope instead.`,
    inputSchema: github.DependabotUpdateAlertParamsSchema,
    tags: ['dependabot']
  })
  async dependabotUpdateAlert(
    params: github.DependabotUpdateAlertParams
  ): Promise<github.DependabotUpdateAlertResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/dependabot/alerts/${params.alert_number}`,
        {
          json: pick(params, 'state', 'dismissed_reason', 'dismissed_comment')
        }
      )
      .json<github.DependabotUpdateAlertResponse>()
  }

  /**
 * Lists all secrets available in a repository without revealing their encrypted
values.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_dependabot_list_repo_secrets',
    description: `Lists all secrets available in a repository without revealing their encrypted
values.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.DependabotListRepoSecretsParamsSchema,
    tags: ['dependabot']
  })
  async dependabotListRepoSecrets(
    params: github.DependabotListRepoSecretsParams
  ): Promise<github.DependabotListRepoSecretsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/dependabot/secrets`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.DependabotListRepoSecretsResponse>()
  }

  /**
 * 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.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the repository is private.
 */
  @aiFunction({
    name: 'github_dependabot_get_repo_public_key',
    description: `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.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint if the repository is private.`,
    inputSchema: github.DependabotGetRepoPublicKeyParamsSchema,
    tags: ['dependabot']
  })
  async dependabotGetRepoPublicKey(
    params: github.DependabotGetRepoPublicKeyParams
  ): Promise<github.DependabotGetRepoPublicKeyResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/dependabot/secrets/public-key`,
        {}
      )
      .json<github.DependabotGetRepoPublicKeyResponse>()
  }

  /**
 * Gets a single repository secret without revealing its encrypted value.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_dependabot_get_repo_secret',
    description: `Gets a single repository secret without revealing its encrypted value.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.DependabotGetRepoSecretParamsSchema,
    tags: ['dependabot']
  })
  async dependabotGetRepoSecret(
    params: github.DependabotGetRepoSecretParams
  ): Promise<github.DependabotGetRepoSecretResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/dependabot/secrets/${params.secret_name}`,
        {}
      )
      .json<github.DependabotGetRepoSecretResponse>()
  }

  /**
 * Creates or updates a repository secret with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_dependabot_create_or_update_repo_secret',
    description: `Creates or updates a repository secret with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.DependabotCreateOrUpdateRepoSecretParamsSchema,
    tags: ['dependabot']
  })
  async dependabotCreateOrUpdateRepoSecret(
    params: github.DependabotCreateOrUpdateRepoSecretParams
  ): Promise<github.DependabotCreateOrUpdateRepoSecretResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/dependabot/secrets/${params.secret_name}`,
        {
          json: pick(params, 'encrypted_value', 'key_id')
        }
      )
      .json<github.DependabotCreateOrUpdateRepoSecretResponse>()
  }

  /**
 * Deletes a secret in a repository using the secret name.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_dependabot_delete_repo_secret',
    description: `Deletes a secret in a repository using the secret name.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.DependabotDeleteRepoSecretParamsSchema,
    tags: ['dependabot']
  })
  async dependabotDeleteRepoSecret(
    params: github.DependabotDeleteRepoSecretParams
  ): Promise<github.DependabotDeleteRepoSecretResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/dependabot/secrets/${params.secret_name}`,
        {}
      )
      .json<github.DependabotDeleteRepoSecretResponse>()
  }

  /**
   * Gets the diff of the dependency changes between two commits of a repository, based on the changes to the dependency manifests made in those commits.
   */
  @aiFunction({
    name: 'github_dependency_graph_diff_range',
    description: `Gets the diff of the dependency changes between two commits of a repository, based on the changes to the dependency manifests made in those commits.`,
    inputSchema: github.DependencyGraphDiffRangeParamsSchema,
    tags: ['dependency-graph']
  })
  async dependencyGraphDiffRange(
    params: github.DependencyGraphDiffRangeParams
  ): Promise<github.DependencyGraphDiffRangeResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/dependency-graph/compare/${params.basehead}`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'name'))
        }
      )
      .json<github.DependencyGraphDiffRangeResponse>()
  }

  /**
   * Exports the software bill of materials (SBOM) for a repository in SPDX JSON format.
   */
  @aiFunction({
    name: 'github_dependency_graph_export_sbom',
    description: `Exports the software bill of materials (SBOM) for a repository in SPDX JSON format.`,
    inputSchema: github.DependencyGraphExportSbomParamsSchema,
    tags: ['dependency-graph']
  })
  async dependencyGraphExportSbom(
    params: github.DependencyGraphExportSbomParams
  ): Promise<github.DependencyGraphExportSbomResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/dependency-graph/sbom`,
        {}
      )
      .json<github.DependencyGraphExportSbomResponse>()
  }

  /**
 * Create a new snapshot of a repository's dependencies.

The authenticated user must have access to the repository.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_dependency_graph_create_repository_snapshot',
    description: `Create a new snapshot of a repository's dependencies.

The authenticated user must have access to the repository.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.DependencyGraphCreateRepositorySnapshotParamsSchema,
    tags: ['dependency-graph']
  })
  async dependencyGraphCreateRepositorySnapshot(
    params: github.DependencyGraphCreateRepositorySnapshotParams
  ): Promise<github.DependencyGraphCreateRepositorySnapshotResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/dependency-graph/snapshots`,
        {
          json: pick(
            params,
            'version',
            'job',
            'sha',
            'ref',
            'detector',
            'metadata',
            'manifests',
            'scanned'
          )
        }
      )
      .json<github.DependencyGraphCreateRepositorySnapshotResponse>()
  }

  /**
   * Simple filtering of deployments is available via query parameters:.
   */
  @aiFunction({
    name: 'github_repos_list_deployments',
    description: `Simple filtering of deployments is available via query parameters:.`,
    inputSchema: github.ReposListDeploymentsParamsSchema,
    tags: ['repos']
  })
  async reposListDeployments(
    params: github.ReposListDeploymentsParams
  ): Promise<github.ReposListDeploymentsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/deployments`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'sha', 'ref', 'task', 'environment', 'per_page', 'page')
        )
      })
      .json<github.ReposListDeploymentsResponse>()
  }

  /**
 * Deployments offer a few configurable parameters with certain defaults.

The `ref` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them
before we merge a pull request.

The `environment` parameter allows deployments to be issued to different runtime environments. Teams often have
multiple environments for verifying their applications, such as `production`, `staging`, and `qa`. This parameter
makes it easier to track which environments have requested deployments. The default environment is `production`.

The `auto_merge` parameter is used to ensure that the requested ref is not behind the repository's default branch. If
the ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,
the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will
return a failure response.

By default, [commit statuses](https://docs.github.com/rest/commits/statuses) for every submitted context must be in a `success`
state. The `required_contexts` parameter allows you to specify a subset of contexts that must be `success`, or to
specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do
not require any contexts or create any commit statuses, the deployment will always succeed.

The `payload` parameter is available for any extra information that a deployment system might need. It is a JSON text
field that will be passed on when a deployment event is dispatched.

The `task` parameter is used by the deployment system to allow different execution paths. In the web world this might
be `deploy:migrations` to run schema changes on the system. In the compiled world this could be a flag to compile an
application with debugging enabled.

Merged branch response:

You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating
a deployment. This auto-merge happens when:
*   Auto-merge option is enabled in the repository
*   Topic branch does not include the latest changes on the base branch, which is `master` in the response example
*   There are no merge conflicts

If there are no new commits in the base branch, a new request to create a deployment should give a successful
response.

Merge conflict response:

This error happens when the `auto_merge` option is enabled and when the default branch (in this case `master`), can't
be merged into the branch that's being deployed (in this case `topic-branch`), due to merge conflicts.

Failed commit status checks:

This error happens when the `required_contexts` parameter indicates that one or more contexts need to have a `success`
status for the commit to be deployed, but one or more of the required contexts do not have a state of `success`.

OAuth app tokens and personal access tokens (classic) need the `repo` or `repo_deployment` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_create_deployment',
    description: `Deployments offer a few configurable parameters with certain defaults.

The \`ref\` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them
before we merge a pull request.

The \`environment\` parameter allows deployments to be issued to different runtime environments. Teams often have
multiple environments for verifying their applications, such as \`production\`, \`staging\`, and \`qa\`. This parameter
makes it easier to track which environments have requested deployments. The default environment is \`production\`.

The \`auto_merge\` parameter is used to ensure that the requested ref is not behind the repository's default branch. If
the ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,
the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will
return a failure response.

By default, [commit statuses](https://docs.github.com/rest/commits/statuses) for every submitted context must be in a \`success\`
state. The \`required_contexts\` parameter allows you to specify a subset of contexts that must be \`success\`, or to
specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do
not require any contexts or create any commit statuses, the deployment will always succeed.

The \`payload\` parameter is available for any extra information that a deployment system might need. It is a JSON text
field that will be passed on when a deployment event is dispatched.

The \`task\` parameter is used by the deployment system to allow different execution paths. In the web world this might
be \`deploy:migrations\` to run schema changes on the system. In the compiled world this could be a flag to compile an
application with debugging enabled.

Merged branch response:

You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating
a deployment. This auto-merge happens when:
*   Auto-merge option is enabled in the repository
*   Topic branch does not include the latest changes on the base branch, which is \`master\` in the response example
*   There are no merge conflicts

If there are no new commits in the base branch, a new request to create a deployment should give a successful
response.

Merge conflict response:

This error happens when the \`auto_merge\` option is enabled and when the default branch (in this case \`master\`), can't
be merged into the branch that's being deployed (in this case \`topic-branch\`), due to merge conflicts.

Failed commit status checks:

This error happens when the \`required_contexts\` parameter indicates that one or more contexts need to have a \`success\`
status for the commit to be deployed, but one or more of the required contexts do not have a state of \`success\`.

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`repo_deployment\` scope to use this endpoint.`,
    inputSchema: github.ReposCreateDeploymentParamsSchema,
    tags: ['repos']
  })
  async reposCreateDeployment(
    params: github.ReposCreateDeploymentParams
  ): Promise<github.ReposCreateDeploymentResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/deployments`, {
        json: pick(
          params,
          'ref',
          'task',
          'auto_merge',
          'required_contexts',
          'payload',
          'environment',
          'description',
          'transient_environment',
          'production_environment'
        )
      })
      .json<github.ReposCreateDeploymentResponse>()
  }

  /**
   * Get a deployment.
   */
  @aiFunction({
    name: 'github_repos_get_deployment',
    description: `Get a deployment.`,
    inputSchema: github.ReposGetDeploymentParamsSchema,
    tags: ['repos']
  })
  async reposGetDeployment(
    params: github.ReposGetDeploymentParams
  ): Promise<github.ReposGetDeploymentResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/deployments/${params.deployment_id}`,
        {}
      )
      .json<github.ReposGetDeploymentResponse>()
  }

  /**
 * If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment.

To set a deployment as inactive, you must:

*   Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
*   Mark the active deployment as inactive by adding any non-successful deployment status.

For more information, see "[Create a deployment](https://docs.github.com/rest/deployments/deployments/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/deployments/statuses#create-a-deployment-status)."

OAuth app tokens and personal access tokens (classic) need the `repo` or `repo_deployment` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_delete_deployment',
    description: `If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment.

To set a deployment as inactive, you must:

*   Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.
*   Mark the active deployment as inactive by adding any non-successful deployment status.

For more information, see "[Create a deployment](https://docs.github.com/rest/deployments/deployments/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/deployments/statuses#create-a-deployment-status)."

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`repo_deployment\` scope to use this endpoint.`,
    inputSchema: github.ReposDeleteDeploymentParamsSchema,
    tags: ['repos']
  })
  async reposDeleteDeployment(
    params: github.ReposDeleteDeploymentParams
  ): Promise<github.ReposDeleteDeploymentResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/deployments/${params.deployment_id}`,
        {}
      )
      .json<github.ReposDeleteDeploymentResponse>()
  }

  /**
   * Users with pull access can view deployment statuses for a deployment:.
   */
  @aiFunction({
    name: 'github_repos_list_deployment_statuses',
    description: `Users with pull access can view deployment statuses for a deployment:.`,
    inputSchema: github.ReposListDeploymentStatusesParamsSchema,
    tags: ['repos']
  })
  async reposListDeploymentStatuses(
    params: github.ReposListDeploymentStatusesParams
  ): Promise<github.ReposListDeploymentStatusesResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/deployments/${params.deployment_id}/statuses`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ReposListDeploymentStatusesResponse>()
  }

  /**
 * Users with `push` access can create deployment statuses for a given deployment.

OAuth app tokens and personal access tokens (classic) need the `repo_deployment` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_create_deployment_status',
    description: `Users with \`push\` access can create deployment statuses for a given deployment.

OAuth app tokens and personal access tokens (classic) need the \`repo_deployment\` scope to use this endpoint.`,
    inputSchema: github.ReposCreateDeploymentStatusParamsSchema,
    tags: ['repos']
  })
  async reposCreateDeploymentStatus(
    params: github.ReposCreateDeploymentStatusParams
  ): Promise<github.ReposCreateDeploymentStatusResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/deployments/${params.deployment_id}/statuses`,
        {
          json: pick(
            params,
            'state',
            'target_url',
            'log_url',
            'description',
            'environment',
            'environment_url',
            'auto_inactive'
          )
        }
      )
      .json<github.ReposCreateDeploymentStatusResponse>()
  }

  /**
   * Users with pull access can view a deployment status for a deployment:.
   */
  @aiFunction({
    name: 'github_repos_get_deployment_status',
    description: `Users with pull access can view a deployment status for a deployment:.`,
    inputSchema: github.ReposGetDeploymentStatusParamsSchema,
    tags: ['repos']
  })
  async reposGetDeploymentStatus(
    params: github.ReposGetDeploymentStatusParams
  ): Promise<github.ReposGetDeploymentStatusResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/deployments/${params.deployment_id}/statuses/${params.status_id}`,
        {}
      )
      .json<github.ReposGetDeploymentStatusResponse>()
  }

  /**
 * You can use this endpoint to trigger a webhook event called `repository_dispatch` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the `repository_dispatch` event occurs. For an example `repository_dispatch` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch)."

The `client_payload` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the `client_payload` can include a message that a user would like to send using a GitHub Actions workflow. Or the `client_payload` can be used as a test to debug your workflow.

This input example shows how you can use the `client_payload` as a test to debug your workflow.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_create_dispatch_event',
    description: `You can use this endpoint to trigger a webhook event called \`repository_dispatch\` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the \`repository_dispatch\` event occurs. For an example \`repository_dispatch\` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch)."

The \`client_payload\` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the \`client_payload\` can include a message that a user would like to send using a GitHub Actions workflow. Or the \`client_payload\` can be used as a test to debug your workflow.

This input example shows how you can use the \`client_payload\` as a test to debug your workflow.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposCreateDispatchEventParamsSchema,
    tags: ['repos']
  })
  async reposCreateDispatchEvent(
    params: github.ReposCreateDispatchEventParams
  ): Promise<github.ReposCreateDispatchEventResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/dispatches`, {
        json: pick(params, 'event_type', 'client_payload')
      })
      .json<github.ReposCreateDispatchEventResponse>()
  }

  /**
 * Lists the environments for a repository.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_repos_get_all_environments',
    description: `Lists the environments for a repository.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ReposGetAllEnvironmentsParamsSchema,
    tags: ['repos']
  })
  async reposGetAllEnvironments(
    params: github.ReposGetAllEnvironmentsParams
  ): Promise<github.ReposGetAllEnvironmentsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/environments`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ReposGetAllEnvironmentsResponse>()
  }

  /**
 * > [!NOTE]
> To get information about name patterns that branches must match in order to deploy to this environment, see "[Get a deployment branch policy](/rest/deployments/branch-policies#get-a-deployment-branch-policy)."

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_repos_get_environment',
    description: `> [!NOTE]
> To get information about name patterns that branches must match in order to deploy to this environment, see "[Get a deployment branch policy](/rest/deployments/branch-policies#get-a-deployment-branch-policy)."

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ReposGetEnvironmentParamsSchema,
    tags: ['repos']
  })
  async reposGetEnvironment(
    params: github.ReposGetEnvironmentParams
  ): Promise<github.ReposGetEnvironmentResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}`,
        {}
      )
      .json<github.ReposGetEnvironmentResponse>()
  }

  /**
 * Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see "[Environments](/actions/reference/environments#environment-protection-rules)."

> [!NOTE]
> To create or update name patterns that branches must match in order to deploy to this environment, see "[Deployment branch policies](/rest/deployments/branch-policies)."

> [!NOTE]
> To create or update secrets for an environment, see "[GitHub Actions secrets](/rest/actions/secrets)."

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_create_or_update_environment',
    description: `Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see "[Environments](/actions/reference/environments#environment-protection-rules)."

> [!NOTE]
> To create or update name patterns that branches must match in order to deploy to this environment, see "[Deployment branch policies](/rest/deployments/branch-policies)."

> [!NOTE]
> To create or update secrets for an environment, see "[GitHub Actions secrets](/rest/actions/secrets)."

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposCreateOrUpdateEnvironmentParamsSchema,
    tags: ['repos']
  })
  async reposCreateOrUpdateEnvironment(
    params: github.ReposCreateOrUpdateEnvironmentParams
  ): Promise<github.ReposCreateOrUpdateEnvironmentResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}`,
        {
          json: pick(
            params,
            'wait_timer',
            'prevent_self_review',
            'reviewers',
            'deployment_branch_policy'
          )
        }
      )
      .json<github.ReposCreateOrUpdateEnvironmentResponse>()
  }

  /**
   * OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
   */
  @aiFunction({
    name: 'github_repos_delete_an_environment',
    description: `OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposDeleteAnEnvironmentParamsSchema,
    tags: ['repos']
  })
  async reposDeleteAnEnvironment(
    params: github.ReposDeleteAnEnvironmentParams
  ): Promise<github.ReposDeleteAnEnvironmentResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}`,
        {}
      )
      .json<github.ReposDeleteAnEnvironmentResponse>()
  }

  /**
 * Lists the deployment branch policies for an environment.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_repos_list_deployment_branch_policies',
    description: `Lists the deployment branch policies for an environment.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ReposListDeploymentBranchPoliciesParamsSchema,
    tags: ['repos']
  })
  async reposListDeploymentBranchPolicies(
    params: github.ReposListDeploymentBranchPoliciesParams
  ): Promise<github.ReposListDeploymentBranchPoliciesResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/deployment-branch-policies`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ReposListDeploymentBranchPoliciesResponse>()
  }

  /**
 * Creates a deployment branch or tag policy for an environment.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_create_deployment_branch_policy',
    description: `Creates a deployment branch or tag policy for an environment.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposCreateDeploymentBranchPolicyParamsSchema,
    tags: ['repos']
  })
  async reposCreateDeploymentBranchPolicy(
    params: github.ReposCreateDeploymentBranchPolicyParams
  ): Promise<github.ReposCreateDeploymentBranchPolicyResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/deployment-branch-policies`,
        {
          json: pick(params, 'name', 'type')
        }
      )
      .json<github.ReposCreateDeploymentBranchPolicyResponse>()
  }

  /**
 * Gets a deployment branch or tag policy for an environment.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_repos_get_deployment_branch_policy',
    description: `Gets a deployment branch or tag policy for an environment.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ReposGetDeploymentBranchPolicyParamsSchema,
    tags: ['repos']
  })
  async reposGetDeploymentBranchPolicy(
    params: github.ReposGetDeploymentBranchPolicyParams
  ): Promise<github.ReposGetDeploymentBranchPolicyResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/deployment-branch-policies/${params.branch_policy_id}`,
        {}
      )
      .json<github.ReposGetDeploymentBranchPolicyResponse>()
  }

  /**
 * Updates a deployment branch or tag policy for an environment.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_update_deployment_branch_policy',
    description: `Updates a deployment branch or tag policy for an environment.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposUpdateDeploymentBranchPolicyParamsSchema,
    tags: ['repos']
  })
  async reposUpdateDeploymentBranchPolicy(
    params: github.ReposUpdateDeploymentBranchPolicyParams
  ): Promise<github.ReposUpdateDeploymentBranchPolicyResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/deployment-branch-policies/${params.branch_policy_id}`,
        {
          json: pick(params, 'name')
        }
      )
      .json<github.ReposUpdateDeploymentBranchPolicyResponse>()
  }

  /**
 * Deletes a deployment branch or tag policy for an environment.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_delete_deployment_branch_policy',
    description: `Deletes a deployment branch or tag policy for an environment.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposDeleteDeploymentBranchPolicyParamsSchema,
    tags: ['repos']
  })
  async reposDeleteDeploymentBranchPolicy(
    params: github.ReposDeleteDeploymentBranchPolicyParams
  ): Promise<github.ReposDeleteDeploymentBranchPolicyResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/deployment-branch-policies/${params.branch_policy_id}`,
        {}
      )
      .json<github.ReposDeleteDeploymentBranchPolicyResponse>()
  }

  /**
 * Gets all custom deployment protection rules that are enabled for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."

For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app).

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_repos_get_all_deployment_protection_rules',
    description: `Gets all custom deployment protection rules that are enabled for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."

For more information about the app that is providing this custom deployment rule, see the [documentation for the \`GET /apps/{app_slug}\` endpoint](https://docs.github.com/rest/apps/apps#get-an-app).

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ReposGetAllDeploymentProtectionRulesParamsSchema,
    tags: ['repos']
  })
  async reposGetAllDeploymentProtectionRules(
    params: github.ReposGetAllDeploymentProtectionRulesParams
  ): Promise<github.ReposGetAllDeploymentProtectionRulesResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/deployment_protection_rules`,
        {}
      )
      .json<github.ReposGetAllDeploymentProtectionRulesResponse>()
  }

  /**
 * Enable a custom deployment protection rule for an environment.

The authenticated user must have admin or owner permissions to the repository to use this endpoint.

For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app), as well as the [guide to creating custom deployment protection rules](https://docs.github.com/actions/managing-workflow-runs-and-deployments/managing-deployments/creating-custom-deployment-protection-rules).

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_create_deployment_protection_rule',
    description: `Enable a custom deployment protection rule for an environment.

The authenticated user must have admin or owner permissions to the repository to use this endpoint.

For more information about the app that is providing this custom deployment rule, see the [documentation for the \`GET /apps/{app_slug}\` endpoint](https://docs.github.com/rest/apps/apps#get-an-app), as well as the [guide to creating custom deployment protection rules](https://docs.github.com/actions/managing-workflow-runs-and-deployments/managing-deployments/creating-custom-deployment-protection-rules).

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposCreateDeploymentProtectionRuleParamsSchema,
    tags: ['repos']
  })
  async reposCreateDeploymentProtectionRule(
    params: github.ReposCreateDeploymentProtectionRuleParams
  ): Promise<github.ReposCreateDeploymentProtectionRuleResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/deployment_protection_rules`,
        {
          json: pick(params, 'integration_id')
        }
      )
      .json<github.ReposCreateDeploymentProtectionRuleResponse>()
  }

  /**
 * Gets all custom deployment protection rule integrations that are available for an environment.

The authenticated user must have admin or owner permissions to the repository to use this endpoint.

For more information about environments, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."

For more information about the app that is providing this custom deployment rule, see "[GET an app](https://docs.github.com/rest/apps/apps#get-an-app)".

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_repos_list_custom_deployment_rule_integrations',
    description: `Gets all custom deployment protection rule integrations that are available for an environment.

The authenticated user must have admin or owner permissions to the repository to use this endpoint.

For more information about environments, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."

For more information about the app that is providing this custom deployment rule, see "[GET an app](https://docs.github.com/rest/apps/apps#get-an-app)".

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ReposListCustomDeploymentRuleIntegrationsParamsSchema,
    tags: ['repos']
  })
  async reposListCustomDeploymentRuleIntegrations(
    params: github.ReposListCustomDeploymentRuleIntegrationsParams
  ): Promise<github.ReposListCustomDeploymentRuleIntegrationsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/deployment_protection_rules/apps`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'page', 'per_page'))
        }
      )
      .json<github.ReposListCustomDeploymentRuleIntegrationsResponse>()
  }

  /**
 * Gets an enabled custom deployment protection rule for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."

For more information about the app that is providing this custom deployment rule, see [`GET /apps/{app_slug}`](https://docs.github.com/rest/apps/apps#get-an-app).

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_repos_get_custom_deployment_protection_rule',
    description: `Gets an enabled custom deployment protection rule for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."

For more information about the app that is providing this custom deployment rule, see [\`GET /apps/{app_slug}\`](https://docs.github.com/rest/apps/apps#get-an-app).

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ReposGetCustomDeploymentProtectionRuleParamsSchema,
    tags: ['repos']
  })
  async reposGetCustomDeploymentProtectionRule(
    params: github.ReposGetCustomDeploymentProtectionRuleParams
  ): Promise<github.ReposGetCustomDeploymentProtectionRuleResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/deployment_protection_rules/${params.protection_rule_id}`,
        {}
      )
      .json<github.ReposGetCustomDeploymentProtectionRuleResponse>()
  }

  /**
 * Disables a custom deployment protection rule for an environment.

The authenticated user must have admin or owner permissions to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_disable_deployment_protection_rule',
    description: `Disables a custom deployment protection rule for an environment.

The authenticated user must have admin or owner permissions to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposDisableDeploymentProtectionRuleParamsSchema,
    tags: ['repos']
  })
  async reposDisableDeploymentProtectionRule(
    params: github.ReposDisableDeploymentProtectionRuleParams
  ): Promise<github.ReposDisableDeploymentProtectionRuleResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/deployment_protection_rules/${params.protection_rule_id}`,
        {}
      )
      .json<github.ReposDisableDeploymentProtectionRuleResponse>()
  }

  /**
 * Lists all secrets available in an environment without revealing their
encrypted values.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_list_environment_secrets',
    description: `Lists all secrets available in an environment without revealing their
encrypted values.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsListEnvironmentSecretsParamsSchema,
    tags: ['actions']
  })
  async actionsListEnvironmentSecrets(
    params: github.ActionsListEnvironmentSecretsParams
  ): Promise<github.ActionsListEnvironmentSecretsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/secrets`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ActionsListEnvironmentSecretsResponse>()
  }

  /**
 * Get the public key for an environment, which you need to encrypt environment
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, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_environment_public_key',
    description: `Get the public key for an environment, which you need to encrypt environment
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, OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetEnvironmentPublicKeyParamsSchema,
    tags: ['actions']
  })
  async actionsGetEnvironmentPublicKey(
    params: github.ActionsGetEnvironmentPublicKeyParams
  ): Promise<github.ActionsGetEnvironmentPublicKeyResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/secrets/public-key`,
        {}
      )
      .json<github.ActionsGetEnvironmentPublicKeyResponse>()
  }

  /**
 * Gets a single environment secret without revealing its encrypted value.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_environment_secret',
    description: `Gets a single environment secret without revealing its encrypted value.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetEnvironmentSecretParamsSchema,
    tags: ['actions']
  })
  async actionsGetEnvironmentSecret(
    params: github.ActionsGetEnvironmentSecretParams
  ): Promise<github.ActionsGetEnvironmentSecretResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/secrets/${params.secret_name}`,
        {}
      )
      .json<github.ActionsGetEnvironmentSecretResponse>()
  }

  /**
 * Creates or updates an environment secret with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_create_or_update_environment_secret',
    description: `Creates or updates an environment secret with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsCreateOrUpdateEnvironmentSecretParamsSchema,
    tags: ['actions']
  })
  async actionsCreateOrUpdateEnvironmentSecret(
    params: github.ActionsCreateOrUpdateEnvironmentSecretParams
  ): Promise<github.ActionsCreateOrUpdateEnvironmentSecretResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/secrets/${params.secret_name}`,
        {
          json: pick(params, 'encrypted_value', 'key_id')
        }
      )
      .json<github.ActionsCreateOrUpdateEnvironmentSecretResponse>()
  }

  /**
 * Deletes a secret in an environment using the secret name.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_delete_environment_secret',
    description: `Deletes a secret in an environment using the secret name.

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDeleteEnvironmentSecretParamsSchema,
    tags: ['actions']
  })
  async actionsDeleteEnvironmentSecret(
    params: github.ActionsDeleteEnvironmentSecretParams
  ): Promise<github.ActionsDeleteEnvironmentSecretResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/secrets/${params.secret_name}`,
        {}
      )
      .json<github.ActionsDeleteEnvironmentSecretResponse>()
  }

  /**
 * Lists all environment variables.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_list_environment_variables',
    description: `Lists all environment variables.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsListEnvironmentVariablesParamsSchema,
    tags: ['actions']
  })
  async actionsListEnvironmentVariables(
    params: github.ActionsListEnvironmentVariablesParams
  ): Promise<github.ActionsListEnvironmentVariablesResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/variables`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ActionsListEnvironmentVariablesResponse>()
  }

  /**
 * Create an environment variable that you can reference in a GitHub Actions workflow.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_create_environment_variable',
    description: `Create an environment variable that you can reference in a GitHub Actions workflow.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsCreateEnvironmentVariableParamsSchema,
    tags: ['actions']
  })
  async actionsCreateEnvironmentVariable(
    params: github.ActionsCreateEnvironmentVariableParams
  ): Promise<github.ActionsCreateEnvironmentVariableResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/variables`,
        {
          json: pick(params, 'name', 'value')
        }
      )
      .json<github.ActionsCreateEnvironmentVariableResponse>()
  }

  /**
 * Gets a specific variable in an environment.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_get_environment_variable',
    description: `Gets a specific variable in an environment.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsGetEnvironmentVariableParamsSchema,
    tags: ['actions']
  })
  async actionsGetEnvironmentVariable(
    params: github.ActionsGetEnvironmentVariableParams
  ): Promise<github.ActionsGetEnvironmentVariableResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/variables/${params.name}`,
        {}
      )
      .json<github.ActionsGetEnvironmentVariableResponse>()
  }

  /**
 * Deletes an environment variable using the variable name.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_delete_environment_variable',
    description: `Deletes an environment variable using the variable name.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsDeleteEnvironmentVariableParamsSchema,
    tags: ['actions']
  })
  async actionsDeleteEnvironmentVariable(
    params: github.ActionsDeleteEnvironmentVariableParams
  ): Promise<github.ActionsDeleteEnvironmentVariableResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/variables/${params.name}`,
        {}
      )
      .json<github.ActionsDeleteEnvironmentVariableResponse>()
  }

  /**
 * Updates an environment variable that you can reference in a GitHub Actions workflow.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_actions_update_environment_variable',
    description: `Updates an environment variable that you can reference in a GitHub Actions workflow.

Authenticated users must have collaborator access to a repository to create, update, or read variables.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ActionsUpdateEnvironmentVariableParamsSchema,
    tags: ['actions']
  })
  async actionsUpdateEnvironmentVariable(
    params: github.ActionsUpdateEnvironmentVariableParams
  ): Promise<github.ActionsUpdateEnvironmentVariableResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/environments/${params.environment_name}/variables/${params.name}`,
        {
          json: pick(params, 'name', 'value')
        }
      )
      .json<github.ActionsUpdateEnvironmentVariableResponse>()
  }

  /**
 * > [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
 */
  @aiFunction({
    name: 'github_activity_list_repo_events',
    description: `> [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.`,
    inputSchema: github.ActivityListRepoEventsParamsSchema,
    tags: ['activity']
  })
  async activityListRepoEvents(
    params: github.ActivityListRepoEventsParams
  ): Promise<github.ActivityListRepoEventsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/events`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActivityListRepoEventsResponse>()
  }

  /**
   * List forks.
   */
  @aiFunction({
    name: 'github_repos_list_forks',
    description: `List forks.`,
    inputSchema: github.ReposListForksParamsSchema,
    tags: ['repos']
  })
  async reposListForks(
    params: github.ReposListForksParams
  ): Promise<github.ReposListForksResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/forks`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'sort', 'per_page', 'page')
        )
      })
      .json<github.ReposListForksResponse>()
  }

  /**
 * Create a fork for the authenticated user.

> [!NOTE]
> Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api).

> [!NOTE]
> Although this endpoint works with GitHub Apps, the GitHub App must be installed on the destination account with access to all repositories and on the source account with access to the source repository.
 */
  @aiFunction({
    name: 'github_repos_create_fork',
    description: `Create a fork for the authenticated user.

> [!NOTE]
> Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api).

> [!NOTE]
> Although this endpoint works with GitHub Apps, the GitHub App must be installed on the destination account with access to all repositories and on the source account with access to the source repository.`,
    inputSchema: github.ReposCreateForkParamsSchema,
    tags: ['repos']
  })
  async reposCreateFork(
    params: github.ReposCreateForkParams
  ): Promise<github.ReposCreateForkResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/forks`, {
        json: pick(params, 'organization', 'name', 'default_branch_only')
      })
      .json<github.ReposCreateForkResponse>()
  }

  /**
   * Create a blob.
   */
  @aiFunction({
    name: 'github_git_create_blob',
    description: `Create a blob.`,
    inputSchema: github.GitCreateBlobParamsSchema,
    tags: ['git']
  })
  async gitCreateBlob(
    params: github.GitCreateBlobParams
  ): Promise<github.GitCreateBlobResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/git/blobs`, {
        json: pick(params, 'content', 'encoding')
      })
      .json<github.GitCreateBlobResponse>()
  }

  /**
 * The `content` in the response will always be Base64 encoded.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw blob data.
- **`application/vnd.github+json`**: Returns a JSON representation of the blob with `content` as a base64 encoded string. This is the default if no media type is specified.

**Note** This endpoint supports blobs up to 100 megabytes in size.
 */
  @aiFunction({
    name: 'github_git_get_blob',
    description: `The \`content\` in the response will always be Base64 encoded.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw blob data.
- **\`application/vnd.github+json\`**: Returns a JSON representation of the blob with \`content\` as a base64 encoded string. This is the default if no media type is specified.

**Note** This endpoint supports blobs up to 100 megabytes in size.`,
    inputSchema: github.GitGetBlobParamsSchema,
    tags: ['git']
  })
  async gitGetBlob(
    params: github.GitGetBlobParams
  ): Promise<github.GitGetBlobResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/git/blobs/${params.file_sha}`,
        {}
      )
      .json<github.GitGetBlobResponse>()
  }

  /**
 * Creates a new Git [commit object](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects).

**Signature verification object**

The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:

| Name | Type | Description |
| ---- | ---- | ----------- |
| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |
| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in the table below. |
| `signature` | `string` | The signature that was extracted from the commit. |
| `payload` | `string` | The value that was signed. |
| `verified_at` | `string` | The date the signature was verified by GitHub. |

These are the possible values for `reason` in the `verification` object:

| Value | Description |
| ----- | ----------- |
| `expired_key` | The key that made the signature is expired. |
| `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
| `gpgverify_error` | There was an error communicating with the signature verification service. |
| `gpgverify_unavailable` | The signature verification service is currently unavailable. |
| `unsigned` | The object does not include a signature. |
| `unknown_signature_type` | A non-PGP signature was found in the commit. |
| `no_user` | No user was associated with the `committer` email address in the commit. |
| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. |
| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |
| `unknown_key` | The key that made the signature has not been registered with any user's account. |
| `malformed_signature` | There was an error parsing the signature. |
| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
| `valid` | None of the above errors applied, so the signature is considered to be verified. |.
 */
  @aiFunction({
    name: 'github_git_create_commit',
    description: `Creates a new Git [commit object](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects).

**Signature verification object**

The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object:

| Name | Type | Description |
| ---- | ---- | ----------- |
| \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. |
| \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in the table below. |
| \`signature\` | \`string\` | The signature that was extracted from the commit. |
| \`payload\` | \`string\` | The value that was signed. |
| \`verified_at\` | \`string\` | The date the signature was verified by GitHub. |

These are the possible values for \`reason\` in the \`verification\` object:

| Value | Description |
| ----- | ----------- |
| \`expired_key\` | The key that made the signature is expired. |
| \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
| \`gpgverify_error\` | There was an error communicating with the signature verification service. |
| \`gpgverify_unavailable\` | The signature verification service is currently unavailable. |
| \`unsigned\` | The object does not include a signature. |
| \`unknown_signature_type\` | A non-PGP signature was found in the commit. |
| \`no_user\` | No user was associated with the \`committer\` email address in the commit. |
| \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on their account. |
| \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. |
| \`unknown_key\` | The key that made the signature has not been registered with any user's account. |
| \`malformed_signature\` | There was an error parsing the signature. |
| \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
| \`valid\` | None of the above errors applied, so the signature is considered to be verified. |.`,
    inputSchema: github.GitCreateCommitParamsSchema,
    tags: ['git']
  })
  async gitCreateCommit(
    params: github.GitCreateCommitParams
  ): Promise<github.GitCreateCommitResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/git/commits`, {
        json: pick(
          params,
          'message',
          'tree',
          'parents',
          'author',
          'committer',
          'signature'
        )
      })
      .json<github.GitCreateCommitResponse>()
  }

  /**
 * Gets a Git [commit object](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects).

To get the contents of a commit, see "[Get a commit](/rest/commits/commits#get-a-commit)."

**Signature verification object**

The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:

| Name | Type | Description |
| ---- | ---- | ----------- |
| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |
| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in the table below. |
| `signature` | `string` | The signature that was extracted from the commit. |
| `payload` | `string` | The value that was signed. |
| `verified_at` | `string` | The date the signature was verified by GitHub. |

These are the possible values for `reason` in the `verification` object:

| Value | Description |
| ----- | ----------- |
| `expired_key` | The key that made the signature is expired. |
| `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
| `gpgverify_error` | There was an error communicating with the signature verification service. |
| `gpgverify_unavailable` | The signature verification service is currently unavailable. |
| `unsigned` | The object does not include a signature. |
| `unknown_signature_type` | A non-PGP signature was found in the commit. |
| `no_user` | No user was associated with the `committer` email address in the commit. |
| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. |
| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |
| `unknown_key` | The key that made the signature has not been registered with any user's account. |
| `malformed_signature` | There was an error parsing the signature. |
| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
| `valid` | None of the above errors applied, so the signature is considered to be verified. |.
 */
  @aiFunction({
    name: 'github_git_get_commit',
    description: `Gets a Git [commit object](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects).

To get the contents of a commit, see "[Get a commit](/rest/commits/commits#get-a-commit)."

**Signature verification object**

The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object:

| Name | Type | Description |
| ---- | ---- | ----------- |
| \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. |
| \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in the table below. |
| \`signature\` | \`string\` | The signature that was extracted from the commit. |
| \`payload\` | \`string\` | The value that was signed. |
| \`verified_at\` | \`string\` | The date the signature was verified by GitHub. |

These are the possible values for \`reason\` in the \`verification\` object:

| Value | Description |
| ----- | ----------- |
| \`expired_key\` | The key that made the signature is expired. |
| \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
| \`gpgverify_error\` | There was an error communicating with the signature verification service. |
| \`gpgverify_unavailable\` | The signature verification service is currently unavailable. |
| \`unsigned\` | The object does not include a signature. |
| \`unknown_signature_type\` | A non-PGP signature was found in the commit. |
| \`no_user\` | No user was associated with the \`committer\` email address in the commit. |
| \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on their account. |
| \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. |
| \`unknown_key\` | The key that made the signature has not been registered with any user's account. |
| \`malformed_signature\` | There was an error parsing the signature. |
| \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
| \`valid\` | None of the above errors applied, so the signature is considered to be verified. |.`,
    inputSchema: github.GitGetCommitParamsSchema,
    tags: ['git']
  })
  async gitGetCommit(
    params: github.GitGetCommitParams
  ): Promise<github.GitGetCommitResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/git/commits/${params.commit_sha}`,
        {}
      )
      .json<github.GitGetCommitResponse>()
  }

  /**
 * Returns an array of references from your Git database that match the supplied name. The `:ref` in the URL must be formatted as `heads/<branch name>` for branches and `tags/<tag name>` for tags. If the `:ref` doesn't exist in the repository, but existing refs start with `:ref`, they will be returned as an array.

When you use this endpoint without providing a `:ref`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just `heads` and `tags`.

> [!NOTE]
> You need to explicitly [request a pull request](https://docs.github.com/rest/pulls/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".

If you request matching references for a branch named `feature` but the branch `feature` doesn't exist, the response can still include other matching head refs that start with the word `feature`, such as `featureA` and `featureB`.
 */
  @aiFunction({
    name: 'github_git_list_matching_refs',
    description: `Returns an array of references from your Git database that match the supplied name. The \`:ref\` in the URL must be formatted as \`heads/<branch name>\` for branches and \`tags/<tag name>\` for tags. If the \`:ref\` doesn't exist in the repository, but existing refs start with \`:ref\`, they will be returned as an array.

When you use this endpoint without providing a \`:ref\`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just \`heads\` and \`tags\`.

> [!NOTE]
> You need to explicitly [request a pull request](https://docs.github.com/rest/pulls/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".

If you request matching references for a branch named \`feature\` but the branch \`feature\` doesn't exist, the response can still include other matching head refs that start with the word \`feature\`, such as \`featureA\` and \`featureB\`.`,
    inputSchema: github.GitListMatchingRefsParamsSchema,
    tags: ['git']
  })
  async gitListMatchingRefs(
    params: github.GitListMatchingRefsParams
  ): Promise<github.GitListMatchingRefsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/git/matching-refs/${params.ref}`,
        {}
      )
      .json<github.GitListMatchingRefsResponse>()
  }

  /**
 * Returns a single reference from your Git database. The `:ref` in the URL must be formatted as `heads/<branch name>` for branches and `tags/<tag name>` for tags. If the `:ref` doesn't match an existing ref, a `404` is returned.

> [!NOTE]
> You need to explicitly [request a pull request](https://docs.github.com/rest/pulls/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".
 */
  @aiFunction({
    name: 'github_git_get_ref',
    description: `Returns a single reference from your Git database. The \`:ref\` in the URL must be formatted as \`heads/<branch name>\` for branches and \`tags/<tag name>\` for tags. If the \`:ref\` doesn't match an existing ref, a \`404\` is returned.

> [!NOTE]
> You need to explicitly [request a pull request](https://docs.github.com/rest/pulls/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".`,
    inputSchema: github.GitGetRefParamsSchema,
    tags: ['git']
  })
  async gitGetRef(
    params: github.GitGetRefParams
  ): Promise<github.GitGetRefResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/git/ref/${params.ref}`,
        {}
      )
      .json<github.GitGetRefResponse>()
  }

  /**
   * Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches.
   */
  @aiFunction({
    name: 'github_git_create_ref',
    description: `Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches.`,
    inputSchema: github.GitCreateRefParamsSchema,
    tags: ['git']
  })
  async gitCreateRef(
    params: github.GitCreateRefParams
  ): Promise<github.GitCreateRefResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/git/refs`, {
        json: pick(params, 'ref', 'sha')
      })
      .json<github.GitCreateRefResponse>()
  }

  /**
   * Deletes the provided reference.
   */
  @aiFunction({
    name: 'github_git_delete_ref',
    description: `Deletes the provided reference.`,
    inputSchema: github.GitDeleteRefParamsSchema,
    tags: ['git']
  })
  async gitDeleteRef(
    params: github.GitDeleteRefParams
  ): Promise<github.GitDeleteRefResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/git/refs/${params.ref}`,
        {}
      )
      .json<github.GitDeleteRefResponse>()
  }

  /**
   * Updates the provided reference to point to a new SHA. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation.
   */
  @aiFunction({
    name: 'github_git_update_ref',
    description: `Updates the provided reference to point to a new SHA. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation.`,
    inputSchema: github.GitUpdateRefParamsSchema,
    tags: ['git']
  })
  async gitUpdateRef(
    params: github.GitUpdateRefParams
  ): Promise<github.GitUpdateRefResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/git/refs/${params.ref}`,
        {
          json: pick(params, 'sha', 'force')
        }
      )
      .json<github.GitUpdateRefResponse>()
  }

  /**
 * Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then [create](https://docs.github.com/rest/git/refs#create-a-reference) the `refs/tags/[tag]` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/rest/git/refs#create-a-reference) the tag reference - this call would be unnecessary.

**Signature verification object**

The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:

| Name | Type | Description |
| ---- | ---- | ----------- |
| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |
| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |
| `signature` | `string` | The signature that was extracted from the commit. |
| `payload` | `string` | The value that was signed. |
| `verified_at` | `string` | The date the signature was verified by GitHub. |

These are the possible values for `reason` in the `verification` object:

| Value | Description |
| ----- | ----------- |
| `expired_key` | The key that made the signature is expired. |
| `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
| `gpgverify_error` | There was an error communicating with the signature verification service. |
| `gpgverify_unavailable` | The signature verification service is currently unavailable. |
| `unsigned` | The object does not include a signature. |
| `unknown_signature_type` | A non-PGP signature was found in the commit. |
| `no_user` | No user was associated with the `committer` email address in the commit. |
| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. |
| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |
| `unknown_key` | The key that made the signature has not been registered with any user's account. |
| `malformed_signature` | There was an error parsing the signature. |
| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
| `valid` | None of the above errors applied, so the signature is considered to be verified. |.
 */
  @aiFunction({
    name: 'github_git_create_tag',
    description: `Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then [create](https://docs.github.com/rest/git/refs#create-a-reference) the \`refs/tags/[tag]\` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/rest/git/refs#create-a-reference) the tag reference - this call would be unnecessary.

**Signature verification object**

The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object:

| Name | Type | Description |
| ---- | ---- | ----------- |
| \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. |
| \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. |
| \`signature\` | \`string\` | The signature that was extracted from the commit. |
| \`payload\` | \`string\` | The value that was signed. |
| \`verified_at\` | \`string\` | The date the signature was verified by GitHub. |

These are the possible values for \`reason\` in the \`verification\` object:

| Value | Description |
| ----- | ----------- |
| \`expired_key\` | The key that made the signature is expired. |
| \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
| \`gpgverify_error\` | There was an error communicating with the signature verification service. |
| \`gpgverify_unavailable\` | The signature verification service is currently unavailable. |
| \`unsigned\` | The object does not include a signature. |
| \`unknown_signature_type\` | A non-PGP signature was found in the commit. |
| \`no_user\` | No user was associated with the \`committer\` email address in the commit. |
| \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on their account. |
| \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. |
| \`unknown_key\` | The key that made the signature has not been registered with any user's account. |
| \`malformed_signature\` | There was an error parsing the signature. |
| \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
| \`valid\` | None of the above errors applied, so the signature is considered to be verified. |.`,
    inputSchema: github.GitCreateTagParamsSchema,
    tags: ['git']
  })
  async gitCreateTag(
    params: github.GitCreateTagParams
  ): Promise<github.GitCreateTagResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/git/tags`, {
        json: pick(params, 'tag', 'message', 'object', 'type', 'tagger')
      })
      .json<github.GitCreateTagResponse>()
  }

  /**
 * **Signature verification object**

The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:

| Name | Type | Description |
| ---- | ---- | ----------- |
| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |
| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |
| `signature` | `string` | The signature that was extracted from the commit. |
| `payload` | `string` | The value that was signed. |
| `verified_at` | `string` | The date the signature was verified by GitHub. |

These are the possible values for `reason` in the `verification` object:

| Value | Description |
| ----- | ----------- |
| `expired_key` | The key that made the signature is expired. |
| `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
| `gpgverify_error` | There was an error communicating with the signature verification service. |
| `gpgverify_unavailable` | The signature verification service is currently unavailable. |
| `unsigned` | The object does not include a signature. |
| `unknown_signature_type` | A non-PGP signature was found in the commit. |
| `no_user` | No user was associated with the `committer` email address in the commit. |
| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. |
| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |
| `unknown_key` | The key that made the signature has not been registered with any user's account. |
| `malformed_signature` | There was an error parsing the signature. |
| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
| `valid` | None of the above errors applied, so the signature is considered to be verified. |.
 */
  @aiFunction({
    name: 'github_git_get_tag',
    description: `**Signature verification object**

The response will include a \`verification\` object that describes the result of verifying the commit's signature. The following fields are included in the \`verification\` object:

| Name | Type | Description |
| ---- | ---- | ----------- |
| \`verified\` | \`boolean\` | Indicates whether GitHub considers the signature in this commit to be verified. |
| \`reason\` | \`string\` | The reason for verified value. Possible values and their meanings are enumerated in table below. |
| \`signature\` | \`string\` | The signature that was extracted from the commit. |
| \`payload\` | \`string\` | The value that was signed. |
| \`verified_at\` | \`string\` | The date the signature was verified by GitHub. |

These are the possible values for \`reason\` in the \`verification\` object:

| Value | Description |
| ----- | ----------- |
| \`expired_key\` | The key that made the signature is expired. |
| \`not_signing_key\` | The "signing" flag is not among the usage flags in the GPG key that made the signature. |
| \`gpgverify_error\` | There was an error communicating with the signature verification service. |
| \`gpgverify_unavailable\` | The signature verification service is currently unavailable. |
| \`unsigned\` | The object does not include a signature. |
| \`unknown_signature_type\` | A non-PGP signature was found in the commit. |
| \`no_user\` | No user was associated with the \`committer\` email address in the commit. |
| \`unverified_email\` | The \`committer\` email address in the commit was associated with a user, but the email address is not verified on their account. |
| \`bad_email\` | The \`committer\` email address in the commit is not included in the identities of the PGP key that made the signature. |
| \`unknown_key\` | The key that made the signature has not been registered with any user's account. |
| \`malformed_signature\` | There was an error parsing the signature. |
| \`invalid\` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
| \`valid\` | None of the above errors applied, so the signature is considered to be verified. |.`,
    inputSchema: github.GitGetTagParamsSchema,
    tags: ['git']
  })
  async gitGetTag(
    params: github.GitGetTagParams
  ): Promise<github.GitGetTagResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/git/tags/${params.tag_sha}`,
        {}
      )
      .json<github.GitGetTagResponse>()
  }

  /**
 * The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure.

If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/rest/git/commits#create-a-commit)" and "[Update a reference](https://docs.github.com/rest/git/refs#update-a-reference)."

Returns an error if you try to delete a file that does not exist.
 */
  @aiFunction({
    name: 'github_git_create_tree',
    description: `The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure.

If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/rest/git/commits#create-a-commit)" and "[Update a reference](https://docs.github.com/rest/git/refs#update-a-reference)."

Returns an error if you try to delete a file that does not exist.`,
    inputSchema: github.GitCreateTreeParamsSchema,
    tags: ['git']
  })
  async gitCreateTree(
    params: github.GitCreateTreeParams
  ): Promise<github.GitCreateTreeResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/git/trees`, {
        json: pick(params, 'tree', 'base_tree')
      })
      .json<github.GitCreateTreeResponse>()
  }

  /**
 * Returns a single tree using the SHA1 value or ref name for that tree.

If `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.

> [!NOTE]
> The limit for the `tree` array is 100,000 entries with a maximum size of 7 MB when using the `recursive` parameter.
 */
  @aiFunction({
    name: 'github_git_get_tree',
    description: `Returns a single tree using the SHA1 value or ref name for that tree.

If \`truncated\` is \`true\` in the response then the number of items in the \`tree\` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.

> [!NOTE]
> The limit for the \`tree\` array is 100,000 entries with a maximum size of 7 MB when using the \`recursive\` parameter.`,
    inputSchema: github.GitGetTreeParamsSchema,
    tags: ['git']
  })
  async gitGetTree(
    params: github.GitGetTreeParams
  ): Promise<github.GitGetTreeResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/git/trees/${params.tree_sha}`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'recursive'))
        }
      )
      .json<github.GitGetTreeResponse>()
  }

  /**
   * Lists webhooks for a repository. `last response` may return null if there have not been any deliveries within 30 days.
   */
  @aiFunction({
    name: 'github_repos_list_webhooks',
    description: `Lists webhooks for a repository. \`last response\` may return null if there have not been any deliveries within 30 days.`,
    inputSchema: github.ReposListWebhooksParamsSchema,
    tags: ['repos']
  })
  async reposListWebhooks(
    params: github.ReposListWebhooksParams
  ): Promise<github.ReposListWebhooksResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/hooks`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ReposListWebhooksResponse>()
  }

  /**
 * Repositories can have multiple webhooks installed. Each webhook should have a unique `config`. Multiple webhooks can
share the same `config` as long as those webhooks do not have any `events` that overlap.
 */
  @aiFunction({
    name: 'github_repos_create_webhook',
    description: `Repositories can have multiple webhooks installed. Each webhook should have a unique \`config\`. Multiple webhooks can
share the same \`config\` as long as those webhooks do not have any \`events\` that overlap.`,
    inputSchema: github.ReposCreateWebhookParamsSchema,
    tags: ['repos']
  })
  async reposCreateWebhook(
    params: github.ReposCreateWebhookParams
  ): Promise<github.ReposCreateWebhookResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/hooks`, {
        json: pick(params, 'name', 'config', 'events', 'active')
      })
      .json<github.ReposCreateWebhookResponse>()
  }

  /**
   * Returns a webhook configured in a repository. To get only the webhook `config` properties, see "[Get a webhook configuration for a repository](/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository).".
   */
  @aiFunction({
    name: 'github_repos_get_webhook',
    description: `Returns a webhook configured in a repository. To get only the webhook \`config\` properties, see "[Get a webhook configuration for a repository](/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository).".`,
    inputSchema: github.ReposGetWebhookParamsSchema,
    tags: ['repos']
  })
  async reposGetWebhook(
    params: github.ReposGetWebhookParams
  ): Promise<github.ReposGetWebhookResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/hooks/${params.hook_id}`,
        {}
      )
      .json<github.ReposGetWebhookResponse>()
  }

  /**
 * Delete a webhook for an organization.

The authenticated user must be a repository owner, or have admin access in the repository, to delete the webhook.
 */
  @aiFunction({
    name: 'github_repos_delete_webhook',
    description: `Delete a webhook for an organization.

The authenticated user must be a repository owner, or have admin access in the repository, to delete the webhook.`,
    inputSchema: github.ReposDeleteWebhookParamsSchema,
    tags: ['repos']
  })
  async reposDeleteWebhook(
    params: github.ReposDeleteWebhookParams
  ): Promise<github.ReposDeleteWebhookResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/hooks/${params.hook_id}`,
        {}
      )
      .json<github.ReposDeleteWebhookResponse>()
  }

  /**
   * Updates a webhook configured in a repository. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use "[Update a webhook configuration for a repository](/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository).".
   */
  @aiFunction({
    name: 'github_repos_update_webhook',
    description: `Updates a webhook configured in a repository. If you previously had a \`secret\` set, you must provide the same \`secret\` or set a new \`secret\` or the secret will be removed. If you are only updating individual webhook \`config\` properties, use "[Update a webhook configuration for a repository](/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository).".`,
    inputSchema: github.ReposUpdateWebhookParamsSchema,
    tags: ['repos']
  })
  async reposUpdateWebhook(
    params: github.ReposUpdateWebhookParams
  ): Promise<github.ReposUpdateWebhookResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/hooks/${params.hook_id}`,
        {
          json: pick(
            params,
            'config',
            'events',
            'add_events',
            'remove_events',
            'active'
          )
        }
      )
      .json<github.ReposUpdateWebhookResponse>()
  }

  /**
 * Returns the webhook configuration for a repository. To get more information about the webhook, including the `active` state and `events`, use "[Get a repository webhook](/rest/webhooks/repos#get-a-repository-webhook)."

OAuth app tokens and personal access tokens (classic) need the `read:repo_hook` or `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_get_webhook_config_for_repo',
    description: `Returns the webhook configuration for a repository. To get more information about the webhook, including the \`active\` state and \`events\`, use "[Get a repository webhook](/rest/webhooks/repos#get-a-repository-webhook)."

OAuth app tokens and personal access tokens (classic) need the \`read:repo_hook\` or \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposGetWebhookConfigForRepoParamsSchema,
    tags: ['repos']
  })
  async reposGetWebhookConfigForRepo(
    params: github.ReposGetWebhookConfigForRepoParams
  ): Promise<github.ReposGetWebhookConfigForRepoResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/hooks/${params.hook_id}/config`,
        {}
      )
      .json<github.ReposGetWebhookConfigForRepoResponse>()
  }

  /**
 * Updates the webhook configuration for a repository. To update more information about the webhook, including the `active` state and `events`, use "[Update a repository webhook](/rest/webhooks/repos#update-a-repository-webhook)."

OAuth app tokens and personal access tokens (classic) need the `write:repo_hook` or `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_update_webhook_config_for_repo',
    description: `Updates the webhook configuration for a repository. To update more information about the webhook, including the \`active\` state and \`events\`, use "[Update a repository webhook](/rest/webhooks/repos#update-a-repository-webhook)."

OAuth app tokens and personal access tokens (classic) need the \`write:repo_hook\` or \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposUpdateWebhookConfigForRepoParamsSchema,
    tags: ['repos']
  })
  async reposUpdateWebhookConfigForRepo(
    params: github.ReposUpdateWebhookConfigForRepoParams
  ): Promise<github.ReposUpdateWebhookConfigForRepoResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/hooks/${params.hook_id}/config`,
        {
          json: pick(params, 'url', 'content_type', 'secret', 'insecure_ssl')
        }
      )
      .json<github.ReposUpdateWebhookConfigForRepoResponse>()
  }

  /**
   * Returns a list of webhook deliveries for a webhook configured in a repository.
   */
  @aiFunction({
    name: 'github_repos_list_webhook_deliveries',
    description: `Returns a list of webhook deliveries for a webhook configured in a repository.`,
    inputSchema: github.ReposListWebhookDeliveriesParamsSchema,
    tags: ['repos']
  })
  async reposListWebhookDeliveries(
    params: github.ReposListWebhookDeliveriesParams
  ): Promise<github.ReposListWebhookDeliveriesResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/hooks/${params.hook_id}/deliveries`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'cursor'))
        }
      )
      .json<github.ReposListWebhookDeliveriesResponse>()
  }

  /**
   * Returns a delivery for a webhook configured in a repository.
   */
  @aiFunction({
    name: 'github_repos_get_webhook_delivery',
    description: `Returns a delivery for a webhook configured in a repository.`,
    inputSchema: github.ReposGetWebhookDeliveryParamsSchema,
    tags: ['repos']
  })
  async reposGetWebhookDelivery(
    params: github.ReposGetWebhookDeliveryParams
  ): Promise<github.ReposGetWebhookDeliveryResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/hooks/${params.hook_id}/deliveries/${params.delivery_id}`,
        {}
      )
      .json<github.ReposGetWebhookDeliveryResponse>()
  }

  /**
   * Redeliver a webhook delivery for a webhook configured in a repository.
   */
  @aiFunction({
    name: 'github_repos_redeliver_webhook_delivery',
    description: `Redeliver a webhook delivery for a webhook configured in a repository.`,
    inputSchema: github.ReposRedeliverWebhookDeliveryParamsSchema,
    tags: ['repos']
  })
  async reposRedeliverWebhookDelivery(
    params: github.ReposRedeliverWebhookDeliveryParams
  ): Promise<github.ReposRedeliverWebhookDeliveryResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/hooks/${params.hook_id}/deliveries/${params.delivery_id}/attempts`,
        {}
      )
      .json<github.ReposRedeliverWebhookDeliveryResponse>()
  }

  /**
   * This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook.
   */
  @aiFunction({
    name: 'github_repos_ping_webhook',
    description: `This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook.`,
    inputSchema: github.ReposPingWebhookParamsSchema,
    tags: ['repos']
  })
  async reposPingWebhook(
    params: github.ReposPingWebhookParams
  ): Promise<github.ReposPingWebhookResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/hooks/${params.hook_id}/pings`,
        {}
      )
      .json<github.ReposPingWebhookResponse>()
  }

  /**
 * This will trigger the hook with the latest push to the current repository if the hook is subscribed to `push` events. If the hook is not subscribed to `push` events, the server will respond with 204 but no test POST will be generated.

> [!NOTE]
> Previously `/repos/:owner/:repo/hooks/:hook_id/test`.
 */
  @aiFunction({
    name: 'github_repos_test_push_webhook',
    description: `This will trigger the hook with the latest push to the current repository if the hook is subscribed to \`push\` events. If the hook is not subscribed to \`push\` events, the server will respond with 204 but no test POST will be generated.

> [!NOTE]
> Previously \`/repos/:owner/:repo/hooks/:hook_id/test\`.`,
    inputSchema: github.ReposTestPushWebhookParamsSchema,
    tags: ['repos']
  })
  async reposTestPushWebhook(
    params: github.ReposTestPushWebhookParams
  ): Promise<github.ReposTestPushWebhookResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/hooks/${params.hook_id}/tests`,
        {}
      )
      .json<github.ReposTestPushWebhookResponse>()
  }

  /**
 * View the progress of an import.

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).

**Import status**

This section includes details about the possible values of the `status` field of the Import Progress response.

An import that does not have errors will progress through these steps:

*   `detecting` - the "detection" step of the import is in progress because the request did not include a `vcs` parameter. The import is identifying the type of source control present at the URL.
*   `importing` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include `commit_count` (the total number of raw commits that will be imported) and `percent` (0 - 100, the current progress through the import).
*   `mapping` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information.
*   `pushing` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include `push_percent`, which is the percent value reported by `git push` when it is "Writing objects".
*   `complete` - the import is complete, and the repository is ready on GitHub.

If there are problems, you will see one of these in the `status` field:

*   `auth_failed` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/migrations/source-imports#update-an-import) section.
*   `error` - the import encountered an error. The import progress response will include the `failed_step` and an error message. Contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api) for more information.
*   `detection_needs_auth` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/migrations/source-imports#update-an-import) section.
*   `detection_found_nothing` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/migrations/source-imports#cancel-an-import) and [retry](https://docs.github.com/rest/migrations/source-imports#start-an-import) with the correct URL.
*   `detection_found_multiple` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a `project_choices` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/migrations/source-imports#update-an-import) section.

**The project_choices field**

When multiple projects are found at the provided URL, the response hash will include a `project_choices` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type.

**Git LFS related fields**

This section includes details about Git LFS related fields that may be present in the Import Progress response.

*   `use_lfs` - describes whether the import has been opted in or out of using Git LFS. The value can be `opt_in`, `opt_out`, or `undecided` if no action has been taken.
*   `has_large_files` - the boolean value describing whether files larger than 100MB were found during the `importing` step.
*   `large_files_size` - the total size in gigabytes of files larger than 100MB found in the originating repository.
*   `large_files_count` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request.
 */
  @aiFunction({
    name: 'github_migrations_get_import_status',
    description: `View the progress of an import.

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).

**Import status**

This section includes details about the possible values of the \`status\` field of the Import Progress response.

An import that does not have errors will progress through these steps:

*   \`detecting\` - the "detection" step of the import is in progress because the request did not include a \`vcs\` parameter. The import is identifying the type of source control present at the URL.
*   \`importing\` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include \`commit_count\` (the total number of raw commits that will be imported) and \`percent\` (0 - 100, the current progress through the import).
*   \`mapping\` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information.
*   \`pushing\` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include \`push_percent\`, which is the percent value reported by \`git push\` when it is "Writing objects".
*   \`complete\` - the import is complete, and the repository is ready on GitHub.

If there are problems, you will see one of these in the \`status\` field:

*   \`auth_failed\` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/migrations/source-imports#update-an-import) section.
*   \`error\` - the import encountered an error. The import progress response will include the \`failed_step\` and an error message. Contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api) for more information.
*   \`detection_needs_auth\` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/migrations/source-imports#update-an-import) section.
*   \`detection_found_nothing\` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/migrations/source-imports#cancel-an-import) and [retry](https://docs.github.com/rest/migrations/source-imports#start-an-import) with the correct URL.
*   \`detection_found_multiple\` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a \`project_choices\` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/migrations/source-imports#update-an-import) section.

**The project_choices field**

When multiple projects are found at the provided URL, the response hash will include a \`project_choices\` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type.

**Git LFS related fields**

This section includes details about Git LFS related fields that may be present in the Import Progress response.

*   \`use_lfs\` - describes whether the import has been opted in or out of using Git LFS. The value can be \`opt_in\`, \`opt_out\`, or \`undecided\` if no action has been taken.
*   \`has_large_files\` - the boolean value describing whether files larger than 100MB were found during the \`importing\` step.
*   \`large_files_size\` - the total size in gigabytes of files larger than 100MB found in the originating repository.
*   \`large_files_count\` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request.`,
    inputSchema: github.MigrationsGetImportStatusParamsSchema,
    tags: ['migrations']
  })
  async migrationsGetImportStatus(
    params: github.MigrationsGetImportStatusParams
  ): Promise<github.MigrationsGetImportStatusResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/import`, {})
      .json<github.MigrationsGetImportStatusResponse>()
  }

  /**
 * Start a source import to a GitHub repository using GitHub Importer.
Importing into a GitHub repository with GitHub Actions enabled is not supported and will
return a status `422 Unprocessable Entity` response.

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
 */
  @aiFunction({
    name: 'github_migrations_start_import',
    description: `Start a source import to a GitHub repository using GitHub Importer.
Importing into a GitHub repository with GitHub Actions enabled is not supported and will
return a status \`422 Unprocessable Entity\` response.

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).`,
    inputSchema: github.MigrationsStartImportParamsSchema,
    tags: ['migrations']
  })
  async migrationsStartImport(
    params: github.MigrationsStartImportParams
  ): Promise<github.MigrationsStartImportResponse> {
    return this.ky
      .put(`/repos/${params.owner}/${params.repo}/import`, {
        json: pick(
          params,
          'vcs_url',
          'vcs',
          'vcs_username',
          'vcs_password',
          'tfvc_project'
        )
      })
      .json<github.MigrationsStartImportResponse>()
  }

  /**
 * Stop an import for a repository.

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
 */
  @aiFunction({
    name: 'github_migrations_cancel_import',
    description: `Stop an import for a repository.

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).`,
    inputSchema: github.MigrationsCancelImportParamsSchema,
    tags: ['migrations']
  })
  async migrationsCancelImport(
    params: github.MigrationsCancelImportParams
  ): Promise<github.MigrationsCancelImportResponse> {
    return this.ky
      .delete(`/repos/${params.owner}/${params.repo}/import`, {})
      .json<github.MigrationsCancelImportResponse>()
  }

  /**
 * An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API
request. If no parameters are provided, the import will be restarted.

Some servers (e.g. TFS servers) can have several projects at a single URL. In those cases the import progress will
have the status `detection_found_multiple` and the Import Progress response will include a `project_choices` array.
You can select the project to import by providing one of the objects in the `project_choices` array in the update request.

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
 */
  @aiFunction({
    name: 'github_migrations_update_import',
    description: `An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API
request. If no parameters are provided, the import will be restarted.

Some servers (e.g. TFS servers) can have several projects at a single URL. In those cases the import progress will
have the status \`detection_found_multiple\` and the Import Progress response will include a \`project_choices\` array.
You can select the project to import by providing one of the objects in the \`project_choices\` array in the update request.

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).`,
    inputSchema: github.MigrationsUpdateImportParamsSchema,
    tags: ['migrations']
  })
  async migrationsUpdateImport(
    params: github.MigrationsUpdateImportParams
  ): Promise<github.MigrationsUpdateImportResponse> {
    return this.ky
      .patch(`/repos/${params.owner}/${params.repo}/import`, {
        json: pick(
          params,
          'vcs_username',
          'vcs_password',
          'vcs',
          'tfvc_project'
        )
      })
      .json<github.MigrationsUpdateImportResponse>()
  }

  /**
 * Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username `hubot` into something like `hubot <hubot@12341234-abab-fefe-8787-fedcba987654>`.

This endpoint and the [Map a commit author](https://docs.github.com/rest/migrations/source-imports#map-a-commit-author) endpoint allow you to provide correct Git author information.

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
 */
  @aiFunction({
    name: 'github_migrations_get_commit_authors',
    description: `Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username \`hubot\` into something like \`hubot <hubot@12341234-abab-fefe-8787-fedcba987654>\`.

This endpoint and the [Map a commit author](https://docs.github.com/rest/migrations/source-imports#map-a-commit-author) endpoint allow you to provide correct Git author information.

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).`,
    inputSchema: github.MigrationsGetCommitAuthorsParamsSchema,
    tags: ['migrations']
  })
  async migrationsGetCommitAuthors(
    params: github.MigrationsGetCommitAuthorsParams
  ): Promise<github.MigrationsGetCommitAuthorsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/import/authors`, {
        searchParams: sanitizeSearchParams(pick(params, 'since'))
      })
      .json<github.MigrationsGetCommitAuthorsResponse>()
  }

  /**
 * Update an author's identity for the import. Your application can continue updating authors any time before you push
new commits to the repository.

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
 */
  @aiFunction({
    name: 'github_migrations_map_commit_author',
    description: `Update an author's identity for the import. Your application can continue updating authors any time before you push
new commits to the repository.

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).`,
    inputSchema: github.MigrationsMapCommitAuthorParamsSchema,
    tags: ['migrations']
  })
  async migrationsMapCommitAuthor(
    params: github.MigrationsMapCommitAuthorParams
  ): Promise<github.MigrationsMapCommitAuthorResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/import/authors/${params.author_id}`,
        {
          json: pick(params, 'email', 'name')
        }
      )
      .json<github.MigrationsMapCommitAuthorResponse>()
  }

  /**
 * List files larger than 100MB found during the import

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
 */
  @aiFunction({
    name: 'github_migrations_get_large_files',
    description: `List files larger than 100MB found during the import

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).`,
    inputSchema: github.MigrationsGetLargeFilesParamsSchema,
    tags: ['migrations']
  })
  async migrationsGetLargeFiles(
    params: github.MigrationsGetLargeFilesParams
  ): Promise<github.MigrationsGetLargeFilesResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/import/large_files`, {})
      .json<github.MigrationsGetLargeFilesResponse>()
  }

  /**
 * You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability
is powered by [Git LFS](https://git-lfs.com).

You can learn more about our LFS feature and working with large files [on our help
site](https://docs.github.com/repositories/working-with-files/managing-large-files).

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
 */
  @aiFunction({
    name: 'github_migrations_set_lfs_preference',
    description: `You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability
is powered by [Git LFS](https://git-lfs.com).

You can learn more about our LFS feature and working with large files [on our help
site](https://docs.github.com/repositories/working-with-files/managing-large-files).

> [!WARNING]
> **Endpoint closing down notice:** Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).`,
    inputSchema: github.MigrationsSetLfsPreferenceParamsSchema,
    tags: ['migrations']
  })
  async migrationsSetLfsPreference(
    params: github.MigrationsSetLfsPreferenceParams
  ): Promise<github.MigrationsSetLfsPreferenceResponse> {
    return this.ky
      .patch(`/repos/${params.owner}/${params.repo}/import/lfs`, {
        json: pick(params, 'use_lfs')
      })
      .json<github.MigrationsSetLfsPreferenceResponse>()
  }

  /**
 * Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_get_repo_installation',
    description: `Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.`,
    inputSchema: github.AppsGetRepoInstallationParamsSchema,
    tags: ['apps']
  })
  async appsGetRepoInstallation(
    params: github.AppsGetRepoInstallationParams
  ): Promise<github.AppsGetRepoInstallationResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/installation`, {})
      .json<github.AppsGetRepoInstallationResponse>()
  }

  /**
   * Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response.
   */
  @aiFunction({
    name: 'github_interactions_get_restrictions_for_repo',
    description: `Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response.`,
    inputSchema: github.InteractionsGetRestrictionsForRepoParamsSchema,
    tags: ['interactions']
  })
  async interactionsGetRestrictionsForRepo(
    params: github.InteractionsGetRestrictionsForRepoParams
  ): Promise<github.InteractionsGetRestrictionsForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/interaction-limits`, {})
      .json<github.InteractionsGetRestrictionsForRepoResponse>()
  }

  /**
   * Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository.
   */
  @aiFunction({
    name: 'github_interactions_set_restrictions_for_repo',
    description: `Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a \`409 Conflict\` response and will not be able to use this endpoint to change the interaction limit for a single repository.`,
    inputSchema: github.InteractionsSetRestrictionsForRepoParamsSchema,
    tags: ['interactions']
  })
  async interactionsSetRestrictionsForRepo(
    params: github.InteractionsSetRestrictionsForRepoParams
  ): Promise<github.InteractionsSetRestrictionsForRepoResponse> {
    return this.ky
      .put(`/repos/${params.owner}/${params.repo}/interaction-limits`, {
        json: pick(params, 'limit', 'expiry')
      })
      .json<github.InteractionsSetRestrictionsForRepoResponse>()
  }

  /**
   * Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository.
   */
  @aiFunction({
    name: 'github_interactions_remove_restrictions_for_repo',
    description: `Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a \`409 Conflict\` response and will not be able to use this endpoint to change the interaction limit for a single repository.`,
    inputSchema: github.InteractionsRemoveRestrictionsForRepoParamsSchema,
    tags: ['interactions']
  })
  async interactionsRemoveRestrictionsForRepo(
    params: github.InteractionsRemoveRestrictionsForRepoParams
  ): Promise<github.InteractionsRemoveRestrictionsForRepoResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/interaction-limits`,
        {}
      )
      .json<github.InteractionsRemoveRestrictionsForRepoResponse>()
  }

  /**
   * When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations.
   */
  @aiFunction({
    name: 'github_repos_list_invitations',
    description: `When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations.`,
    inputSchema: github.ReposListInvitationsParamsSchema,
    tags: ['repos']
  })
  async reposListInvitations(
    params: github.ReposListInvitationsParams
  ): Promise<github.ReposListInvitationsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/invitations`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ReposListInvitationsResponse>()
  }

  /**
   * Delete a repository invitation.
   */
  @aiFunction({
    name: 'github_repos_delete_invitation',
    description: `Delete a repository invitation.`,
    inputSchema: github.ReposDeleteInvitationParamsSchema,
    tags: ['repos']
  })
  async reposDeleteInvitation(
    params: github.ReposDeleteInvitationParams
  ): Promise<github.ReposDeleteInvitationResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/invitations/${params.invitation_id}`,
        {}
      )
      .json<github.ReposDeleteInvitationResponse>()
  }

  /**
   * Update a repository invitation.
   */
  @aiFunction({
    name: 'github_repos_update_invitation',
    description: `Update a repository invitation.`,
    inputSchema: github.ReposUpdateInvitationParamsSchema,
    tags: ['repos']
  })
  async reposUpdateInvitation(
    params: github.ReposUpdateInvitationParams
  ): Promise<github.ReposUpdateInvitationResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/invitations/${params.invitation_id}`,
        {
          json: pick(params, 'permissions')
        }
      )
      .json<github.ReposUpdateInvitationResponse>()
  }

  /**
 * List issues in a repository. Only open issues will be listed.

> [!NOTE]
> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_issues_list_for_repo',
    description: `List issues in a repository. Only open issues will be listed.

> [!NOTE]
> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.IssuesListForRepoParamsSchema,
    tags: ['issues']
  })
  async issuesListForRepo(
    params: github.IssuesListForRepoParams
  ): Promise<github.IssuesListForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/issues`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'milestone',
            'state',
            'assignee',
            'type',
            'creator',
            'mentioned',
            'labels',
            'sort',
            'direction',
            'since',
            'per_page',
            'page'
          )
        )
      })
      .json<github.IssuesListForRepoResponse>()
  }

  /**
 * Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://docs.github.com/articles/disabling-issues/), the API returns a `410 Gone` status.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_issues_create',
    description: `Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://docs.github.com/articles/disabling-issues/), the API returns a \`410 Gone\` status.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.IssuesCreateParamsSchema,
    tags: ['issues']
  })
  async issuesCreate(
    params: github.IssuesCreateParams
  ): Promise<github.IssuesCreateResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/issues`, {
        json: pick(
          params,
          'title',
          'body',
          'assignee',
          'milestone',
          'labels',
          'assignees',
          'type'
        )
      })
      .json<github.IssuesCreateResponse>()
  }

  /**
 * You can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request.

By default, issue comments are ordered by ascending ID.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_issues_list_comments_for_repo',
    description: `You can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request.

By default, issue comments are ordered by ascending ID.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.IssuesListCommentsForRepoParamsSchema,
    tags: ['issues']
  })
  async issuesListCommentsForRepo(
    params: github.IssuesListCommentsForRepoParams
  ): Promise<github.IssuesListCommentsForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/issues/comments`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'sort', 'direction', 'since', 'per_page', 'page')
        )
      })
      .json<github.IssuesListCommentsForRepoResponse>()
  }

  /**
 * You can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_issues_get_comment',
    description: `You can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.IssuesGetCommentParamsSchema,
    tags: ['issues']
  })
  async issuesGetComment(
    params: github.IssuesGetCommentParams
  ): Promise<github.IssuesGetCommentResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/issues/comments/${params.comment_id}`,
        {}
      )
      .json<github.IssuesGetCommentResponse>()
  }

  /**
   * You can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
   */
  @aiFunction({
    name: 'github_issues_delete_comment',
    description: `You can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.`,
    inputSchema: github.IssuesDeleteCommentParamsSchema,
    tags: ['issues']
  })
  async issuesDeleteComment(
    params: github.IssuesDeleteCommentParams
  ): Promise<github.IssuesDeleteCommentResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/issues/comments/${params.comment_id}`,
        {}
      )
      .json<github.IssuesDeleteCommentResponse>()
  }

  /**
 * You can use the REST API to update comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_issues_update_comment',
    description: `You can use the REST API to update comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.IssuesUpdateCommentParamsSchema,
    tags: ['issues']
  })
  async issuesUpdateComment(
    params: github.IssuesUpdateCommentParams
  ): Promise<github.IssuesUpdateCommentResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/issues/comments/${params.comment_id}`,
        {
          json: pick(params, 'body')
        }
      )
      .json<github.IssuesUpdateCommentResponse>()
  }

  /**
   * List the reactions to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment).
   */
  @aiFunction({
    name: 'github_reactions_list_for_issue_comment',
    description: `List the reactions to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment).`,
    inputSchema: github.ReactionsListForIssueCommentParamsSchema,
    tags: ['reactions']
  })
  async reactionsListForIssueComment(
    params: github.ReactionsListForIssueCommentParams
  ): Promise<github.ReactionsListForIssueCommentResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/issues/comments/${params.comment_id}/reactions`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'content', 'per_page', 'page')
          )
        }
      )
      .json<github.ReactionsListForIssueCommentResponse>()
  }

  /**
   * Create a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). A response with an HTTP `200` status means that you already added the reaction type to this issue comment.
   */
  @aiFunction({
    name: 'github_reactions_create_for_issue_comment',
    description: `Create a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). A response with an HTTP \`200\` status means that you already added the reaction type to this issue comment.`,
    inputSchema: github.ReactionsCreateForIssueCommentParamsSchema,
    tags: ['reactions']
  })
  async reactionsCreateForIssueComment(
    params: github.ReactionsCreateForIssueCommentParams
  ): Promise<github.ReactionsCreateForIssueCommentResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/issues/comments/${params.comment_id}/reactions`,
        {
          json: pick(params, 'content')
        }
      )
      .json<github.ReactionsCreateForIssueCommentResponse>()
  }

  /**
 * > [!NOTE]
> You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`.

Delete a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment).
 */
  @aiFunction({
    name: 'github_reactions_delete_for_issue_comment',
    description: `> [!NOTE]
> You can also specify a repository by \`repository_id\` using the route \`DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id\`.

Delete a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment).`,
    inputSchema: github.ReactionsDeleteForIssueCommentParamsSchema,
    tags: ['reactions']
  })
  async reactionsDeleteForIssueComment(
    params: github.ReactionsDeleteForIssueCommentParams
  ): Promise<github.ReactionsDeleteForIssueCommentResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/issues/comments/${params.comment_id}/reactions/${params.reaction_id}`,
        {}
      )
      .json<github.ReactionsDeleteForIssueCommentResponse>()
  }

  /**
   * Lists events for a repository.
   */
  @aiFunction({
    name: 'github_issues_list_events_for_repo',
    description: `Lists events for a repository.`,
    inputSchema: github.IssuesListEventsForRepoParamsSchema,
    tags: ['issues']
  })
  async issuesListEventsForRepo(
    params: github.IssuesListEventsForRepoParams
  ): Promise<github.IssuesListEventsForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/issues/events`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.IssuesListEventsForRepoResponse>()
  }

  /**
   * Gets a single event by the event id.
   */
  @aiFunction({
    name: 'github_issues_get_event',
    description: `Gets a single event by the event id.`,
    inputSchema: github.IssuesGetEventParamsSchema,
    tags: ['issues']
  })
  async issuesGetEvent(
    params: github.IssuesGetEventParams
  ): Promise<github.IssuesGetEventResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/issues/events/${params.event_id}`,
        {}
      )
      .json<github.IssuesGetEventResponse>()
  }

  /**
 * The API returns a [`301 Moved Permanently` status](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api#follow-redirects) if the issue was
[transferred](https://docs.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If
the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API
returns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has read
access, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribe
to the [`issues`](https://docs.github.com/webhooks/event-payloads/#issues) webhook.

> [!NOTE]
> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_issues_get',
    description: `The API returns a [\`301 Moved Permanently\` status](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api#follow-redirects) if the issue was
[transferred](https://docs.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If
the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API
returns a \`404 Not Found\` status. If the issue was deleted from a repository where the authenticated user has read
access, the API returns a \`410 Gone\` status. To receive webhook events for transferred and deleted issues, subscribe
to the [\`issues\`](https://docs.github.com/webhooks/event-payloads/#issues) webhook.

> [!NOTE]
> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.IssuesGetParamsSchema,
    tags: ['issues']
  })
  async issuesGet(
    params: github.IssuesGetParams
  ): Promise<github.IssuesGetResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}`,
        {}
      )
      .json<github.IssuesGetResponse>()
  }

  /**
 * Issue owners and users with push access or Triage role can edit an issue.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_issues_update',
    description: `Issue owners and users with push access or Triage role can edit an issue.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.IssuesUpdateParamsSchema,
    tags: ['issues']
  })
  async issuesUpdate(
    params: github.IssuesUpdateParams
  ): Promise<github.IssuesUpdateResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}`,
        {
          json: pick(
            params,
            'title',
            'body',
            'assignee',
            'state',
            'state_reason',
            'milestone',
            'labels',
            'assignees',
            'type'
          )
        }
      )
      .json<github.IssuesUpdateResponse>()
  }

  /**
   * Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced.
   */
  @aiFunction({
    name: 'github_issues_add_assignees',
    description: `Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced.`,
    inputSchema: github.IssuesAddAssigneesParamsSchema,
    tags: ['issues']
  })
  async issuesAddAssignees(
    params: github.IssuesAddAssigneesParams
  ): Promise<github.IssuesAddAssigneesResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/assignees`,
        {
          json: pick(params, 'assignees')
        }
      )
      .json<github.IssuesAddAssigneesResponse>()
  }

  /**
   * Removes one or more assignees from an issue.
   */
  @aiFunction({
    name: 'github_issues_remove_assignees',
    description: `Removes one or more assignees from an issue.`,
    inputSchema: github.IssuesRemoveAssigneesParamsSchema,
    tags: ['issues']
  })
  async issuesRemoveAssignees(
    params: github.IssuesRemoveAssigneesParams
  ): Promise<github.IssuesRemoveAssigneesResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/assignees`,
        {
          json: pick(params, 'assignees')
        }
      )
      .json<github.IssuesRemoveAssigneesResponse>()
  }

  /**
 * Checks if a user has permission to be assigned to a specific issue.

If the `assignee` can be assigned to this issue, a `204` status code with no content is returned.

Otherwise a `404` status code is returned.
 */
  @aiFunction({
    name: 'github_issues_check_user_can_be_assigned_to_issue',
    description: `Checks if a user has permission to be assigned to a specific issue.

If the \`assignee\` can be assigned to this issue, a \`204\` status code with no content is returned.

Otherwise a \`404\` status code is returned.`,
    inputSchema: github.IssuesCheckUserCanBeAssignedToIssueParamsSchema,
    tags: ['issues']
  })
  async issuesCheckUserCanBeAssignedToIssue(
    params: github.IssuesCheckUserCanBeAssignedToIssueParams
  ): Promise<github.IssuesCheckUserCanBeAssignedToIssueResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/assignees/${params.assignee}`,
        {}
      )
      .json<github.IssuesCheckUserCanBeAssignedToIssueResponse>()
  }

  /**
 * You can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

Issue comments are ordered by ascending ID.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_issues_list_comments',
    description: `You can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

Issue comments are ordered by ascending ID.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.IssuesListCommentsParamsSchema,
    tags: ['issues']
  })
  async issuesListComments(
    params: github.IssuesListCommentsParams
  ): Promise<github.IssuesListCommentsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/comments`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'since', 'per_page', 'page')
          )
        }
      )
      .json<github.IssuesListCommentsResponse>()
  }

  /**
 * You can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications).
Creating content too quickly using this endpoint may result in secondary rate limiting.
For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_issues_create_comment',
    description: `You can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications).
Creating content too quickly using this endpoint may result in secondary rate limiting.
For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.IssuesCreateCommentParamsSchema,
    tags: ['issues']
  })
  async issuesCreateComment(
    params: github.IssuesCreateCommentParams
  ): Promise<github.IssuesCreateCommentResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/comments`,
        {
          json: pick(params, 'body')
        }
      )
      .json<github.IssuesCreateCommentResponse>()
  }

  /**
   * Lists all events for an issue.
   */
  @aiFunction({
    name: 'github_issues_list_events',
    description: `Lists all events for an issue.`,
    inputSchema: github.IssuesListEventsParamsSchema,
    tags: ['issues']
  })
  async issuesListEvents(
    params: github.IssuesListEventsParams
  ): Promise<github.IssuesListEventsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/events`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.IssuesListEventsResponse>()
  }

  /**
   * Lists all labels for an issue.
   */
  @aiFunction({
    name: 'github_issues_list_labels_on_issue',
    description: `Lists all labels for an issue.`,
    inputSchema: github.IssuesListLabelsOnIssueParamsSchema,
    tags: ['issues']
  })
  async issuesListLabelsOnIssue(
    params: github.IssuesListLabelsOnIssueParams
  ): Promise<github.IssuesListLabelsOnIssueResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/labels`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.IssuesListLabelsOnIssueResponse>()
  }

  /**
   * Adds labels to an issue. If you provide an empty array of labels, all labels are removed from the issue. .
   */
  @aiFunction({
    name: 'github_issues_add_labels',
    description: `Adds labels to an issue. If you provide an empty array of labels, all labels are removed from the issue. .`,
    // TODO: Improve handling of union params
    inputSchema: github.IssuesAddLabelsParamsSchema as any,
    tags: ['issues']
  })
  async issuesAddLabels(
    params: github.IssuesAddLabelsParams
  ): Promise<github.IssuesAddLabelsResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/labels`,
        {
          json: params
        }
      )
      .json<github.IssuesAddLabelsResponse>()
  }

  /**
   * Removes any previous labels and sets the new labels for an issue.
   */
  @aiFunction({
    name: 'github_issues_set_labels',
    description: `Removes any previous labels and sets the new labels for an issue.`,
    // TODO: Improve handling of union params
    inputSchema: github.IssuesSetLabelsParamsSchema as any,
    tags: ['issues']
  })
  async issuesSetLabels(
    params: github.IssuesSetLabelsParams
  ): Promise<github.IssuesSetLabelsResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/labels`,
        {
          json: params
        }
      )
      .json<github.IssuesSetLabelsResponse>()
  }

  /**
   * Removes all labels from an issue.
   */
  @aiFunction({
    name: 'github_issues_remove_all_labels',
    description: `Removes all labels from an issue.`,
    inputSchema: github.IssuesRemoveAllLabelsParamsSchema,
    tags: ['issues']
  })
  async issuesRemoveAllLabels(
    params: github.IssuesRemoveAllLabelsParams
  ): Promise<github.IssuesRemoveAllLabelsResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/labels`,
        {}
      )
      .json<github.IssuesRemoveAllLabelsResponse>()
  }

  /**
   * Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist.
   */
  @aiFunction({
    name: 'github_issues_remove_label',
    description: `Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a \`404 Not Found\` status if the label does not exist.`,
    inputSchema: github.IssuesRemoveLabelParamsSchema,
    tags: ['issues']
  })
  async issuesRemoveLabel(
    params: github.IssuesRemoveLabelParams
  ): Promise<github.IssuesRemoveLabelResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/labels/${params.name}`,
        {}
      )
      .json<github.IssuesRemoveLabelResponse>()
  }

  /**
 * Users with push access can lock an issue or pull request's conversation.

Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method).".
 */
  @aiFunction({
    name: 'github_issues_lock',
    description: `Users with push access can lock an issue or pull request's conversation.

Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method).".`,
    inputSchema: github.IssuesLockParamsSchema,
    tags: ['issues']
  })
  async issuesLock(
    params: github.IssuesLockParams
  ): Promise<github.IssuesLockResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/lock`,
        {
          json: pick(params, 'lock_reason')
        }
      )
      .json<github.IssuesLockResponse>()
  }

  /**
   * Users with push access can unlock an issue's conversation.
   */
  @aiFunction({
    name: 'github_issues_unlock',
    description: `Users with push access can unlock an issue's conversation.`,
    inputSchema: github.IssuesUnlockParamsSchema,
    tags: ['issues']
  })
  async issuesUnlock(
    params: github.IssuesUnlockParams
  ): Promise<github.IssuesUnlockResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/lock`,
        {}
      )
      .json<github.IssuesUnlockResponse>()
  }

  /**
   * List the reactions to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue).
   */
  @aiFunction({
    name: 'github_reactions_list_for_issue',
    description: `List the reactions to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue).`,
    inputSchema: github.ReactionsListForIssueParamsSchema,
    tags: ['reactions']
  })
  async reactionsListForIssue(
    params: github.ReactionsListForIssueParams
  ): Promise<github.ReactionsListForIssueResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/reactions`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'content', 'per_page', 'page')
          )
        }
      )
      .json<github.ReactionsListForIssueResponse>()
  }

  /**
   * Create a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). A response with an HTTP `200` status means that you already added the reaction type to this issue.
   */
  @aiFunction({
    name: 'github_reactions_create_for_issue',
    description: `Create a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue). A response with an HTTP \`200\` status means that you already added the reaction type to this issue.`,
    inputSchema: github.ReactionsCreateForIssueParamsSchema,
    tags: ['reactions']
  })
  async reactionsCreateForIssue(
    params: github.ReactionsCreateForIssueParams
  ): Promise<github.ReactionsCreateForIssueResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/reactions`,
        {
          json: pick(params, 'content')
        }
      )
      .json<github.ReactionsCreateForIssueResponse>()
  }

  /**
 * > [!NOTE]
> You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`.

Delete a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue).
 */
  @aiFunction({
    name: 'github_reactions_delete_for_issue',
    description: `> [!NOTE]
> You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id\`.

Delete a reaction to an [issue](https://docs.github.com/rest/issues/issues#get-an-issue).`,
    inputSchema: github.ReactionsDeleteForIssueParamsSchema,
    tags: ['reactions']
  })
  async reactionsDeleteForIssue(
    params: github.ReactionsDeleteForIssueParams
  ): Promise<github.ReactionsDeleteForIssueResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/reactions/${params.reaction_id}`,
        {}
      )
      .json<github.ReactionsDeleteForIssueResponse>()
  }

  /**
 * You can use the REST API to remove a sub-issue from an issue.
Removing content too quickly using this endpoint may result in secondary rate limiting.
For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."
This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."
- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass a specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_issues_remove_sub_issue',
    description: `You can use the REST API to remove a sub-issue from an issue.
Removing content too quickly using this endpoint may result in secondary rate limiting.
For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."
This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."
- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass a specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.IssuesRemoveSubIssueParamsSchema,
    tags: ['issues']
  })
  async issuesRemoveSubIssue(
    params: github.IssuesRemoveSubIssueParams
  ): Promise<github.IssuesRemoveSubIssueResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/sub_issue`,
        {
          json: pick(params, 'sub_issue_id')
        }
      )
      .json<github.IssuesRemoveSubIssueResponse>()
  }

  /**
 * You can use the REST API to list the sub-issues on an issue.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_issues_list_sub_issues',
    description: `You can use the REST API to list the sub-issues on an issue.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.IssuesListSubIssuesParamsSchema,
    tags: ['issues']
  })
  async issuesListSubIssues(
    params: github.IssuesListSubIssuesParams
  ): Promise<github.IssuesListSubIssuesResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/sub_issues`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.IssuesListSubIssuesResponse>()
  }

  /**
 * You can use the REST API to add sub-issues to issues.

Creating content too quickly using this endpoint may result in secondary rate limiting.
For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_issues_add_sub_issue',
    description: `You can use the REST API to add sub-issues to issues.

Creating content too quickly using this endpoint may result in secondary rate limiting.
For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.IssuesAddSubIssueParamsSchema,
    tags: ['issues']
  })
  async issuesAddSubIssue(
    params: github.IssuesAddSubIssueParams
  ): Promise<github.IssuesAddSubIssueResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/sub_issues`,
        {
          json: pick(params, 'sub_issue_id', 'replace_parent')
        }
      )
      .json<github.IssuesAddSubIssueResponse>()
  }

  /**
   * You can use the REST API to reprioritize a sub-issue to a different position in the parent list.
   */
  @aiFunction({
    name: 'github_issues_reprioritize_sub_issue',
    description: `You can use the REST API to reprioritize a sub-issue to a different position in the parent list.`,
    inputSchema: github.IssuesReprioritizeSubIssueParamsSchema,
    tags: ['issues']
  })
  async issuesReprioritizeSubIssue(
    params: github.IssuesReprioritizeSubIssueParams
  ): Promise<github.IssuesReprioritizeSubIssueResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/sub_issues/priority`,
        {
          json: pick(params, 'sub_issue_id', 'after_id', 'before_id')
        }
      )
      .json<github.IssuesReprioritizeSubIssueResponse>()
  }

  /**
   * List all timeline events for an issue.
   */
  @aiFunction({
    name: 'github_issues_list_events_for_timeline',
    description: `List all timeline events for an issue.`,
    inputSchema: github.IssuesListEventsForTimelineParamsSchema,
    tags: ['issues']
  })
  async issuesListEventsForTimeline(
    params: github.IssuesListEventsForTimelineParams
  ): Promise<github.IssuesListEventsForTimelineResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/issues/${params.issue_number}/timeline`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.IssuesListEventsForTimelineResponse>()
  }

  /**
   * List deploy keys.
   */
  @aiFunction({
    name: 'github_repos_list_deploy_keys',
    description: `List deploy keys.`,
    inputSchema: github.ReposListDeployKeysParamsSchema,
    tags: ['repos']
  })
  async reposListDeployKeys(
    params: github.ReposListDeployKeysParams
  ): Promise<github.ReposListDeployKeysResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/keys`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ReposListDeployKeysResponse>()
  }

  /**
   * You can create a read-only deploy key.
   */
  @aiFunction({
    name: 'github_repos_create_deploy_key',
    description: `You can create a read-only deploy key.`,
    inputSchema: github.ReposCreateDeployKeyParamsSchema,
    tags: ['repos']
  })
  async reposCreateDeployKey(
    params: github.ReposCreateDeployKeyParams
  ): Promise<github.ReposCreateDeployKeyResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/keys`, {
        json: pick(params, 'title', 'key', 'read_only')
      })
      .json<github.ReposCreateDeployKeyResponse>()
  }

  /**
   * Get a deploy key.
   */
  @aiFunction({
    name: 'github_repos_get_deploy_key',
    description: `Get a deploy key.`,
    inputSchema: github.ReposGetDeployKeyParamsSchema,
    tags: ['repos']
  })
  async reposGetDeployKey(
    params: github.ReposGetDeployKeyParams
  ): Promise<github.ReposGetDeployKeyResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/keys/${params.key_id}`,
        {}
      )
      .json<github.ReposGetDeployKeyResponse>()
  }

  /**
   * Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.
   */
  @aiFunction({
    name: 'github_repos_delete_deploy_key',
    description: `Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.`,
    inputSchema: github.ReposDeleteDeployKeyParamsSchema,
    tags: ['repos']
  })
  async reposDeleteDeployKey(
    params: github.ReposDeleteDeployKeyParams
  ): Promise<github.ReposDeleteDeployKeyResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/keys/${params.key_id}`,
        {}
      )
      .json<github.ReposDeleteDeployKeyResponse>()
  }

  /**
   * Lists all labels for a repository.
   */
  @aiFunction({
    name: 'github_issues_list_labels_for_repo',
    description: `Lists all labels for a repository.`,
    inputSchema: github.IssuesListLabelsForRepoParamsSchema,
    tags: ['issues']
  })
  async issuesListLabelsForRepo(
    params: github.IssuesListLabelsForRepoParams
  ): Promise<github.IssuesListLabelsForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/labels`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.IssuesListLabelsForRepoResponse>()
  }

  /**
   * Creates a label for the specified repository with the given name and color. The name and color parameters are required. The color must be a valid [hexadecimal color code](http://www.color-hex.com/).
   */
  @aiFunction({
    name: 'github_issues_create_label',
    description: `Creates a label for the specified repository with the given name and color. The name and color parameters are required. The color must be a valid [hexadecimal color code](http://www.color-hex.com/).`,
    inputSchema: github.IssuesCreateLabelParamsSchema,
    tags: ['issues']
  })
  async issuesCreateLabel(
    params: github.IssuesCreateLabelParams
  ): Promise<github.IssuesCreateLabelResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/labels`, {
        json: pick(params, 'name', 'color', 'description')
      })
      .json<github.IssuesCreateLabelResponse>()
  }

  /**
   * Gets a label using the given name.
   */
  @aiFunction({
    name: 'github_issues_get_label',
    description: `Gets a label using the given name.`,
    inputSchema: github.IssuesGetLabelParamsSchema,
    tags: ['issues']
  })
  async issuesGetLabel(
    params: github.IssuesGetLabelParams
  ): Promise<github.IssuesGetLabelResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/labels/${params.name}`,
        {}
      )
      .json<github.IssuesGetLabelResponse>()
  }

  /**
   * Deletes a label using the given label name.
   */
  @aiFunction({
    name: 'github_issues_delete_label',
    description: `Deletes a label using the given label name.`,
    inputSchema: github.IssuesDeleteLabelParamsSchema,
    tags: ['issues']
  })
  async issuesDeleteLabel(
    params: github.IssuesDeleteLabelParams
  ): Promise<github.IssuesDeleteLabelResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/labels/${params.name}`,
        {}
      )
      .json<github.IssuesDeleteLabelResponse>()
  }

  /**
   * Updates a label using the given label name.
   */
  @aiFunction({
    name: 'github_issues_update_label',
    description: `Updates a label using the given label name.`,
    inputSchema: github.IssuesUpdateLabelParamsSchema,
    tags: ['issues']
  })
  async issuesUpdateLabel(
    params: github.IssuesUpdateLabelParams
  ): Promise<github.IssuesUpdateLabelResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/labels/${params.name}`,
        {
          json: pick(params, 'new_name', 'color', 'description')
        }
      )
      .json<github.IssuesUpdateLabelResponse>()
  }

  /**
   * Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language.
   */
  @aiFunction({
    name: 'github_repos_list_languages',
    description: `Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language.`,
    inputSchema: github.ReposListLanguagesParamsSchema,
    tags: ['repos']
  })
  async reposListLanguages(
    params: github.ReposListLanguagesParams
  ): Promise<github.ReposListLanguagesResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/languages`, {})
      .json<github.ReposListLanguagesResponse>()
  }

  /**
 * This method returns the contents of the repository's license file, if one is detected.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw contents of the license.
- **`application/vnd.github.html+json`**: Returns the license contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).
 */
  @aiFunction({
    name: 'github_licenses_get_for_repo',
    description: `This method returns the contents of the repository's license file, if one is detected.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw contents of the license.
- **\`application/vnd.github.html+json\`**: Returns the license contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).`,
    inputSchema: github.LicensesGetForRepoParamsSchema,
    tags: ['licenses']
  })
  async licensesGetForRepo(
    params: github.LicensesGetForRepoParams
  ): Promise<github.LicensesGetForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/license`, {
        searchParams: sanitizeSearchParams(pick(params, 'ref'))
      })
      .json<github.LicensesGetForRepoResponse>()
  }

  /**
   * Sync a branch of a forked repository to keep it up-to-date with the upstream repository.
   */
  @aiFunction({
    name: 'github_repos_merge_upstream',
    description: `Sync a branch of a forked repository to keep it up-to-date with the upstream repository.`,
    inputSchema: github.ReposMergeUpstreamParamsSchema,
    tags: ['repos']
  })
  async reposMergeUpstream(
    params: github.ReposMergeUpstreamParams
  ): Promise<github.ReposMergeUpstreamResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/merge-upstream`, {
        json: pick(params, 'branch')
      })
      .json<github.ReposMergeUpstreamResponse>()
  }

  /**
   * Merge a branch.
   */
  @aiFunction({
    name: 'github_repos_merge',
    description: `Merge a branch.`,
    inputSchema: github.ReposMergeParamsSchema,
    tags: ['repos']
  })
  async reposMerge(
    params: github.ReposMergeParams
  ): Promise<github.ReposMergeResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/merges`, {
        json: pick(params, 'base', 'head', 'commit_message')
      })
      .json<github.ReposMergeResponse>()
  }

  /**
   * Lists milestones for a repository.
   */
  @aiFunction({
    name: 'github_issues_list_milestones',
    description: `Lists milestones for a repository.`,
    inputSchema: github.IssuesListMilestonesParamsSchema,
    tags: ['issues']
  })
  async issuesListMilestones(
    params: github.IssuesListMilestonesParams
  ): Promise<github.IssuesListMilestonesResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/milestones`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'state', 'sort', 'direction', 'per_page', 'page')
        )
      })
      .json<github.IssuesListMilestonesResponse>()
  }

  /**
   * Creates a milestone.
   */
  @aiFunction({
    name: 'github_issues_create_milestone',
    description: `Creates a milestone.`,
    inputSchema: github.IssuesCreateMilestoneParamsSchema,
    tags: ['issues']
  })
  async issuesCreateMilestone(
    params: github.IssuesCreateMilestoneParams
  ): Promise<github.IssuesCreateMilestoneResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/milestones`, {
        json: pick(params, 'title', 'state', 'description', 'due_on')
      })
      .json<github.IssuesCreateMilestoneResponse>()
  }

  /**
   * Gets a milestone using the given milestone number.
   */
  @aiFunction({
    name: 'github_issues_get_milestone',
    description: `Gets a milestone using the given milestone number.`,
    inputSchema: github.IssuesGetMilestoneParamsSchema,
    tags: ['issues']
  })
  async issuesGetMilestone(
    params: github.IssuesGetMilestoneParams
  ): Promise<github.IssuesGetMilestoneResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/milestones/${params.milestone_number}`,
        {}
      )
      .json<github.IssuesGetMilestoneResponse>()
  }

  /**
   * Deletes a milestone using the given milestone number.
   */
  @aiFunction({
    name: 'github_issues_delete_milestone',
    description: `Deletes a milestone using the given milestone number.`,
    inputSchema: github.IssuesDeleteMilestoneParamsSchema,
    tags: ['issues']
  })
  async issuesDeleteMilestone(
    params: github.IssuesDeleteMilestoneParams
  ): Promise<github.IssuesDeleteMilestoneResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/milestones/${params.milestone_number}`,
        {}
      )
      .json<github.IssuesDeleteMilestoneResponse>()
  }

  /**
   * Update a milestone.
   */
  @aiFunction({
    name: 'github_issues_update_milestone',
    description: `Update a milestone.`,
    inputSchema: github.IssuesUpdateMilestoneParamsSchema,
    tags: ['issues']
  })
  async issuesUpdateMilestone(
    params: github.IssuesUpdateMilestoneParams
  ): Promise<github.IssuesUpdateMilestoneResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/milestones/${params.milestone_number}`,
        {
          json: pick(params, 'title', 'state', 'description', 'due_on')
        }
      )
      .json<github.IssuesUpdateMilestoneResponse>()
  }

  /**
   * Lists labels for issues in a milestone.
   */
  @aiFunction({
    name: 'github_issues_list_labels_for_milestone',
    description: `Lists labels for issues in a milestone.`,
    inputSchema: github.IssuesListLabelsForMilestoneParamsSchema,
    tags: ['issues']
  })
  async issuesListLabelsForMilestone(
    params: github.IssuesListLabelsForMilestoneParams
  ): Promise<github.IssuesListLabelsForMilestoneResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/milestones/${params.milestone_number}/labels`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.IssuesListLabelsForMilestoneResponse>()
  }

  /**
   * Lists all notifications for the current user in the specified repository.
   */
  @aiFunction({
    name: 'github_activity_list_repo_notifications_for_authenticated_user',
    description: `Lists all notifications for the current user in the specified repository.`,
    inputSchema:
      github.ActivityListRepoNotificationsForAuthenticatedUserParamsSchema,
    tags: ['activity']
  })
  async activityListRepoNotificationsForAuthenticatedUser(
    params: github.ActivityListRepoNotificationsForAuthenticatedUserParams
  ): Promise<github.ActivityListRepoNotificationsForAuthenticatedUserResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/notifications`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'all',
            'participating',
            'since',
            'before',
            'per_page',
            'page'
          )
        )
      })
      .json<github.ActivityListRepoNotificationsForAuthenticatedUserResponse>()
  }

  /**
   * Marks all notifications in a repository as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`.
   */
  @aiFunction({
    name: 'github_activity_mark_repo_notifications_as_read',
    description: `Marks all notifications in a repository as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a \`202 Accepted\` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter \`all=false\`.`,
    inputSchema: github.ActivityMarkRepoNotificationsAsReadParamsSchema,
    tags: ['activity']
  })
  async activityMarkRepoNotificationsAsRead(
    params: github.ActivityMarkRepoNotificationsAsReadParams
  ): Promise<github.ActivityMarkRepoNotificationsAsReadResponse> {
    return this.ky
      .put(`/repos/${params.owner}/${params.repo}/notifications`, {
        json: pick(params, 'last_read_at')
      })
      .json<github.ActivityMarkRepoNotificationsAsReadResponse>()
  }

  /**
 * Gets information about a GitHub Pages site.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_get_pages',
    description: `Gets information about a GitHub Pages site.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposGetPagesParamsSchema,
    tags: ['repos']
  })
  async reposGetPages(
    params: github.ReposGetPagesParams
  ): Promise<github.ReposGetPagesResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/pages`, {})
      .json<github.ReposGetPagesResponse>()
  }

  /**
 * Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)."

The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_create_pages_site',
    description: `Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)."

The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    // TODO: Improve handling of union params
    inputSchema: github.ReposCreatePagesSiteParamsSchema as any,
    tags: ['repos']
  })
  async reposCreatePagesSite(
    params: github.ReposCreatePagesSiteParams
  ): Promise<github.ReposCreatePagesSiteResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/pages`, {
        json: params
      })
      .json<github.ReposCreatePagesSiteResponse>()
  }

  /**
 * Updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages).

The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_update_information_about_pages_site',
    description: `Updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages).

The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    // TODO: Improve handling of union params
    inputSchema: github.ReposUpdateInformationAboutPagesSiteParamsSchema as any,
    tags: ['repos']
  })
  async reposUpdateInformationAboutPagesSite(
    params: github.ReposUpdateInformationAboutPagesSiteParams
  ): Promise<github.ReposUpdateInformationAboutPagesSiteResponse> {
    return this.ky
      .put(`/repos/${params.owner}/${params.repo}/pages`, {
        json: params
      })
      .json<github.ReposUpdateInformationAboutPagesSiteResponse>()
  }

  /**
 * Deletes a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages).

The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_delete_pages_site',
    description: `Deletes a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages).

The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposDeletePagesSiteParamsSchema,
    tags: ['repos']
  })
  async reposDeletePagesSite(
    params: github.ReposDeletePagesSiteParams
  ): Promise<github.ReposDeletePagesSiteResponse> {
    return this.ky
      .delete(`/repos/${params.owner}/${params.repo}/pages`, {})
      .json<github.ReposDeletePagesSiteResponse>()
  }

  /**
 * Lists builts of a GitHub Pages site.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_list_pages_builds',
    description: `Lists builts of a GitHub Pages site.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposListPagesBuildsParamsSchema,
    tags: ['repos']
  })
  async reposListPagesBuilds(
    params: github.ReposListPagesBuildsParams
  ): Promise<github.ReposListPagesBuildsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/pages/builds`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ReposListPagesBuildsResponse>()
  }

  /**
 * You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.

Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes.
 */
  @aiFunction({
    name: 'github_repos_request_pages_build',
    description: `You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.

Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes.`,
    inputSchema: github.ReposRequestPagesBuildParamsSchema,
    tags: ['repos']
  })
  async reposRequestPagesBuild(
    params: github.ReposRequestPagesBuildParams
  ): Promise<github.ReposRequestPagesBuildResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/pages/builds`, {})
      .json<github.ReposRequestPagesBuildResponse>()
  }

  /**
 * Gets information about the single most recent build of a GitHub Pages site.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_get_latest_pages_build',
    description: `Gets information about the single most recent build of a GitHub Pages site.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposGetLatestPagesBuildParamsSchema,
    tags: ['repos']
  })
  async reposGetLatestPagesBuild(
    params: github.ReposGetLatestPagesBuildParams
  ): Promise<github.ReposGetLatestPagesBuildResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/pages/builds/latest`,
        {}
      )
      .json<github.ReposGetLatestPagesBuildResponse>()
  }

  /**
 * Gets information about a GitHub Pages build.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_get_pages_build',
    description: `Gets information about a GitHub Pages build.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposGetPagesBuildParamsSchema,
    tags: ['repos']
  })
  async reposGetPagesBuild(
    params: github.ReposGetPagesBuildParams
  ): Promise<github.ReposGetPagesBuildResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/pages/builds/${params.build_id}`,
        {}
      )
      .json<github.ReposGetPagesBuildResponse>()
  }

  /**
 * Create a GitHub Pages deployment for a repository.

The authenticated user must have write permission to the repository.
 */
  @aiFunction({
    name: 'github_repos_create_pages_deployment',
    description: `Create a GitHub Pages deployment for a repository.

The authenticated user must have write permission to the repository.`,
    inputSchema: github.ReposCreatePagesDeploymentParamsSchema,
    tags: ['repos']
  })
  async reposCreatePagesDeployment(
    params: github.ReposCreatePagesDeploymentParams
  ): Promise<github.ReposCreatePagesDeploymentResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/pages/deployments`, {
        json: pick(
          params,
          'artifact_id',
          'artifact_url',
          'environment',
          'pages_build_version',
          'oidc_token'
        )
      })
      .json<github.ReposCreatePagesDeploymentResponse>()
  }

  /**
 * Gets the current status of a GitHub Pages deployment.

The authenticated user must have read permission for the GitHub Pages site.
 */
  @aiFunction({
    name: 'github_repos_get_pages_deployment',
    description: `Gets the current status of a GitHub Pages deployment.

The authenticated user must have read permission for the GitHub Pages site.`,
    inputSchema: github.ReposGetPagesDeploymentParamsSchema,
    tags: ['repos']
  })
  async reposGetPagesDeployment(
    params: github.ReposGetPagesDeploymentParams
  ): Promise<github.ReposGetPagesDeploymentResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/pages/deployments/${params.pages_deployment_id}`,
        {}
      )
      .json<github.ReposGetPagesDeploymentResponse>()
  }

  /**
 * Cancels a GitHub Pages deployment.

The authenticated user must have write permissions for the GitHub Pages site.
 */
  @aiFunction({
    name: 'github_repos_cancel_pages_deployment',
    description: `Cancels a GitHub Pages deployment.

The authenticated user must have write permissions for the GitHub Pages site.`,
    inputSchema: github.ReposCancelPagesDeploymentParamsSchema,
    tags: ['repos']
  })
  async reposCancelPagesDeployment(
    params: github.ReposCancelPagesDeploymentParams
  ): Promise<github.ReposCancelPagesDeploymentResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/pages/deployments/${params.pages_deployment_id}/cancel`,
        {}
      )
      .json<github.ReposCancelPagesDeploymentResponse>()
  }

  /**
 * Gets a health check of the DNS settings for the `CNAME` record configured for a repository's GitHub Pages.

The first request to this endpoint returns a `202 Accepted` status and starts an asynchronous background task to get the results for the domain. After the background task completes, subsequent requests to this endpoint return a `200 OK` status with the health check results in the response.

The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_get_pages_health_check',
    description: `Gets a health check of the DNS settings for the \`CNAME\` record configured for a repository's GitHub Pages.

The first request to this endpoint returns a \`202 Accepted\` status and starts an asynchronous background task to get the results for the domain. After the background task completes, subsequent requests to this endpoint return a \`200 OK\` status with the health check results in the response.

The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.ReposGetPagesHealthCheckParamsSchema,
    tags: ['repos']
  })
  async reposGetPagesHealthCheck(
    params: github.ReposGetPagesHealthCheckParams
  ): Promise<github.ReposGetPagesHealthCheckResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/pages/health`, {})
      .json<github.ReposGetPagesHealthCheckResponse>()
  }

  /**
   * Returns a boolean indicating whether or not private vulnerability reporting is enabled for the repository. For more information, see "[Evaluating the security settings of a repository](https://docs.github.com/code-security/security-advisories/working-with-repository-security-advisories/evaluating-the-security-settings-of-a-repository)".
   */
  @aiFunction({
    name: 'github_repos_check_private_vulnerability_reporting',
    description: `Returns a boolean indicating whether or not private vulnerability reporting is enabled for the repository. For more information, see "[Evaluating the security settings of a repository](https://docs.github.com/code-security/security-advisories/working-with-repository-security-advisories/evaluating-the-security-settings-of-a-repository)".`,
    inputSchema: github.ReposCheckPrivateVulnerabilityReportingParamsSchema,
    tags: ['repos']
  })
  async reposCheckPrivateVulnerabilityReporting(
    params: github.ReposCheckPrivateVulnerabilityReportingParams
  ): Promise<github.ReposCheckPrivateVulnerabilityReportingResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/private-vulnerability-reporting`,
        {}
      )
      .json<github.ReposCheckPrivateVulnerabilityReportingResponse>()
  }

  /**
   * Enables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability).".
   */
  @aiFunction({
    name: 'github_repos_enable_private_vulnerability_reporting',
    description: `Enables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability).".`,
    inputSchema: github.ReposEnablePrivateVulnerabilityReportingParamsSchema,
    tags: ['repos']
  })
  async reposEnablePrivateVulnerabilityReporting(
    params: github.ReposEnablePrivateVulnerabilityReportingParams
  ): Promise<github.ReposEnablePrivateVulnerabilityReportingResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/private-vulnerability-reporting`,
        {}
      )
      .json<github.ReposEnablePrivateVulnerabilityReportingResponse>()
  }

  /**
   * Disables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)".
   */
  @aiFunction({
    name: 'github_repos_disable_private_vulnerability_reporting',
    description: `Disables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)".`,
    inputSchema: github.ReposDisablePrivateVulnerabilityReportingParamsSchema,
    tags: ['repos']
  })
  async reposDisablePrivateVulnerabilityReporting(
    params: github.ReposDisablePrivateVulnerabilityReportingParams
  ): Promise<github.ReposDisablePrivateVulnerabilityReportingResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/private-vulnerability-reporting`,
        {}
      )
      .json<github.ReposDisablePrivateVulnerabilityReportingResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_list_for_repo',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsListForRepoParamsSchema,
    tags: ['projects']
  })
  async projectsListForRepo(
    params: github.ProjectsListForRepoParams
  ): Promise<github.ProjectsListForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/projects`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'state', 'per_page', 'page')
        )
      })
      .json<github.ProjectsListForRepoResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_create_for_repo',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsCreateForRepoParamsSchema,
    tags: ['projects']
  })
  async projectsCreateForRepo(
    params: github.ProjectsCreateForRepoParams
  ): Promise<github.ProjectsCreateForRepoResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/projects`, {
        json: pick(params, 'name', 'body')
      })
      .json<github.ProjectsCreateForRepoResponse>()
  }

  /**
 * Gets all custom property values that are set for a repository.
Users with read access to the repository can use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_get_custom_properties_values',
    description: `Gets all custom property values that are set for a repository.
Users with read access to the repository can use this endpoint.`,
    inputSchema: github.ReposGetCustomPropertiesValuesParamsSchema,
    tags: ['repos']
  })
  async reposGetCustomPropertiesValues(
    params: github.ReposGetCustomPropertiesValuesParams
  ): Promise<github.ReposGetCustomPropertiesValuesResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/properties/values`, {})
      .json<github.ReposGetCustomPropertiesValuesResponse>()
  }

  /**
 * Create new or update existing custom property values for a repository.
Using a value of `null` for a custom property will remove or 'unset' the property value from the repository.

Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint.
 */
  @aiFunction({
    name: 'github_repos_create_or_update_custom_properties_values',
    description: `Create new or update existing custom property values for a repository.
Using a value of \`null\` for a custom property will remove or 'unset' the property value from the repository.

Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint.`,
    inputSchema: github.ReposCreateOrUpdateCustomPropertiesValuesParamsSchema,
    tags: ['repos']
  })
  async reposCreateOrUpdateCustomPropertiesValues(
    params: github.ReposCreateOrUpdateCustomPropertiesValuesParams
  ): Promise<github.ReposCreateOrUpdateCustomPropertiesValuesResponse> {
    return this.ky
      .patch(`/repos/${params.owner}/${params.repo}/properties/values`, {
        json: pick(params, 'properties')
      })
      .json<github.ReposCreateOrUpdateCustomPropertiesValuesResponse>()
  }

  /**
 * Lists pull requests in a specified repository.

Draft pull requests are available in public repositories with GitHub
Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing
plans, and in public and private repositories with GitHub Team and GitHub Enterprise
Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)
in the GitHub Help documentation.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_list',
    description: `Lists pull requests in a specified repository.

Draft pull requests are available in public repositories with GitHub
Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing
plans, and in public and private repositories with GitHub Team and GitHub Enterprise
Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)
in the GitHub Help documentation.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsListParamsSchema,
    tags: ['pulls']
  })
  async pullsList(
    params: github.PullsListParams
  ): Promise<github.PullsListResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/pulls`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'state',
            'head',
            'base',
            'sort',
            'direction',
            'per_page',
            'page'
          )
        )
      })
      .json<github.PullsListResponse>()
  }

  /**
 * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_create',
    description: `Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsCreateParamsSchema,
    tags: ['pulls']
  })
  async pullsCreate(
    params: github.PullsCreateParams
  ): Promise<github.PullsCreateResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/pulls`, {
        json: pick(
          params,
          'title',
          'head',
          'head_repo',
          'base',
          'body',
          'maintainer_can_modify',
          'draft',
          'issue'
        )
      })
      .json<github.PullsCreateResponse>()
  }

  /**
 * Lists review comments for all pull requests in a repository. By default,
review comments are in ascending order by ID.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_list_review_comments_for_repo',
    description: `Lists review comments for all pull requests in a repository. By default,
review comments are in ascending order by ID.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsListReviewCommentsForRepoParamsSchema,
    tags: ['pulls']
  })
  async pullsListReviewCommentsForRepo(
    params: github.PullsListReviewCommentsForRepoParams
  ): Promise<github.PullsListReviewCommentsForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/pulls/comments`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'sort', 'direction', 'since', 'per_page', 'page')
        )
      })
      .json<github.PullsListReviewCommentsForRepoResponse>()
  }

  /**
 * Provides details for a specified review comment.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_get_review_comment',
    description: `Provides details for a specified review comment.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsGetReviewCommentParamsSchema,
    tags: ['pulls']
  })
  async pullsGetReviewComment(
    params: github.PullsGetReviewCommentParams
  ): Promise<github.PullsGetReviewCommentResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/pulls/comments/${params.comment_id}`,
        {}
      )
      .json<github.PullsGetReviewCommentResponse>()
  }

  /**
   * Deletes a review comment.
   */
  @aiFunction({
    name: 'github_pulls_delete_review_comment',
    description: `Deletes a review comment.`,
    inputSchema: github.PullsDeleteReviewCommentParamsSchema,
    tags: ['pulls']
  })
  async pullsDeleteReviewComment(
    params: github.PullsDeleteReviewCommentParams
  ): Promise<github.PullsDeleteReviewCommentResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/pulls/comments/${params.comment_id}`,
        {}
      )
      .json<github.PullsDeleteReviewCommentResponse>()
  }

  /**
 * Edits the content of a specified review comment.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_update_review_comment',
    description: `Edits the content of a specified review comment.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsUpdateReviewCommentParamsSchema,
    tags: ['pulls']
  })
  async pullsUpdateReviewComment(
    params: github.PullsUpdateReviewCommentParams
  ): Promise<github.PullsUpdateReviewCommentResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/pulls/comments/${params.comment_id}`,
        {
          json: pick(params, 'body')
        }
      )
      .json<github.PullsUpdateReviewCommentResponse>()
  }

  /**
   * List the reactions to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request).
   */
  @aiFunction({
    name: 'github_reactions_list_for_pull_request_review_comment',
    description: `List the reactions to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request).`,
    inputSchema: github.ReactionsListForPullRequestReviewCommentParamsSchema,
    tags: ['reactions']
  })
  async reactionsListForPullRequestReviewComment(
    params: github.ReactionsListForPullRequestReviewCommentParams
  ): Promise<github.ReactionsListForPullRequestReviewCommentResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/pulls/comments/${params.comment_id}/reactions`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'content', 'per_page', 'page')
          )
        }
      )
      .json<github.ReactionsListForPullRequestReviewCommentResponse>()
  }

  /**
   * Create a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). A response with an HTTP `200` status means that you already added the reaction type to this pull request review comment.
   */
  @aiFunction({
    name: 'github_reactions_create_for_pull_request_review_comment',
    description: `Create a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request). A response with an HTTP \`200\` status means that you already added the reaction type to this pull request review comment.`,
    inputSchema: github.ReactionsCreateForPullRequestReviewCommentParamsSchema,
    tags: ['reactions']
  })
  async reactionsCreateForPullRequestReviewComment(
    params: github.ReactionsCreateForPullRequestReviewCommentParams
  ): Promise<github.ReactionsCreateForPullRequestReviewCommentResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/pulls/comments/${params.comment_id}/reactions`,
        {
          json: pick(params, 'content')
        }
      )
      .json<github.ReactionsCreateForPullRequestReviewCommentResponse>()
  }

  /**
 * > [!NOTE]
> You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.`

Delete a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request).
 */
  @aiFunction({
    name: 'github_reactions_delete_for_pull_request_comment',
    description: `> [!NOTE]
> You can also specify a repository by \`repository_id\` using the route \`DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.\`

Delete a reaction to a [pull request review comment](https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request).`,
    inputSchema: github.ReactionsDeleteForPullRequestCommentParamsSchema,
    tags: ['reactions']
  })
  async reactionsDeleteForPullRequestComment(
    params: github.ReactionsDeleteForPullRequestCommentParams
  ): Promise<github.ReactionsDeleteForPullRequestCommentResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/pulls/comments/${params.comment_id}/reactions/${params.reaction_id}`,
        {}
      )
      .json<github.ReactionsDeleteForPullRequestCommentResponse>()
  }

  /**
 * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Lists details of a pull request by providing its number.

When you get, [create](https://docs.github.com/rest/pulls/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/pulls/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the `mergeable` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".

The value of the `mergeable` attribute can be `true`, `false`, or `null`. If the value is `null`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-`null` value for the `mergeable` attribute in the response. If `mergeable` is `true`, then `merge_commit_sha` will be the SHA of the _test_ merge commit.

The value of the `merge_commit_sha` attribute changes depending on the state of the pull request. Before merging a pull request, the `merge_commit_sha` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the `merge_commit_sha` attribute changes depending on how you merged the pull request:

*   If merged as a [merge commit](https://docs.github.com/articles/about-merge-methods-on-github/), `merge_commit_sha` represents the SHA of the merge commit.
*   If merged via a [squash](https://docs.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), `merge_commit_sha` represents the SHA of the squashed commit on the base branch.
*   If [rebased](https://docs.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), `merge_commit_sha` represents the commit that the base branch was updated to.

Pass the appropriate [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types) to fetch diff and patch formats.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
- **`application/vnd.github.diff`**: For more information, see "[git-diff](https://git-scm.com/docs/git-diff)" in the Git documentation. If a diff is corrupt, contact us through the [GitHub Support portal](https://support.github.com/). Include the repository name and pull request ID in your message.
 */
  @aiFunction({
    name: 'github_pulls_get',
    description: `Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Lists details of a pull request by providing its number.

When you get, [create](https://docs.github.com/rest/pulls/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/pulls/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the \`mergeable\` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".

The value of the \`mergeable\` attribute can be \`true\`, \`false\`, or \`null\`. If the value is \`null\`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-\`null\` value for the \`mergeable\` attribute in the response. If \`mergeable\` is \`true\`, then \`merge_commit_sha\` will be the SHA of the _test_ merge commit.

The value of the \`merge_commit_sha\` attribute changes depending on the state of the pull request. Before merging a pull request, the \`merge_commit_sha\` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the \`merge_commit_sha\` attribute changes depending on how you merged the pull request:

*   If merged as a [merge commit](https://docs.github.com/articles/about-merge-methods-on-github/), \`merge_commit_sha\` represents the SHA of the merge commit.
*   If merged via a [squash](https://docs.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), \`merge_commit_sha\` represents the SHA of the squashed commit on the base branch.
*   If [rebased](https://docs.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), \`merge_commit_sha\` represents the commit that the base branch was updated to.

Pass the appropriate [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types) to fetch diff and patch formats.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.
- **\`application/vnd.github.diff\`**: For more information, see "[git-diff](https://git-scm.com/docs/git-diff)" in the Git documentation. If a diff is corrupt, contact us through the [GitHub Support portal](https://support.github.com/). Include the repository name and pull request ID in your message.`,
    inputSchema: github.PullsGetParamsSchema,
    tags: ['pulls']
  })
  async pullsGet(
    params: github.PullsGetParams
  ): Promise<github.PullsGetResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}`,
        {}
      )
      .json<github.PullsGetResponse>()
  }

  /**
 * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_update',
    description: `Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsUpdateParamsSchema,
    tags: ['pulls']
  })
  async pullsUpdate(
    params: github.PullsUpdateParams
  ): Promise<github.PullsUpdateResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}`,
        {
          json: pick(
            params,
            'title',
            'body',
            'state',
            'base',
            'maintainer_can_modify'
          )
        }
      )
      .json<github.PullsUpdateResponse>()
  }

  /**
 * Creates a codespace owned by the authenticated user for the specified pull request.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_create_with_pr_for_authenticated_user',
    description: `Creates a codespace owned by the authenticated user for the specified pull request.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema: github.CodespacesCreateWithPrForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesCreateWithPrForAuthenticatedUser(
    params: github.CodespacesCreateWithPrForAuthenticatedUserParams
  ): Promise<github.CodespacesCreateWithPrForAuthenticatedUserResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/codespaces`,
        {
          json: pick(
            params,
            'location',
            'geo',
            'client_ip',
            'machine',
            'devcontainer_path',
            'multi_repo_permissions_opt_out',
            'working_directory',
            'idle_timeout_minutes',
            'display_name',
            'retention_period_minutes'
          )
        }
      )
      .json<github.CodespacesCreateWithPrForAuthenticatedUserResponse>()
  }

  /**
 * Lists all review comments for a specified pull request. By default, review comments
are in ascending order by ID.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_list_review_comments',
    description: `Lists all review comments for a specified pull request. By default, review comments
are in ascending order by ID.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsListReviewCommentsParamsSchema,
    tags: ['pulls']
  })
  async pullsListReviewComments(
    params: github.PullsListReviewCommentsParams
  ): Promise<github.PullsListReviewCommentsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/comments`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'sort', 'direction', 'since', 'per_page', 'page')
          )
        }
      )
      .json<github.PullsListReviewCommentsResponse>()
  }

  /**
 * Creates a review comment on the diff of a specified pull request. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/issues/comments#create-an-issue-comment)."

If your comment applies to more than one line in the pull request diff, you should use the parameters `line`, `side`, and optionally `start_line` and `start_side` in your request.

The `position` parameter is closing down. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_create_review_comment',
    description: `Creates a review comment on the diff of a specified pull request. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/issues/comments#create-an-issue-comment)."

If your comment applies to more than one line in the pull request diff, you should use the parameters \`line\`, \`side\`, and optionally \`start_line\` and \`start_side\` in your request.

The \`position\` parameter is closing down. If you use \`position\`, the \`line\`, \`side\`, \`start_line\`, and \`start_side\` parameters are not required.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsCreateReviewCommentParamsSchema,
    tags: ['pulls']
  })
  async pullsCreateReviewComment(
    params: github.PullsCreateReviewCommentParams
  ): Promise<github.PullsCreateReviewCommentResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/comments`,
        {
          json: pick(
            params,
            'body',
            'commit_id',
            'path',
            'position',
            'side',
            'line',
            'start_line',
            'start_side',
            'in_reply_to',
            'subject_type'
          )
        }
      )
      .json<github.PullsCreateReviewCommentResponse>()
  }

  /**
 * Creates a reply to a review comment for a pull request. For the `comment_id`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_create_reply_for_review_comment',
    description: `Creates a reply to a review comment for a pull request. For the \`comment_id\`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"
and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsCreateReplyForReviewCommentParamsSchema,
    tags: ['pulls']
  })
  async pullsCreateReplyForReviewComment(
    params: github.PullsCreateReplyForReviewCommentParams
  ): Promise<github.PullsCreateReplyForReviewCommentResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/comments/${params.comment_id}/replies`,
        {
          json: pick(params, 'body')
        }
      )
      .json<github.PullsCreateReplyForReviewCommentResponse>()
  }

  /**
 * Lists a maximum of 250 commits for a pull request. To receive a complete
commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/commits/commits#list-commits)
endpoint.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_list_commits',
    description: `Lists a maximum of 250 commits for a pull request. To receive a complete
commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/commits/commits#list-commits)
endpoint.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsListCommitsParamsSchema,
    tags: ['pulls']
  })
  async pullsListCommits(
    params: github.PullsListCommitsParams
  ): Promise<github.PullsListCommitsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/commits`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.PullsListCommitsResponse>()
  }

  /**
 * Lists the files in a specified pull request.

> [!NOTE]
> Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_list_files',
    description: `Lists the files in a specified pull request.

> [!NOTE]
> Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsListFilesParamsSchema,
    tags: ['pulls']
  })
  async pullsListFiles(
    params: github.PullsListFilesParams
  ): Promise<github.PullsListFilesResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/files`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.PullsListFilesResponse>()
  }

  /**
   * Checks if a pull request has been merged into the base branch. The HTTP status of the response indicates whether or not the pull request has been merged; the response body is empty.
   */
  @aiFunction({
    name: 'github_pulls_check_if_merged',
    description: `Checks if a pull request has been merged into the base branch. The HTTP status of the response indicates whether or not the pull request has been merged; the response body is empty.`,
    inputSchema: github.PullsCheckIfMergedParamsSchema,
    tags: ['pulls']
  })
  async pullsCheckIfMerged(
    params: github.PullsCheckIfMergedParams
  ): Promise<github.PullsCheckIfMergedResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/merge`,
        {}
      )
      .json<github.PullsCheckIfMergedResponse>()
  }

  /**
 * Merges a pull request into the base branch.
This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api).".
 */
  @aiFunction({
    name: 'github_pulls_merge',
    description: `Merges a pull request into the base branch.
This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api).".`,
    inputSchema: github.PullsMergeParamsSchema,
    tags: ['pulls']
  })
  async pullsMerge(
    params: github.PullsMergeParams
  ): Promise<github.PullsMergeResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/merge`,
        {
          json: pick(
            params,
            'commit_title',
            'commit_message',
            'sha',
            'merge_method'
          )
        }
      )
      .json<github.PullsMergeResponse>()
  }

  /**
   * Gets the users or teams whose review is requested for a pull request. Once a requested reviewer submits a review, they are no longer considered a requested reviewer. Their review will instead be returned by the [List reviews for a pull request](https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request) operation.
   */
  @aiFunction({
    name: 'github_pulls_list_requested_reviewers',
    description: `Gets the users or teams whose review is requested for a pull request. Once a requested reviewer submits a review, they are no longer considered a requested reviewer. Their review will instead be returned by the [List reviews for a pull request](https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request) operation.`,
    inputSchema: github.PullsListRequestedReviewersParamsSchema,
    tags: ['pulls']
  })
  async pullsListRequestedReviewers(
    params: github.PullsListRequestedReviewersParams
  ): Promise<github.PullsListRequestedReviewersResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/requested_reviewers`,
        {}
      )
      .json<github.PullsListRequestedReviewersResponse>()
  }

  /**
 * Requests reviews for a pull request from a given set of users and/or teams.
This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api).".
 */
  @aiFunction({
    name: 'github_pulls_request_reviewers',
    description: `Requests reviews for a pull request from a given set of users and/or teams.
This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api).".`,
    // TODO: Improve handling of union params
    inputSchema: github.PullsRequestReviewersParamsSchema as any,
    tags: ['pulls']
  })
  async pullsRequestReviewers(
    params: github.PullsRequestReviewersParams
  ): Promise<github.PullsRequestReviewersResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/requested_reviewers`,
        {
          json: params
        }
      )
      .json<github.PullsRequestReviewersResponse>()
  }

  /**
   * Removes review requests from a pull request for a given set of users and/or teams.
   */
  @aiFunction({
    name: 'github_pulls_remove_requested_reviewers',
    description: `Removes review requests from a pull request for a given set of users and/or teams.`,
    inputSchema: github.PullsRemoveRequestedReviewersParamsSchema,
    tags: ['pulls']
  })
  async pullsRemoveRequestedReviewers(
    params: github.PullsRemoveRequestedReviewersParams
  ): Promise<github.PullsRemoveRequestedReviewersResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/requested_reviewers`,
        {
          json: pick(params, 'reviewers', 'team_reviewers')
        }
      )
      .json<github.PullsRemoveRequestedReviewersResponse>()
  }

  /**
 * Lists all reviews for a specified pull request. The list of reviews returns in chronological order.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_list_reviews',
    description: `Lists all reviews for a specified pull request. The list of reviews returns in chronological order.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsListReviewsParamsSchema,
    tags: ['pulls']
  })
  async pullsListReviews(
    params: github.PullsListReviewsParams
  ): Promise<github.PullsListReviewsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/reviews`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.PullsListReviewsResponse>()
  }

  /**
 * Creates a review on a specified pull request.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

Pull request reviews created in the `PENDING` state are not submitted and therefore do not include the `submitted_at` property in the response. To create a pending review for a pull request, leave the `event` parameter blank. For more information about submitting a `PENDING` review, see "[Submit a review for a pull request](https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request)."

> [!NOTE]
> To comment on a specific line in a file, you need to first determine the position of that line in the diff. To see a pull request diff, add the `application/vnd.github.v3.diff` media type to the `Accept` header of a call to the [Get a pull request](https://docs.github.com/rest/pulls/pulls#get-a-pull-request) endpoint.

The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_create_review',
    description: `Creates a review on a specified pull request.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

Pull request reviews created in the \`PENDING\` state are not submitted and therefore do not include the \`submitted_at\` property in the response. To create a pending review for a pull request, leave the \`event\` parameter blank. For more information about submitting a \`PENDING\` review, see "[Submit a review for a pull request](https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request)."

> [!NOTE]
> To comment on a specific line in a file, you need to first determine the position of that line in the diff. To see a pull request diff, add the \`application/vnd.github.v3.diff\` media type to the \`Accept\` header of a call to the [Get a pull request](https://docs.github.com/rest/pulls/pulls#get-a-pull-request) endpoint.

The \`position\` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsCreateReviewParamsSchema,
    tags: ['pulls']
  })
  async pullsCreateReview(
    params: github.PullsCreateReviewParams
  ): Promise<github.PullsCreateReviewResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/reviews`,
        {
          json: pick(params, 'commit_id', 'body', 'event', 'comments')
        }
      )
      .json<github.PullsCreateReviewResponse>()
  }

  /**
 * Retrieves a pull request review by its ID.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_get_review',
    description: `Retrieves a pull request review by its ID.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsGetReviewParamsSchema,
    tags: ['pulls']
  })
  async pullsGetReview(
    params: github.PullsGetReviewParams
  ): Promise<github.PullsGetReviewResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/reviews/${params.review_id}`,
        {}
      )
      .json<github.PullsGetReviewResponse>()
  }

  /**
 * Updates the contents of a specified review summary comment.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_update_review',
    description: `Updates the contents of a specified review summary comment.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsUpdateReviewParamsSchema,
    tags: ['pulls']
  })
  async pullsUpdateReview(
    params: github.PullsUpdateReviewParams
  ): Promise<github.PullsUpdateReviewResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/reviews/${params.review_id}`,
        {
          json: pick(params, 'body')
        }
      )
      .json<github.PullsUpdateReviewResponse>()
  }

  /**
 * Deletes a pull request review that has not been submitted. Submitted reviews cannot be deleted.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_delete_pending_review',
    description: `Deletes a pull request review that has not been submitted. Submitted reviews cannot be deleted.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsDeletePendingReviewParamsSchema,
    tags: ['pulls']
  })
  async pullsDeletePendingReview(
    params: github.PullsDeletePendingReviewParams
  ): Promise<github.PullsDeletePendingReviewResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/reviews/${params.review_id}`,
        {}
      )
      .json<github.PullsDeletePendingReviewResponse>()
  }

  /**
 * Lists comments for a specific pull request review.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_list_comments_for_review',
    description: `Lists comments for a specific pull request review.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsListCommentsForReviewParamsSchema,
    tags: ['pulls']
  })
  async pullsListCommentsForReview(
    params: github.PullsListCommentsForReviewParams
  ): Promise<github.PullsListCommentsForReviewResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/reviews/${params.review_id}/comments`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.PullsListCommentsForReviewResponse>()
  }

  /**
 * Dismisses a specified review on a pull request.

> [!NOTE]
> To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/branches/branch-protection), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_dismiss_review',
    description: `Dismisses a specified review on a pull request.

> [!NOTE]
> To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/branches/branch-protection), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsDismissReviewParamsSchema,
    tags: ['pulls']
  })
  async pullsDismissReview(
    params: github.PullsDismissReviewParams
  ): Promise<github.PullsDismissReviewResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/reviews/${params.review_id}/dismissals`,
        {
          json: pick(params, 'message', 'event')
        }
      )
      .json<github.PullsDismissReviewResponse>()
  }

  /**
 * Submits a pending review for a pull request. For more information about creating a pending review for a pull request, see "[Create a review for a pull request](https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_pulls_submit_review',
    description: `Submits a pending review for a pull request. For more information about creating a pending review for a pull request, see "[Create a review for a pull request](https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request)."

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github-commitcomment.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github-commitcomment.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github-commitcomment.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github-commitcomment.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.PullsSubmitReviewParamsSchema,
    tags: ['pulls']
  })
  async pullsSubmitReview(
    params: github.PullsSubmitReviewParams
  ): Promise<github.PullsSubmitReviewResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/reviews/${params.review_id}/events`,
        {
          json: pick(params, 'body', 'event')
        }
      )
      .json<github.PullsSubmitReviewResponse>()
  }

  /**
 * Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch.
Note: If making a request on behalf of a GitHub App you must also have permissions to write the contents of the head repository.
 */
  @aiFunction({
    name: 'github_pulls_update_branch',
    description: `Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch.
Note: If making a request on behalf of a GitHub App you must also have permissions to write the contents of the head repository.`,
    inputSchema: github.PullsUpdateBranchParamsSchema,
    tags: ['pulls']
  })
  async pullsUpdateBranch(
    params: github.PullsUpdateBranchParams
  ): Promise<github.PullsUpdateBranchResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}/update-branch`,
        {
          json: pick(params, 'expected_head_sha')
        }
      )
      .json<github.PullsUpdateBranchResponse>()
  }

  /**
 * Gets the preferred README for a repository.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type.
- **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).
 */
  @aiFunction({
    name: 'github_repos_get_readme',
    description: `Gets the preferred README for a repository.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw file contents. This is the default if you do not specify a media type.
- **\`application/vnd.github.html+json\`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).`,
    inputSchema: github.ReposGetReadmeParamsSchema,
    tags: ['repos']
  })
  async reposGetReadme(
    params: github.ReposGetReadmeParams
  ): Promise<github.ReposGetReadmeResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/readme`, {
        searchParams: sanitizeSearchParams(pick(params, 'ref'))
      })
      .json<github.ReposGetReadmeResponse>()
  }

  /**
 * Gets the README from a repository directory.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type.
- **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).
 */
  @aiFunction({
    name: 'github_repos_get_readme_in_directory',
    description: `Gets the README from a repository directory.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw file contents. This is the default if you do not specify a media type.
- **\`application/vnd.github.html+json\`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).`,
    inputSchema: github.ReposGetReadmeInDirectoryParamsSchema,
    tags: ['repos']
  })
  async reposGetReadmeInDirectory(
    params: github.ReposGetReadmeInDirectoryParams
  ): Promise<github.ReposGetReadmeInDirectoryResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/readme/${params.dir}`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'ref'))
        }
      )
      .json<github.ReposGetReadmeInDirectoryResponse>()
  }

  /**
 * This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/repos/repos#list-repository-tags).

Information about published releases are available to everyone. Only users with push access will receive listings for draft releases.
 */
  @aiFunction({
    name: 'github_repos_list_releases',
    description: `This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/repos/repos#list-repository-tags).

Information about published releases are available to everyone. Only users with push access will receive listings for draft releases.`,
    inputSchema: github.ReposListReleasesParamsSchema,
    tags: ['repos']
  })
  async reposListReleases(
    params: github.ReposListReleasesParams
  ): Promise<github.ReposListReleasesResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/releases`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ReposListReleasesResponse>()
  }

  /**
 * Users with push access to the repository can create a release.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api).".
 */
  @aiFunction({
    name: 'github_repos_create_release',
    description: `Users with push access to the repository can create a release.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api).".`,
    inputSchema: github.ReposCreateReleaseParamsSchema,
    tags: ['repos']
  })
  async reposCreateRelease(
    params: github.ReposCreateReleaseParams
  ): Promise<github.ReposCreateReleaseResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/releases`, {
        json: pick(
          params,
          'tag_name',
          'target_commitish',
          'name',
          'body',
          'draft',
          'prerelease',
          'discussion_category_name',
          'generate_release_notes',
          'make_latest'
        )
      })
      .json<github.ReposCreateReleaseResponse>()
  }

  /**
 * To download the asset's binary content:

- If within a browser, fetch the location specified in the `browser_download_url` key provided in the response.
- Alternatively, set the `Accept` header of the request to
  [`application/octet-stream`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).
  The API will either redirect the client to the location, or stream it directly if possible.
  API clients should handle both a `200` or `302` response.
 */
  @aiFunction({
    name: 'github_repos_get_release_asset',
    description: `To download the asset's binary content:

- If within a browser, fetch the location specified in the \`browser_download_url\` key provided in the response.
- Alternatively, set the \`Accept\` header of the request to
  [\`application/octet-stream\`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).
  The API will either redirect the client to the location, or stream it directly if possible.
  API clients should handle both a \`200\` or \`302\` response.`,
    inputSchema: github.ReposGetReleaseAssetParamsSchema,
    tags: ['repos']
  })
  async reposGetReleaseAsset(
    params: github.ReposGetReleaseAssetParams
  ): Promise<github.ReposGetReleaseAssetResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/releases/assets/${params.asset_id}`,
        {}
      )
      .json<github.ReposGetReleaseAssetResponse>()
  }

  /**
   * Delete a release asset.
   */
  @aiFunction({
    name: 'github_repos_delete_release_asset',
    description: `Delete a release asset.`,
    inputSchema: github.ReposDeleteReleaseAssetParamsSchema,
    tags: ['repos']
  })
  async reposDeleteReleaseAsset(
    params: github.ReposDeleteReleaseAssetParams
  ): Promise<github.ReposDeleteReleaseAssetResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/releases/assets/${params.asset_id}`,
        {}
      )
      .json<github.ReposDeleteReleaseAssetResponse>()
  }

  /**
   * Users with push access to the repository can edit a release asset.
   */
  @aiFunction({
    name: 'github_repos_update_release_asset',
    description: `Users with push access to the repository can edit a release asset.`,
    inputSchema: github.ReposUpdateReleaseAssetParamsSchema,
    tags: ['repos']
  })
  async reposUpdateReleaseAsset(
    params: github.ReposUpdateReleaseAssetParams
  ): Promise<github.ReposUpdateReleaseAssetResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/releases/assets/${params.asset_id}`,
        {
          json: pick(params, 'name', 'label', 'state')
        }
      )
      .json<github.ReposUpdateReleaseAssetResponse>()
  }

  /**
   * Generate a name and body describing a [release](https://docs.github.com/rest/releases/releases#get-a-release). The body content will be markdown formatted and contain information like the changes since last release and users who contributed. The generated release notes are not saved anywhere. They are intended to be generated and used when creating a new release.
   */
  @aiFunction({
    name: 'github_repos_generate_release_notes',
    description: `Generate a name and body describing a [release](https://docs.github.com/rest/releases/releases#get-a-release). The body content will be markdown formatted and contain information like the changes since last release and users who contributed. The generated release notes are not saved anywhere. They are intended to be generated and used when creating a new release.`,
    inputSchema: github.ReposGenerateReleaseNotesParamsSchema,
    tags: ['repos']
  })
  async reposGenerateReleaseNotes(
    params: github.ReposGenerateReleaseNotesParams
  ): Promise<github.ReposGenerateReleaseNotesResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/releases/generate-notes`,
        {
          json: pick(
            params,
            'tag_name',
            'target_commitish',
            'previous_tag_name',
            'configuration_file_path'
          )
        }
      )
      .json<github.ReposGenerateReleaseNotesResponse>()
  }

  /**
 * View the latest published full release for the repository.

The latest release is the most recent non-prerelease, non-draft release, sorted by the `created_at` attribute. The `created_at` attribute is the date of the commit used for the release, and not the date when the release was drafted or published.
 */
  @aiFunction({
    name: 'github_repos_get_latest_release',
    description: `View the latest published full release for the repository.

The latest release is the most recent non-prerelease, non-draft release, sorted by the \`created_at\` attribute. The \`created_at\` attribute is the date of the commit used for the release, and not the date when the release was drafted or published.`,
    inputSchema: github.ReposGetLatestReleaseParamsSchema,
    tags: ['repos']
  })
  async reposGetLatestRelease(
    params: github.ReposGetLatestReleaseParams
  ): Promise<github.ReposGetLatestReleaseResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/releases/latest`, {})
      .json<github.ReposGetLatestReleaseResponse>()
  }

  /**
   * Get a published release with the specified tag.
   */
  @aiFunction({
    name: 'github_repos_get_release_by_tag',
    description: `Get a published release with the specified tag.`,
    inputSchema: github.ReposGetReleaseByTagParamsSchema,
    tags: ['repos']
  })
  async reposGetReleaseByTag(
    params: github.ReposGetReleaseByTagParams
  ): Promise<github.ReposGetReleaseByTagResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/releases/tags/${params.tag}`,
        {}
      )
      .json<github.ReposGetReleaseByTagResponse>()
  }

  /**
 * Gets a public release with the specified release ID.

> [!NOTE]
> This returns an `upload_url` key corresponding to the endpoint for uploading release assets. This key is a hypermedia resource. For more information, see "[Getting started with the REST API](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia).".
 */
  @aiFunction({
    name: 'github_repos_get_release',
    description: `Gets a public release with the specified release ID.

> [!NOTE]
> This returns an \`upload_url\` key corresponding to the endpoint for uploading release assets. This key is a hypermedia resource. For more information, see "[Getting started with the REST API](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia).".`,
    inputSchema: github.ReposGetReleaseParamsSchema,
    tags: ['repos']
  })
  async reposGetRelease(
    params: github.ReposGetReleaseParams
  ): Promise<github.ReposGetReleaseResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/releases/${params.release_id}`,
        {}
      )
      .json<github.ReposGetReleaseResponse>()
  }

  /**
   * Users with push access to the repository can delete a release.
   */
  @aiFunction({
    name: 'github_repos_delete_release',
    description: `Users with push access to the repository can delete a release.`,
    inputSchema: github.ReposDeleteReleaseParamsSchema,
    tags: ['repos']
  })
  async reposDeleteRelease(
    params: github.ReposDeleteReleaseParams
  ): Promise<github.ReposDeleteReleaseResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/releases/${params.release_id}`,
        {}
      )
      .json<github.ReposDeleteReleaseResponse>()
  }

  /**
   * Users with push access to the repository can edit a release.
   */
  @aiFunction({
    name: 'github_repos_update_release',
    description: `Users with push access to the repository can edit a release.`,
    inputSchema: github.ReposUpdateReleaseParamsSchema,
    tags: ['repos']
  })
  async reposUpdateRelease(
    params: github.ReposUpdateReleaseParams
  ): Promise<github.ReposUpdateReleaseResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/releases/${params.release_id}`,
        {
          json: pick(
            params,
            'tag_name',
            'target_commitish',
            'name',
            'body',
            'draft',
            'prerelease',
            'make_latest',
            'discussion_category_name'
          )
        }
      )
      .json<github.ReposUpdateReleaseResponse>()
  }

  /**
   * List release assets.
   */
  @aiFunction({
    name: 'github_repos_list_release_assets',
    description: `List release assets.`,
    inputSchema: github.ReposListReleaseAssetsParamsSchema,
    tags: ['repos']
  })
  async reposListReleaseAssets(
    params: github.ReposListReleaseAssetsParams
  ): Promise<github.ReposListReleaseAssetsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/releases/${params.release_id}/assets`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ReposListReleaseAssetsResponse>()
  }

  /**
 * This endpoint makes use of a [Hypermedia relation](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned in
the response of the [Create a release endpoint](https://docs.github.com/rest/releases/releases#create-a-release) to upload a release asset.

You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint.

Most libraries will set the required `Content-Length` header automatically. Use the required `Content-Type` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example:

`application/zip`

GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example,
you'll still need to pass your authentication to be able to upload an asset.

When an upstream failure occurs, you will receive a `502 Bad Gateway` status. This may leave an empty asset with a state of `starter`. It can be safely deleted.

**Notes:**
*   GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List release assets](https://docs.github.com/rest/releases/assets#list-release-assets)"
endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api).
*   To find the `release_id` query the [`GET /repos/{owner}/{repo}/releases/latest` endpoint](https://docs.github.com/rest/releases/releases#get-the-latest-release).
*   If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset.
 */
  @aiFunction({
    name: 'github_repos_upload_release_asset',
    description: `This endpoint makes use of a [Hypermedia relation](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the \`upload_url\` returned in
the response of the [Create a release endpoint](https://docs.github.com/rest/releases/releases#create-a-release) to upload a release asset.

You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint.

Most libraries will set the required \`Content-Length\` header automatically. Use the required \`Content-Type\` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example:

\`application/zip\`

GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example,
you'll still need to pass your authentication to be able to upload an asset.

When an upstream failure occurs, you will receive a \`502 Bad Gateway\` status. This may leave an empty asset with a state of \`starter\`. It can be safely deleted.

**Notes:**
*   GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List release assets](https://docs.github.com/rest/releases/assets#list-release-assets)"
endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact?tags=dotcom-rest-api).
*   To find the \`release_id\` query the [\`GET /repos/{owner}/{repo}/releases/latest\` endpoint](https://docs.github.com/rest/releases/releases#get-the-latest-release).
*   If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset.`,
    inputSchema: github.ReposUploadReleaseAssetParamsSchema,
    tags: ['repos']
  })
  async reposUploadReleaseAsset(
    params: github.ReposUploadReleaseAssetParams
  ): Promise<github.ReposUploadReleaseAssetResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/releases/${params.release_id}/assets`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'name', 'label'))
        }
      )
      .json<github.ReposUploadReleaseAssetResponse>()
  }

  /**
   * List the reactions to a [release](https://docs.github.com/rest/releases/releases#get-a-release).
   */
  @aiFunction({
    name: 'github_reactions_list_for_release',
    description: `List the reactions to a [release](https://docs.github.com/rest/releases/releases#get-a-release).`,
    inputSchema: github.ReactionsListForReleaseParamsSchema,
    tags: ['reactions']
  })
  async reactionsListForRelease(
    params: github.ReactionsListForReleaseParams
  ): Promise<github.ReactionsListForReleaseResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/releases/${params.release_id}/reactions`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'content', 'per_page', 'page')
          )
        }
      )
      .json<github.ReactionsListForReleaseResponse>()
  }

  /**
   * Create a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). A response with a `Status: 200 OK` means that you already added the reaction type to this release.
   */
  @aiFunction({
    name: 'github_reactions_create_for_release',
    description: `Create a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release). A response with a \`Status: 200 OK\` means that you already added the reaction type to this release.`,
    inputSchema: github.ReactionsCreateForReleaseParamsSchema,
    tags: ['reactions']
  })
  async reactionsCreateForRelease(
    params: github.ReactionsCreateForReleaseParams
  ): Promise<github.ReactionsCreateForReleaseResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/releases/${params.release_id}/reactions`,
        {
          json: pick(params, 'content')
        }
      )
      .json<github.ReactionsCreateForReleaseResponse>()
  }

  /**
 * > [!NOTE]
> You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id`.

Delete a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release).
 */
  @aiFunction({
    name: 'github_reactions_delete_for_release',
    description: `> [!NOTE]
> You can also specify a repository by \`repository_id\` using the route \`DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id\`.

Delete a reaction to a [release](https://docs.github.com/rest/releases/releases#get-a-release).`,
    inputSchema: github.ReactionsDeleteForReleaseParamsSchema,
    tags: ['reactions']
  })
  async reactionsDeleteForRelease(
    params: github.ReactionsDeleteForReleaseParams
  ): Promise<github.ReactionsDeleteForReleaseResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/releases/${params.release_id}/reactions/${params.reaction_id}`,
        {}
      )
      .json<github.ReactionsDeleteForReleaseResponse>()
  }

  /**
 * Returns all active rules that apply to the specified branch. The branch does not need to exist; rules that would apply
to a branch with that name will be returned. All active rules that apply will be returned, regardless of the level
at which they are configured (e.g. repository or organization). Rules in rulesets with "evaluate" or "disabled"
enforcement statuses are not returned.
 */
  @aiFunction({
    name: 'github_repos_get_branch_rules',
    description: `Returns all active rules that apply to the specified branch. The branch does not need to exist; rules that would apply
to a branch with that name will be returned. All active rules that apply will be returned, regardless of the level
at which they are configured (e.g. repository or organization). Rules in rulesets with "evaluate" or "disabled"
enforcement statuses are not returned.`,
    inputSchema: github.ReposGetBranchRulesParamsSchema,
    tags: ['repos']
  })
  async reposGetBranchRules(
    params: github.ReposGetBranchRulesParams
  ): Promise<github.ReposGetBranchRulesResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/rules/branches/${params.branch}`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ReposGetBranchRulesResponse>()
  }

  /**
   * Get all the rulesets for a repository.
   */
  @aiFunction({
    name: 'github_repos_get_repo_rulesets',
    description: `Get all the rulesets for a repository.`,
    inputSchema: github.ReposGetRepoRulesetsParamsSchema,
    tags: ['repos']
  })
  async reposGetRepoRulesets(
    params: github.ReposGetRepoRulesetsParams
  ): Promise<github.ReposGetRepoRulesetsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/rulesets`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'per_page', 'page', 'includes_parents', 'targets')
        )
      })
      .json<github.ReposGetRepoRulesetsResponse>()
  }

  /**
   * Create a ruleset for a repository.
   */
  @aiFunction({
    name: 'github_repos_create_repo_ruleset',
    description: `Create a ruleset for a repository.`,
    inputSchema: github.ReposCreateRepoRulesetParamsSchema,
    tags: ['repos']
  })
  async reposCreateRepoRuleset(
    params: github.ReposCreateRepoRulesetParams
  ): Promise<github.ReposCreateRepoRulesetResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/rulesets`, {
        json: pick(
          params,
          'name',
          'target',
          'enforcement',
          'bypass_actors',
          'conditions',
          'rules'
        )
      })
      .json<github.ReposCreateRepoRulesetResponse>()
  }

  /**
 * Lists suites of rule evaluations at the repository level.
For more information, see "[Managing rulesets for a repository](https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets).".
 */
  @aiFunction({
    name: 'github_repos_get_repo_rule_suites',
    description: `Lists suites of rule evaluations at the repository level.
For more information, see "[Managing rulesets for a repository](https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets).".`,
    inputSchema: github.ReposGetRepoRuleSuitesParamsSchema,
    tags: ['repos']
  })
  async reposGetRepoRuleSuites(
    params: github.ReposGetRepoRuleSuitesParams
  ): Promise<github.ReposGetRepoRuleSuitesResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/rulesets/rule-suites`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'ref',
            'time_period',
            'actor_name',
            'rule_suite_result',
            'per_page',
            'page'
          )
        )
      })
      .json<github.ReposGetRepoRuleSuitesResponse>()
  }

  /**
 * Gets information about a suite of rule evaluations from within a repository.
For more information, see "[Managing rulesets for a repository](https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets).".
 */
  @aiFunction({
    name: 'github_repos_get_repo_rule_suite',
    description: `Gets information about a suite of rule evaluations from within a repository.
For more information, see "[Managing rulesets for a repository](https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets).".`,
    inputSchema: github.ReposGetRepoRuleSuiteParamsSchema,
    tags: ['repos']
  })
  async reposGetRepoRuleSuite(
    params: github.ReposGetRepoRuleSuiteParams
  ): Promise<github.ReposGetRepoRuleSuiteResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/rulesets/rule-suites/${params.rule_suite_id}`,
        {}
      )
      .json<github.ReposGetRepoRuleSuiteResponse>()
  }

  /**
 * Get a ruleset for a repository.

**Note:** To prevent leaking sensitive information, the `bypass_actors` property is only returned if the user
making the API request has write access to the ruleset.
 */
  @aiFunction({
    name: 'github_repos_get_repo_ruleset',
    description: `Get a ruleset for a repository.

**Note:** To prevent leaking sensitive information, the \`bypass_actors\` property is only returned if the user
making the API request has write access to the ruleset.`,
    inputSchema: github.ReposGetRepoRulesetParamsSchema,
    tags: ['repos']
  })
  async reposGetRepoRuleset(
    params: github.ReposGetRepoRulesetParams
  ): Promise<github.ReposGetRepoRulesetResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/rulesets/${params.ruleset_id}`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'includes_parents'))
        }
      )
      .json<github.ReposGetRepoRulesetResponse>()
  }

  /**
   * Update a ruleset for a repository.
   */
  @aiFunction({
    name: 'github_repos_update_repo_ruleset',
    description: `Update a ruleset for a repository.`,
    inputSchema: github.ReposUpdateRepoRulesetParamsSchema,
    tags: ['repos']
  })
  async reposUpdateRepoRuleset(
    params: github.ReposUpdateRepoRulesetParams
  ): Promise<github.ReposUpdateRepoRulesetResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/rulesets/${params.ruleset_id}`,
        {
          json: pick(
            params,
            'name',
            'target',
            'enforcement',
            'bypass_actors',
            'conditions',
            'rules'
          )
        }
      )
      .json<github.ReposUpdateRepoRulesetResponse>()
  }

  /**
   * Delete a ruleset for a repository.
   */
  @aiFunction({
    name: 'github_repos_delete_repo_ruleset',
    description: `Delete a ruleset for a repository.`,
    inputSchema: github.ReposDeleteRepoRulesetParamsSchema,
    tags: ['repos']
  })
  async reposDeleteRepoRuleset(
    params: github.ReposDeleteRepoRulesetParams
  ): Promise<github.ReposDeleteRepoRulesetResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/rulesets/${params.ruleset_id}`,
        {}
      )
      .json<github.ReposDeleteRepoRulesetResponse>()
  }

  /**
   * Get the history of a repository ruleset.
   */
  @aiFunction({
    name: 'github_repos_get_repo_ruleset_history',
    description: `Get the history of a repository ruleset.`,
    inputSchema: github.ReposGetRepoRulesetHistoryParamsSchema,
    tags: ['repos']
  })
  async reposGetRepoRulesetHistory(
    params: github.ReposGetRepoRulesetHistoryParams
  ): Promise<github.ReposGetRepoRulesetHistoryResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/rulesets/${params.ruleset_id}/history`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
        }
      )
      .json<github.ReposGetRepoRulesetHistoryResponse>()
  }

  /**
   * Get a version of a repository ruleset.
   */
  @aiFunction({
    name: 'github_repos_get_repo_ruleset_version',
    description: `Get a version of a repository ruleset.`,
    inputSchema: github.ReposGetRepoRulesetVersionParamsSchema,
    tags: ['repos']
  })
  async reposGetRepoRulesetVersion(
    params: github.ReposGetRepoRulesetVersionParams
  ): Promise<github.ReposGetRepoRulesetVersionResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/rulesets/${params.ruleset_id}/history/${params.version_id}`,
        {}
      )
      .json<github.ReposGetRepoRulesetVersionResponse>()
  }

  /**
 * Lists secret scanning alerts for an eligible repository, from newest to oldest.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
 */
  @aiFunction({
    name: 'github_secret_scanning_list_alerts_for_repo',
    description: `Lists secret scanning alerts for an eligible repository, from newest to oldest.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`security_events\` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the \`public_repo\` scope instead.`,
    inputSchema: github.SecretScanningListAlertsForRepoParamsSchema,
    tags: ['secret-scanning']
  })
  async secretScanningListAlertsForRepo(
    params: github.SecretScanningListAlertsForRepoParams
  ): Promise<github.SecretScanningListAlertsForRepoResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/secret-scanning/alerts`,
        {
          searchParams: sanitizeSearchParams(
            pick(
              params,
              'state',
              'secret_type',
              'resolution',
              'sort',
              'direction',
              'page',
              'per_page',
              'before',
              'after',
              'validity',
              'is_publicly_leaked',
              'is_multi_repo'
            )
          )
        }
      )
      .json<github.SecretScanningListAlertsForRepoResponse>()
  }

  /**
 * Gets a single secret scanning alert detected in an eligible repository.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
 */
  @aiFunction({
    name: 'github_secret_scanning_get_alert',
    description: `Gets a single secret scanning alert detected in an eligible repository.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`security_events\` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the \`public_repo\` scope instead.`,
    inputSchema: github.SecretScanningGetAlertParamsSchema,
    tags: ['secret-scanning']
  })
  async secretScanningGetAlert(
    params: github.SecretScanningGetAlertParams
  ): Promise<github.SecretScanningGetAlertResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/secret-scanning/alerts/${params.alert_number}`,
        {}
      )
      .json<github.SecretScanningGetAlertResponse>()
  }

  /**
 * Updates the status of a secret scanning alert in an eligible repository.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
 */
  @aiFunction({
    name: 'github_secret_scanning_update_alert',
    description: `Updates the status of a secret scanning alert in an eligible repository.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`security_events\` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the \`public_repo\` scope instead.`,
    inputSchema: github.SecretScanningUpdateAlertParamsSchema,
    tags: ['secret-scanning']
  })
  async secretScanningUpdateAlert(
    params: github.SecretScanningUpdateAlertParams
  ): Promise<github.SecretScanningUpdateAlertResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/secret-scanning/alerts/${params.alert_number}`,
        {
          json: pick(params, 'state', 'resolution', 'resolution_comment')
        }
      )
      .json<github.SecretScanningUpdateAlertResponse>()
  }

  /**
 * Lists all locations for a given secret scanning alert for an eligible repository.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
 */
  @aiFunction({
    name: 'github_secret_scanning_list_locations_for_alert',
    description: `Lists all locations for a given secret scanning alert for an eligible repository.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`security_events\` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the \`public_repo\` scope instead.`,
    inputSchema: github.SecretScanningListLocationsForAlertParamsSchema,
    tags: ['secret-scanning']
  })
  async secretScanningListLocationsForAlert(
    params: github.SecretScanningListLocationsForAlertParams
  ): Promise<github.SecretScanningListLocationsForAlertResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/secret-scanning/alerts/${params.alert_number}/locations`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'page', 'per_page'))
        }
      )
      .json<github.SecretScanningListLocationsForAlertResponse>()
  }

  /**
 * Creates a bypass for a previously push protected secret.

The authenticated user must be the original author of the committed secret.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_secret_scanning_create_push_protection_bypass',
    description: `Creates a bypass for a previously push protected secret.

The authenticated user must be the original author of the committed secret.

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.SecretScanningCreatePushProtectionBypassParamsSchema,
    tags: ['secret-scanning']
  })
  async secretScanningCreatePushProtectionBypass(
    params: github.SecretScanningCreatePushProtectionBypassParams
  ): Promise<github.SecretScanningCreatePushProtectionBypassResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/secret-scanning/push-protection-bypasses`,
        {
          json: pick(params, 'reason', 'placeholder_id')
        }
      )
      .json<github.SecretScanningCreatePushProtectionBypassResponse>()
  }

  /**
 * Lists the latest default incremental and backfill scans by type for a repository. Scans from Copilot Secret Scanning are not included.

OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.
 */
  @aiFunction({
    name: 'github_secret_scanning_get_scan_history',
    description: `Lists the latest default incremental and backfill scans by type for a repository. Scans from Copilot Secret Scanning are not included.

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`security_events\` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the \`public_repo\` scope instead.`,
    inputSchema: github.SecretScanningGetScanHistoryParamsSchema,
    tags: ['secret-scanning']
  })
  async secretScanningGetScanHistory(
    params: github.SecretScanningGetScanHistoryParams
  ): Promise<github.SecretScanningGetScanHistoryResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/secret-scanning/scan-history`,
        {}
      )
      .json<github.SecretScanningGetScanHistoryResponse>()
  }

  /**
 * Lists security advisories in a repository.

The authenticated user can access unpublished security advisories from a repository if they are a security manager or administrator of that repository, or if they are a collaborator on any security advisory.

OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:read` scope to to get a published security advisory in a private repository, or any unpublished security advisory that the authenticated user has access to.
 */
  @aiFunction({
    name: 'github_security_advisories_list_repository_advisories',
    description: `Lists security advisories in a repository.

The authenticated user can access unpublished security advisories from a repository if they are a security manager or administrator of that repository, or if they are a collaborator on any security advisory.

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`repository_advisories:read\` scope to to get a published security advisory in a private repository, or any unpublished security advisory that the authenticated user has access to.`,
    inputSchema: github.SecurityAdvisoriesListRepositoryAdvisoriesParamsSchema,
    tags: ['security-advisories']
  })
  async securityAdvisoriesListRepositoryAdvisories(
    params: github.SecurityAdvisoriesListRepositoryAdvisoriesParams
  ): Promise<github.SecurityAdvisoriesListRepositoryAdvisoriesResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/security-advisories`, {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'direction',
            'sort',
            'before',
            'after',
            'per_page',
            'state'
          )
        )
      })
      .json<github.SecurityAdvisoriesListRepositoryAdvisoriesResponse>()
  }

  /**
 * Creates a new repository security advisory.

In order to create a draft repository security advisory, the authenticated user must be a security manager or administrator of that repository.

OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_security_advisories_create_repository_advisory',
    description: `Creates a new repository security advisory.

In order to create a draft repository security advisory, the authenticated user must be a security manager or administrator of that repository.

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`repository_advisories:write\` scope to use this endpoint.`,
    inputSchema: github.SecurityAdvisoriesCreateRepositoryAdvisoryParamsSchema,
    tags: ['security-advisories']
  })
  async securityAdvisoriesCreateRepositoryAdvisory(
    params: github.SecurityAdvisoriesCreateRepositoryAdvisoryParams
  ): Promise<github.SecurityAdvisoriesCreateRepositoryAdvisoryResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/security-advisories`, {
        json: pick(
          params,
          'summary',
          'description',
          'cve_id',
          'vulnerabilities',
          'cwe_ids',
          'credits',
          'severity',
          'cvss_vector_string',
          'start_private_fork'
        )
      })
      .json<github.SecurityAdvisoriesCreateRepositoryAdvisoryResponse>()
  }

  /**
 * Report a security vulnerability to the maintainers of the repository.
See "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)" for more information about private vulnerability reporting.
 */
  @aiFunction({
    name: 'github_security_advisories_create_private_vulnerability_report',
    description: `Report a security vulnerability to the maintainers of the repository.
See "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)" for more information about private vulnerability reporting.`,
    inputSchema:
      github.SecurityAdvisoriesCreatePrivateVulnerabilityReportParamsSchema,
    tags: ['security-advisories']
  })
  async securityAdvisoriesCreatePrivateVulnerabilityReport(
    params: github.SecurityAdvisoriesCreatePrivateVulnerabilityReportParams
  ): Promise<github.SecurityAdvisoriesCreatePrivateVulnerabilityReportResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/security-advisories/reports`,
        {
          json: pick(
            params,
            'summary',
            'description',
            'vulnerabilities',
            'cwe_ids',
            'severity',
            'cvss_vector_string',
            'start_private_fork'
          )
        }
      )
      .json<github.SecurityAdvisoriesCreatePrivateVulnerabilityReportResponse>()
  }

  /**
 * Get a repository security advisory using its GitHub Security Advisory (GHSA) identifier.

Anyone can access any published security advisory on a public repository.

The authenticated user can access an unpublished security advisory from a repository if they are a security manager or administrator of that repository, or if they are a
collaborator on the security advisory.

OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:read` scope to to get a published security advisory in a private repository, or any unpublished security advisory that the authenticated user has access to.
 */
  @aiFunction({
    name: 'github_security_advisories_get_repository_advisory',
    description: `Get a repository security advisory using its GitHub Security Advisory (GHSA) identifier.

Anyone can access any published security advisory on a public repository.

The authenticated user can access an unpublished security advisory from a repository if they are a security manager or administrator of that repository, or if they are a
collaborator on the security advisory.

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`repository_advisories:read\` scope to to get a published security advisory in a private repository, or any unpublished security advisory that the authenticated user has access to.`,
    inputSchema: github.SecurityAdvisoriesGetRepositoryAdvisoryParamsSchema,
    tags: ['security-advisories']
  })
  async securityAdvisoriesGetRepositoryAdvisory(
    params: github.SecurityAdvisoriesGetRepositoryAdvisoryParams
  ): Promise<github.SecurityAdvisoriesGetRepositoryAdvisoryResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/security-advisories/${params.ghsa_id}`,
        {}
      )
      .json<github.SecurityAdvisoriesGetRepositoryAdvisoryResponse>()
  }

  /**
 * Update a repository security advisory using its GitHub Security Advisory (GHSA) identifier.

In order to update any security advisory, the authenticated user must be a security manager or administrator of that repository,
or a collaborator on the repository security advisory.

OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_security_advisories_update_repository_advisory',
    description: `Update a repository security advisory using its GitHub Security Advisory (GHSA) identifier.

In order to update any security advisory, the authenticated user must be a security manager or administrator of that repository,
or a collaborator on the repository security advisory.

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`repository_advisories:write\` scope to use this endpoint.`,
    inputSchema: github.SecurityAdvisoriesUpdateRepositoryAdvisoryParamsSchema,
    tags: ['security-advisories']
  })
  async securityAdvisoriesUpdateRepositoryAdvisory(
    params: github.SecurityAdvisoriesUpdateRepositoryAdvisoryParams
  ): Promise<github.SecurityAdvisoriesUpdateRepositoryAdvisoryResponse> {
    return this.ky
      .patch(
        `/repos/${params.owner}/${params.repo}/security-advisories/${params.ghsa_id}`,
        {
          json: pick(
            params,
            'summary',
            'description',
            'cve_id',
            'vulnerabilities',
            'cwe_ids',
            'credits',
            'severity',
            'cvss_vector_string',
            'state',
            'collaborating_users',
            'collaborating_teams'
          )
        }
      )
      .json<github.SecurityAdvisoriesUpdateRepositoryAdvisoryResponse>()
  }

  /**
 * If you want a CVE identification number for the security vulnerability in your project, and don't already have one, you can request a CVE identification number from GitHub. For more information see "[Requesting a CVE identification number](https://docs.github.com/code-security/security-advisories/repository-security-advisories/publishing-a-repository-security-advisory#requesting-a-cve-identification-number-optional)."

You may request a CVE for public repositories, but cannot do so for private repositories.

In order to request a CVE for a repository security advisory, the authenticated user must be a security manager or administrator of that repository.

OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_security_advisories_create_repository_advisory_cve_request',
    description: `If you want a CVE identification number for the security vulnerability in your project, and don't already have one, you can request a CVE identification number from GitHub. For more information see "[Requesting a CVE identification number](https://docs.github.com/code-security/security-advisories/repository-security-advisories/publishing-a-repository-security-advisory#requesting-a-cve-identification-number-optional)."

You may request a CVE for public repositories, but cannot do so for private repositories.

In order to request a CVE for a repository security advisory, the authenticated user must be a security manager or administrator of that repository.

OAuth app tokens and personal access tokens (classic) need the \`repo\` or \`repository_advisories:write\` scope to use this endpoint.`,
    inputSchema:
      github.SecurityAdvisoriesCreateRepositoryAdvisoryCveRequestParamsSchema,
    tags: ['security-advisories']
  })
  async securityAdvisoriesCreateRepositoryAdvisoryCveRequest(
    params: github.SecurityAdvisoriesCreateRepositoryAdvisoryCveRequestParams
  ): Promise<github.SecurityAdvisoriesCreateRepositoryAdvisoryCveRequestResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/security-advisories/${params.ghsa_id}/cve`,
        {}
      )
      .json<github.SecurityAdvisoriesCreateRepositoryAdvisoryCveRequestResponse>()
  }

  /**
 * Create a temporary private fork to collaborate on fixing a security vulnerability in your repository.

> [!NOTE]
> Forking a repository happens asynchronously. You may have to wait up to 5 minutes before you can access the fork.
 */
  @aiFunction({
    name: 'github_security_advisories_create_fork',
    description: `Create a temporary private fork to collaborate on fixing a security vulnerability in your repository.

> [!NOTE]
> Forking a repository happens asynchronously. You may have to wait up to 5 minutes before you can access the fork.`,
    inputSchema: github.SecurityAdvisoriesCreateForkParamsSchema,
    tags: ['security-advisories']
  })
  async securityAdvisoriesCreateFork(
    params: github.SecurityAdvisoriesCreateForkParams
  ): Promise<github.SecurityAdvisoriesCreateForkResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/security-advisories/${params.ghsa_id}/forks`,
        {}
      )
      .json<github.SecurityAdvisoriesCreateForkResponse>()
  }

  /**
 * Lists the people that have starred the repository.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created.
 */
  @aiFunction({
    name: 'github_activity_list_stargazers_for_repo',
    description: `Lists the people that have starred the repository.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.star+json\`**: Includes a timestamp of when the star was created.`,
    inputSchema: github.ActivityListStargazersForRepoParamsSchema,
    tags: ['activity']
  })
  async activityListStargazersForRepo(
    params: github.ActivityListStargazersForRepoParams
  ): Promise<github.ActivityListStargazersForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/stargazers`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActivityListStargazersForRepoResponse>()
  }

  /**
 * Returns a weekly aggregate of the number of additions and deletions pushed to a repository.

> [!NOTE]
> This endpoint can only be used for repositories with fewer than 10,000 commits. If the repository contains 10,000 or more commits, a 422 status code will be returned.
 */
  @aiFunction({
    name: 'github_repos_get_code_frequency_stats',
    description: `Returns a weekly aggregate of the number of additions and deletions pushed to a repository.

> [!NOTE]
> This endpoint can only be used for repositories with fewer than 10,000 commits. If the repository contains 10,000 or more commits, a 422 status code will be returned.`,
    inputSchema: github.ReposGetCodeFrequencyStatsParamsSchema,
    tags: ['repos']
  })
  async reposGetCodeFrequencyStats(
    params: github.ReposGetCodeFrequencyStatsParams
  ): Promise<github.ReposGetCodeFrequencyStatsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/stats/code_frequency`,
        {}
      )
      .json<github.ReposGetCodeFrequencyStatsResponse>()
  }

  /**
   * Returns the last year of commit activity grouped by week. The `days` array is a group of commits per day, starting on `Sunday`.
   */
  @aiFunction({
    name: 'github_repos_get_commit_activity_stats',
    description: `Returns the last year of commit activity grouped by week. The \`days\` array is a group of commits per day, starting on \`Sunday\`.`,
    inputSchema: github.ReposGetCommitActivityStatsParamsSchema,
    tags: ['repos']
  })
  async reposGetCommitActivityStats(
    params: github.ReposGetCommitActivityStatsParams
  ): Promise<github.ReposGetCommitActivityStatsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/stats/commit_activity`,
        {}
      )
      .json<github.ReposGetCommitActivityStatsResponse>()
  }

  /**
 *
Returns the `total` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (`weeks` array) with the following information:

*   `w` - Start of the week, given as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time).
*   `a` - Number of additions
*   `d` - Number of deletions
*   `c` - Number of commits

> [!NOTE]
> This endpoint will return `0` values for all addition and deletion counts in repositories with 10,000 or more commits.
 */
  @aiFunction({
    name: 'github_repos_get_contributors_stats',
    description: `
Returns the \`total\` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (\`weeks\` array) with the following information:

*   \`w\` - Start of the week, given as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time).
*   \`a\` - Number of additions
*   \`d\` - Number of deletions
*   \`c\` - Number of commits

> [!NOTE]
> This endpoint will return \`0\` values for all addition and deletion counts in repositories with 10,000 or more commits.`,
    inputSchema: github.ReposGetContributorsStatsParamsSchema,
    tags: ['repos']
  })
  async reposGetContributorsStats(
    params: github.ReposGetContributorsStatsParams
  ): Promise<github.ReposGetContributorsStatsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/stats/contributors`, {})
      .json<github.ReposGetContributorsStatsResponse>()
  }

  /**
 * Returns the total commit counts for the `owner` and total commit counts in `all`. `all` is everyone combined, including the `owner` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract `owner` from `all`.

The array order is oldest week (index 0) to most recent week.

The most recent week is seven days ago at UTC midnight to today at UTC midnight.
 */
  @aiFunction({
    name: 'github_repos_get_participation_stats',
    description: `Returns the total commit counts for the \`owner\` and total commit counts in \`all\`. \`all\` is everyone combined, including the \`owner\` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract \`owner\` from \`all\`.

The array order is oldest week (index 0) to most recent week.

The most recent week is seven days ago at UTC midnight to today at UTC midnight.`,
    inputSchema: github.ReposGetParticipationStatsParamsSchema,
    tags: ['repos']
  })
  async reposGetParticipationStats(
    params: github.ReposGetParticipationStatsParams
  ): Promise<github.ReposGetParticipationStatsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/stats/participation`,
        {}
      )
      .json<github.ReposGetParticipationStatsResponse>()
  }

  /**
 * Each array contains the day number, hour number, and number of commits:

*   `0-6`: Sunday - Saturday
*   `0-23`: Hour of day
*   Number of commits

For example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits.
 */
  @aiFunction({
    name: 'github_repos_get_punch_card_stats',
    description: `Each array contains the day number, hour number, and number of commits:

*   \`0-6\`: Sunday - Saturday
*   \`0-23\`: Hour of day
*   Number of commits

For example, \`[2, 14, 25]\` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits.`,
    inputSchema: github.ReposGetPunchCardStatsParamsSchema,
    tags: ['repos']
  })
  async reposGetPunchCardStats(
    params: github.ReposGetPunchCardStatsParams
  ): Promise<github.ReposGetPunchCardStatsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/stats/punch_card`, {})
      .json<github.ReposGetPunchCardStatsResponse>()
  }

  /**
 * Users with push access in a repository can create commit statuses for a given SHA.

Note: there is a limit of 1000 statuses per `sha` and `context` within a repository. Attempts to create more than 1000 statuses will result in a validation error.
 */
  @aiFunction({
    name: 'github_repos_create_commit_status',
    description: `Users with push access in a repository can create commit statuses for a given SHA.

Note: there is a limit of 1000 statuses per \`sha\` and \`context\` within a repository. Attempts to create more than 1000 statuses will result in a validation error.`,
    inputSchema: github.ReposCreateCommitStatusParamsSchema,
    tags: ['repos']
  })
  async reposCreateCommitStatus(
    params: github.ReposCreateCommitStatusParams
  ): Promise<github.ReposCreateCommitStatusResponse> {
    return this.ky
      .post(
        `/repos/${params.owner}/${params.repo}/statuses/${params.sha}`,
        {
          json: pick(params, 'state', 'target_url', 'description', 'context')
        }
      )
      .json<github.ReposCreateCommitStatusResponse>()
  }

  /**
   * Lists the people watching the specified repository.
   */
  @aiFunction({
    name: 'github_activity_list_watchers_for_repo',
    description: `Lists the people watching the specified repository.`,
    inputSchema: github.ActivityListWatchersForRepoParamsSchema,
    tags: ['activity']
  })
  async activityListWatchersForRepo(
    params: github.ActivityListWatchersForRepoParams
  ): Promise<github.ActivityListWatchersForRepoResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/subscribers`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActivityListWatchersForRepoResponse>()
  }

  /**
   * Gets information about whether the authenticated user is subscribed to the repository.
   */
  @aiFunction({
    name: 'github_activity_get_repo_subscription',
    description: `Gets information about whether the authenticated user is subscribed to the repository.`,
    inputSchema: github.ActivityGetRepoSubscriptionParamsSchema,
    tags: ['activity']
  })
  async activityGetRepoSubscription(
    params: github.ActivityGetRepoSubscriptionParams
  ): Promise<github.ActivityGetRepoSubscriptionResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/subscription`, {})
      .json<github.ActivityGetRepoSubscriptionResponse>()
  }

  /**
   * If you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/activity/watching#delete-a-repository-subscription) completely.
   */
  @aiFunction({
    name: 'github_activity_set_repo_subscription',
    description: `If you would like to watch a repository, set \`subscribed\` to \`true\`. If you would like to ignore notifications made within a repository, set \`ignored\` to \`true\`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/activity/watching#delete-a-repository-subscription) completely.`,
    inputSchema: github.ActivitySetRepoSubscriptionParamsSchema,
    tags: ['activity']
  })
  async activitySetRepoSubscription(
    params: github.ActivitySetRepoSubscriptionParams
  ): Promise<github.ActivitySetRepoSubscriptionResponse> {
    return this.ky
      .put(`/repos/${params.owner}/${params.repo}/subscription`, {
        json: pick(params, 'subscribed', 'ignored')
      })
      .json<github.ActivitySetRepoSubscriptionResponse>()
  }

  /**
   * This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/activity/watching#set-a-repository-subscription).
   */
  @aiFunction({
    name: 'github_activity_delete_repo_subscription',
    description: `This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/activity/watching#set-a-repository-subscription).`,
    inputSchema: github.ActivityDeleteRepoSubscriptionParamsSchema,
    tags: ['activity']
  })
  async activityDeleteRepoSubscription(
    params: github.ActivityDeleteRepoSubscriptionParams
  ): Promise<github.ActivityDeleteRepoSubscriptionResponse> {
    return this.ky
      .delete(`/repos/${params.owner}/${params.repo}/subscription`, {})
      .json<github.ActivityDeleteRepoSubscriptionResponse>()
  }

  /**
   * List repository tags.
   */
  @aiFunction({
    name: 'github_repos_list_tags',
    description: `List repository tags.`,
    inputSchema: github.ReposListTagsParamsSchema,
    tags: ['repos']
  })
  async reposListTags(
    params: github.ReposListTagsParams
  ): Promise<github.ReposListTagsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/tags`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ReposListTagsResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead.

This returns the tag protection states of a repository.

This information is only available to repository administrators.
 */
  @aiFunction({
    name: 'github_repos_list_tag_protection',
    description: `> [!WARNING]
> **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#get-all-repository-rulesets)" endpoint instead.

This returns the tag protection states of a repository.

This information is only available to repository administrators.`,
    inputSchema: github.ReposListTagProtectionParamsSchema,
    tags: ['repos']
  })
  async reposListTagProtection(
    params: github.ReposListTagProtectionParams
  ): Promise<github.ReposListTagProtectionResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/tags/protection`, {})
      .json<github.ReposListTagProtectionResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead.

This creates a tag protection state for a repository.
This endpoint is only available to repository administrators.
 */
  @aiFunction({
    name: 'github_repos_create_tag_protection',
    description: `> [!WARNING]
> **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#create-a-repository-ruleset)" endpoint instead.

This creates a tag protection state for a repository.
This endpoint is only available to repository administrators.`,
    inputSchema: github.ReposCreateTagProtectionParamsSchema,
    tags: ['repos']
  })
  async reposCreateTagProtection(
    params: github.ReposCreateTagProtectionParams
  ): Promise<github.ReposCreateTagProtectionResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/tags/protection`, {
        json: pick(params, 'pattern')
      })
      .json<github.ReposCreateTagProtectionResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead.

This deletes a tag protection state for a repository.
This endpoint is only available to repository administrators.
 */
  @aiFunction({
    name: 'github_repos_delete_tag_protection',
    description: `> [!WARNING]
> **Closing down notice:** This operation is closing down and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead.

This deletes a tag protection state for a repository.
This endpoint is only available to repository administrators.`,
    inputSchema: github.ReposDeleteTagProtectionParamsSchema,
    tags: ['repos']
  })
  async reposDeleteTagProtection(
    params: github.ReposDeleteTagProtectionParams
  ): Promise<github.ReposDeleteTagProtectionResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/tags/protection/${params.tag_protection_id}`,
        {}
      )
      .json<github.ReposDeleteTagProtectionResponse>()
  }

  /**
 * Gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually
`main`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use
the `Location` header to make a second `GET` request.

> [!NOTE]
> For private repositories, these links are temporary and expire after five minutes.
 */
  @aiFunction({
    name: 'github_repos_download_tarball_archive',
    description: `Gets a redirect URL to download a tar archive for a repository. If you omit \`:ref\`, the repository’s default branch (usually
\`main\`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use
the \`Location\` header to make a second \`GET\` request.

> [!NOTE]
> For private repositories, these links are temporary and expire after five minutes.`,
    inputSchema: github.ReposDownloadTarballArchiveParamsSchema,
    tags: ['repos']
  })
  async reposDownloadTarballArchive(
    params: github.ReposDownloadTarballArchiveParams
  ): Promise<github.ReposDownloadTarballArchiveResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/tarball/${params.ref}`,
        {}
      )
      .json<github.ReposDownloadTarballArchiveResponse>()
  }

  /**
 * Lists the teams that have access to the specified repository and that are also visible to the authenticated user.

For a public repository, a team is listed only if that team added the public repository explicitly.

OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to use this endpoint with a public repository, and `repo` scope to use this endpoint with a private repository.
 */
  @aiFunction({
    name: 'github_repos_list_teams',
    description: `Lists the teams that have access to the specified repository and that are also visible to the authenticated user.

For a public repository, a team is listed only if that team added the public repository explicitly.

OAuth app tokens and personal access tokens (classic) need the \`public_repo\` or \`repo\` scope to use this endpoint with a public repository, and \`repo\` scope to use this endpoint with a private repository.`,
    inputSchema: github.ReposListTeamsParamsSchema,
    tags: ['repos']
  })
  async reposListTeams(
    params: github.ReposListTeamsParams
  ): Promise<github.ReposListTeamsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/teams`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ReposListTeamsResponse>()
  }

  /**
   * Get all repository topics.
   */
  @aiFunction({
    name: 'github_repos_get_all_topics',
    description: `Get all repository topics.`,
    inputSchema: github.ReposGetAllTopicsParamsSchema,
    tags: ['repos']
  })
  async reposGetAllTopics(
    params: github.ReposGetAllTopicsParams
  ): Promise<github.ReposGetAllTopicsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/topics`, {
        searchParams: sanitizeSearchParams(pick(params, 'page', 'per_page'))
      })
      .json<github.ReposGetAllTopicsResponse>()
  }

  /**
   * Replace all repository topics.
   */
  @aiFunction({
    name: 'github_repos_replace_all_topics',
    description: `Replace all repository topics.`,
    inputSchema: github.ReposReplaceAllTopicsParamsSchema,
    tags: ['repos']
  })
  async reposReplaceAllTopics(
    params: github.ReposReplaceAllTopicsParams
  ): Promise<github.ReposReplaceAllTopicsResponse> {
    return this.ky
      .put(`/repos/${params.owner}/${params.repo}/topics`, {
        json: pick(params, 'names')
      })
      .json<github.ReposReplaceAllTopicsResponse>()
  }

  /**
   * Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday.
   */
  @aiFunction({
    name: 'github_repos_get_clones',
    description: `Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday.`,
    inputSchema: github.ReposGetClonesParamsSchema,
    tags: ['repos']
  })
  async reposGetClones(
    params: github.ReposGetClonesParams
  ): Promise<github.ReposGetClonesResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/traffic/clones`, {
        searchParams: sanitizeSearchParams(pick(params, 'per'))
      })
      .json<github.ReposGetClonesResponse>()
  }

  /**
   * Get the top 10 popular contents over the last 14 days.
   */
  @aiFunction({
    name: 'github_repos_get_top_paths',
    description: `Get the top 10 popular contents over the last 14 days.`,
    inputSchema: github.ReposGetTopPathsParamsSchema,
    tags: ['repos']
  })
  async reposGetTopPaths(
    params: github.ReposGetTopPathsParams
  ): Promise<github.ReposGetTopPathsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/traffic/popular/paths`,
        {}
      )
      .json<github.ReposGetTopPathsResponse>()
  }

  /**
   * Get the top 10 referrers over the last 14 days.
   */
  @aiFunction({
    name: 'github_repos_get_top_referrers',
    description: `Get the top 10 referrers over the last 14 days.`,
    inputSchema: github.ReposGetTopReferrersParamsSchema,
    tags: ['repos']
  })
  async reposGetTopReferrers(
    params: github.ReposGetTopReferrersParams
  ): Promise<github.ReposGetTopReferrersResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/traffic/popular/referrers`,
        {}
      )
      .json<github.ReposGetTopReferrersResponse>()
  }

  /**
   * Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday.
   */
  @aiFunction({
    name: 'github_repos_get_views',
    description: `Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday.`,
    inputSchema: github.ReposGetViewsParamsSchema,
    tags: ['repos']
  })
  async reposGetViews(
    params: github.ReposGetViewsParams
  ): Promise<github.ReposGetViewsResponse> {
    return this.ky
      .get(`/repos/${params.owner}/${params.repo}/traffic/views`, {
        searchParams: sanitizeSearchParams(pick(params, 'per'))
      })
      .json<github.ReposGetViewsResponse>()
  }

  /**
   * A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original `owner`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://docs.github.com/articles/about-repository-transfers/).
   */
  @aiFunction({
    name: 'github_repos_transfer',
    description: `A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original \`owner\`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://docs.github.com/articles/about-repository-transfers/).`,
    inputSchema: github.ReposTransferParamsSchema,
    tags: ['repos']
  })
  async reposTransfer(
    params: github.ReposTransferParams
  ): Promise<github.ReposTransferResponse> {
    return this.ky
      .post(`/repos/${params.owner}/${params.repo}/transfer`, {
        json: pick(params, 'new_owner', 'new_name', 'team_ids')
      })
      .json<github.ReposTransferResponse>()
  }

  /**
   * Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin read access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)".
   */
  @aiFunction({
    name: 'github_repos_check_vulnerability_alerts',
    description: `Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin read access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)".`,
    inputSchema: github.ReposCheckVulnerabilityAlertsParamsSchema,
    tags: ['repos']
  })
  async reposCheckVulnerabilityAlerts(
    params: github.ReposCheckVulnerabilityAlertsParams
  ): Promise<github.ReposCheckVulnerabilityAlertsResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/vulnerability-alerts`,
        {}
      )
      .json<github.ReposCheckVulnerabilityAlertsResponse>()
  }

  /**
   * Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)".
   */
  @aiFunction({
    name: 'github_repos_enable_vulnerability_alerts',
    description: `Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)".`,
    inputSchema: github.ReposEnableVulnerabilityAlertsParamsSchema,
    tags: ['repos']
  })
  async reposEnableVulnerabilityAlerts(
    params: github.ReposEnableVulnerabilityAlertsParams
  ): Promise<github.ReposEnableVulnerabilityAlertsResponse> {
    return this.ky
      .put(
        `/repos/${params.owner}/${params.repo}/vulnerability-alerts`,
        {}
      )
      .json<github.ReposEnableVulnerabilityAlertsResponse>()
  }

  /**
 * Disables dependency alerts and the dependency graph for a repository.
The authenticated user must have admin access to the repository. For more information,
see "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)".
 */
  @aiFunction({
    name: 'github_repos_disable_vulnerability_alerts',
    description: `Disables dependency alerts and the dependency graph for a repository.
The authenticated user must have admin access to the repository. For more information,
see "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)".`,
    inputSchema: github.ReposDisableVulnerabilityAlertsParamsSchema,
    tags: ['repos']
  })
  async reposDisableVulnerabilityAlerts(
    params: github.ReposDisableVulnerabilityAlertsParams
  ): Promise<github.ReposDisableVulnerabilityAlertsResponse> {
    return this.ky
      .delete(
        `/repos/${params.owner}/${params.repo}/vulnerability-alerts`,
        {}
      )
      .json<github.ReposDisableVulnerabilityAlertsResponse>()
  }

  /**
 * Gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the repository’s default branch (usually
`main`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use
the `Location` header to make a second `GET` request.

> [!NOTE]
> For private repositories, these links are temporary and expire after five minutes. If the repository is empty, you will receive a 404 when you follow the redirect.
 */
  @aiFunction({
    name: 'github_repos_download_zipball_archive',
    description: `Gets a redirect URL to download a zip archive for a repository. If you omit \`:ref\`, the repository’s default branch (usually
\`main\`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use
the \`Location\` header to make a second \`GET\` request.

> [!NOTE]
> For private repositories, these links are temporary and expire after five minutes. If the repository is empty, you will receive a 404 when you follow the redirect.`,
    inputSchema: github.ReposDownloadZipballArchiveParamsSchema,
    tags: ['repos']
  })
  async reposDownloadZipballArchive(
    params: github.ReposDownloadZipballArchiveParams
  ): Promise<github.ReposDownloadZipballArchiveResponse> {
    return this.ky
      .get(
        `/repos/${params.owner}/${params.repo}/zipball/${params.ref}`,
        {}
      )
      .json<github.ReposDownloadZipballArchiveResponse>()
  }

  /**
 * Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. If the repository is not public, the authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/repos/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.

OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository.
 */
  @aiFunction({
    name: 'github_repos_create_using_template',
    description: `Creates a new repository using a repository template. Use the \`template_owner\` and \`template_repo\` route parameters to specify the repository to use as the template. If the repository is not public, the authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/repos/repos#get-a-repository) endpoint and check that the \`is_template\` key is \`true\`.

OAuth app tokens and personal access tokens (classic) need the \`public_repo\` or \`repo\` scope to create a public repository, and \`repo\` scope to create a private repository.`,
    inputSchema: github.ReposCreateUsingTemplateParamsSchema,
    tags: ['repos']
  })
  async reposCreateUsingTemplate(
    params: github.ReposCreateUsingTemplateParams
  ): Promise<github.ReposCreateUsingTemplateResponse> {
    return this.ky
      .post(
        `/repos/${params.template_owner}/${params.template_repo}/generate`,
        {
          json: pick(
            params,
            'owner',
            'name',
            'description',
            'include_all_branches',
            'private'
          )
        }
      )
      .json<github.ReposCreateUsingTemplateResponse>()
  }

  /**
 * Lists all public repositories in the order that they were created.

Note:
- For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise.
- Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of repositories.
 */
  @aiFunction({
    name: 'github_repos_list_public',
    description: `Lists all public repositories in the order that they were created.

Note:
- For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise.
- Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of repositories.`,
    inputSchema: github.ReposListPublicParamsSchema,
    tags: ['repos']
  })
  async reposListPublic(
    params: github.ReposListPublicParams
  ): Promise<github.ReposListPublicResponse> {
    return this.ky
      .get('/repositories', {
        searchParams: sanitizeSearchParams(params)
      })
      .json<github.ReposListPublicResponse>()
  }

  /**
 * Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).

When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).

For example, if you want to find the definition of the `addClass` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this:

`q=addClass+in:file+language:js+repo:jquery/jquery`

This query searches for the keyword `addClass` within a file's contents. The query limits the search to files where the language is JavaScript in the `jquery/jquery` repository.

Considerations for code search:

Due to the complexity of searching code, there are a few restrictions on how searches are performed:

*   Only the _default branch_ is considered. In most cases, this will be the `master` branch.
*   Only files smaller than 384 KB are searchable.
*   You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazing
language:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is.

This endpoint requires you to authenticate and limits you to 10 requests per minute.
 */
  @aiFunction({
    name: 'github_search_code',
    description: `Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).

When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).

For example, if you want to find the definition of the \`addClass\` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this:

\`q=addClass+in:file+language:js+repo:jquery/jquery\`

This query searches for the keyword \`addClass\` within a file's contents. The query limits the search to files where the language is JavaScript in the \`jquery/jquery\` repository.

Considerations for code search:

Due to the complexity of searching code, there are a few restrictions on how searches are performed:

*   Only the _default branch_ is considered. In most cases, this will be the \`master\` branch.
*   Only files smaller than 384 KB are searchable.
*   You must always include at least one search term when searching source code. For example, searching for [\`language:go\`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [\`amazing
language:go\`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is.

This endpoint requires you to authenticate and limits you to 10 requests per minute.`,
    inputSchema: github.SearchCodeParamsSchema,
    tags: ['search']
  })
  async searchCode(
    params: github.SearchCodeParams
  ): Promise<github.SearchCodeResponse> {
    return this.ky
      .get('/search/code', {
        searchParams: sanitizeSearchParams(
          pick(params, 'q', 'sort', 'order', 'per_page', 'page')
        )
      })
      .json<github.SearchCodeResponse>()
  }

  /**
 * Find commits via various criteria on the default branch (usually `main`). This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).

When searching for commits, you can get text match metadata for the **message** field when you provide the `text-match` media type. For more details about how to receive highlighted search results, see [Text match
metadata](https://docs.github.com/rest/search/search#text-match-metadata).

For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this:

`q=repo:octocat/Spoon-Knife+css`.
 */
  @aiFunction({
    name: 'github_search_commits',
    description: `Find commits via various criteria on the default branch (usually \`main\`). This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).

When searching for commits, you can get text match metadata for the **message** field when you provide the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match
metadata](https://docs.github.com/rest/search/search#text-match-metadata).

For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this:

\`q=repo:octocat/Spoon-Knife+css\`.`,
    inputSchema: github.SearchCommitsParamsSchema,
    tags: ['search']
  })
  async searchCommits(
    params: github.SearchCommitsParams
  ): Promise<github.SearchCommitsResponse> {
    return this.ky
      .get('/search/commits', {
        searchParams: sanitizeSearchParams(
          pick(params, 'q', 'sort', 'order', 'per_page', 'page')
        )
      })
      .json<github.SearchCommitsResponse>()
  }

  /**
 * > [!WARNING]
> **Notice:** Search for issues and pull requests will be overridden by advanced search on September 4, 2025.
> You can read more about this change on [the GitHub blog](https://github.blog/changelog/2025-03-06-github-issues-projects-api-support-for-issues-advanced-search-and-more/).
 */
  @aiFunction({
    name: 'github_search_issues_and_pull_requests',
    description: `> [!WARNING]
> **Notice:** Search for issues and pull requests will be overridden by advanced search on September 4, 2025.
> You can read more about this change on [the GitHub blog](https://github.blog/changelog/2025-03-06-github-issues-projects-api-support-for-issues-advanced-search-and-more/).`,
    inputSchema: github.SearchIssuesAndPullRequestsParamsSchema,
    tags: ['search']
  })
  async searchIssuesAndPullRequests(
    params: github.SearchIssuesAndPullRequestsParams
  ): Promise<github.SearchIssuesAndPullRequestsResponse> {
    return this.ky
      .get('/search/issues', {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'q',
            'sort',
            'order',
            'per_page',
            'page',
            'advanced_search'
          )
        )
      })
      .json<github.SearchIssuesAndPullRequestsResponse>()
  }

  /**
 * Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).

When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).

For example, if you want to find labels in the `linguist` repository that match `bug`, `defect`, or `enhancement`. Your query might look like this:

`q=bug+defect+enhancement&repository_id=64778136`

The labels that best match the query appear first in the search results.
 */
  @aiFunction({
    name: 'github_search_labels',
    description: `Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).

When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).

For example, if you want to find labels in the \`linguist\` repository that match \`bug\`, \`defect\`, or \`enhancement\`. Your query might look like this:

\`q=bug+defect+enhancement&repository_id=64778136\`

The labels that best match the query appear first in the search results.`,
    inputSchema: github.SearchLabelsParamsSchema,
    tags: ['search']
  })
  async searchLabels(
    params: github.SearchLabelsParams
  ): Promise<github.SearchLabelsResponse> {
    return this.ky
      .get('/search/labels', {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'repository_id',
            'q',
            'sort',
            'order',
            'per_page',
            'page'
          )
        )
      })
      .json<github.SearchLabelsResponse>()
  }

  /**
 * Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).

When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).

For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this:

`q=tetris+language:assembly&sort=stars&order=desc`

This query searches for repositories with the word `tetris` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results.
 */
  @aiFunction({
    name: 'github_search_repos',
    description: `Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).

When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).

For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this:

\`q=tetris+language:assembly&sort=stars&order=desc\`

This query searches for repositories with the word \`tetris\` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results.`,
    inputSchema: github.SearchReposParamsSchema,
    tags: ['search']
  })
  async searchRepos(
    params: github.SearchReposParams
  ): Promise<github.SearchReposResponse> {
    return this.ky
      .get('/search/repositories', {
        searchParams: sanitizeSearchParams(
          pick(params, 'q', 'sort', 'order', 'per_page', 'page')
        )
      })
      .json<github.SearchReposResponse>()
  }

  /**
 * Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api). See "[Searching topics](https://docs.github.com/articles/searching-topics/)" for a detailed list of qualifiers.

When searching for topics, you can get text match metadata for the topic's **short\_description**, **description**, **name**, or **display\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).

For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this:

`q=ruby+is:featured`

This query searches for topics with the keyword `ruby` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results.
 */
  @aiFunction({
    name: 'github_search_topics',
    description: `Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api). See "[Searching topics](https://docs.github.com/articles/searching-topics/)" for a detailed list of qualifiers.

When searching for topics, you can get text match metadata for the topic's **short\_description**, **description**, **name**, or **display\_name** field when you pass the \`text-match\` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).

For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this:

\`q=ruby+is:featured\`

This query searches for topics with the keyword \`ruby\` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results.`,
    inputSchema: github.SearchTopicsParamsSchema,
    tags: ['search']
  })
  async searchTopics(
    params: github.SearchTopicsParams
  ): Promise<github.SearchTopicsResponse> {
    return this.ky
      .get('/search/topics', {
        searchParams: sanitizeSearchParams(
          pick(params, 'q', 'per_page', 'page')
        )
      })
      .json<github.SearchTopicsResponse>()
  }

  /**
 * Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).

When searching for users, you can get text match metadata for the issue **login**, public **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).

For example, if you're looking for a list of popular users, you might try this query:

`q=tom+repos:%3E42+followers:%3E1000`

This query searches for users with the name `tom`. The results are restricted to users with more than 42 repositories and over 1,000 followers.

This endpoint does not accept authentication and will only include publicly visible users. As an alternative, you can use the GraphQL API. The GraphQL API requires authentication and will return private users, including Enterprise Managed Users (EMUs), that you are authorized to view. For more information, see "[GraphQL Queries](https://docs.github.com/graphql/reference/queries#search).".
 */
  @aiFunction({
    name: 'github_search_users',
    description: `Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api).

When searching for users, you can get text match metadata for the issue **login**, public **email**, and **name** fields when you pass the \`text-match\` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata).

For example, if you're looking for a list of popular users, you might try this query:

\`q=tom+repos:%3E42+followers:%3E1000\`

This query searches for users with the name \`tom\`. The results are restricted to users with more than 42 repositories and over 1,000 followers.

This endpoint does not accept authentication and will only include publicly visible users. As an alternative, you can use the GraphQL API. The GraphQL API requires authentication and will return private users, including Enterprise Managed Users (EMUs), that you are authorized to view. For more information, see "[GraphQL Queries](https://docs.github.com/graphql/reference/queries#search).".`,
    inputSchema: github.SearchUsersParamsSchema,
    tags: ['search']
  })
  async searchUsers(
    params: github.SearchUsersParams
  ): Promise<github.SearchUsersResponse> {
    return this.ky
      .get('/search/users', {
        searchParams: sanitizeSearchParams(
          pick(params, 'q', 'sort', 'order', 'per_page', 'page')
        )
      })
      .json<github.SearchUsersResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint.
 */
  @aiFunction({
    name: 'github_teams_get_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint.`,
    inputSchema: github.TeamsGetLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsGetLegacy(
    params: github.TeamsGetLegacyParams
  ): Promise<github.TeamsGetLegacyResponse> {
    return this.ky
      .get(`/teams/${params.team_id}`)
      .json<github.TeamsGetLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint.

To delete a team, the authenticated user must be an organization owner or team maintainer.

If you are an organization owner, deleting a parent team will delete all of its child teams as well.
 */
  @aiFunction({
    name: 'github_teams_delete_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint.

To delete a team, the authenticated user must be an organization owner or team maintainer.

If you are an organization owner, deleting a parent team will delete all of its child teams as well.`,
    inputSchema: github.TeamsDeleteLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsDeleteLegacy(
    params: github.TeamsDeleteLegacyParams
  ): Promise<github.TeamsDeleteLegacyResponse> {
    return this.ky
      .delete(`/teams/${params.team_id}`)
      .json<github.TeamsDeleteLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint.

To edit a team, the authenticated user must either be an organization owner or a team maintainer.

> [!NOTE]
> With nested teams, the `privacy` for parent teams cannot be `secret`.
 */
  @aiFunction({
    name: 'github_teams_update_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint.

To edit a team, the authenticated user must either be an organization owner or a team maintainer.

> [!NOTE]
> With nested teams, the \`privacy\` for parent teams cannot be \`secret\`.`,
    inputSchema: github.TeamsUpdateLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsUpdateLegacy(
    params: github.TeamsUpdateLegacyParams
  ): Promise<github.TeamsUpdateLegacyResponse> {
    return this.ky
      .patch(`/teams/${params.team_id}`, {
        json: pick(
          params,
          'name',
          'description',
          'privacy',
          'notification_setting',
          'permission',
          'parent_team_id'
        )
      })
      .json<github.TeamsUpdateLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint.

List all discussions on a team's page.

OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_list_discussions_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List discussions\`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint.

List all discussions on a team's page.

OAuth app tokens and personal access tokens (classic) need the \`read:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsListDiscussionsLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsListDiscussionsLegacy(
    params: github.TeamsListDiscussionsLegacyParams
  ): Promise<github.TeamsListDiscussionsLegacyResponse> {
    return this.ky
      .get(`/teams/${params.team_id}/discussions`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'direction', 'per_page', 'page')
        )
      })
      .json<github.TeamsListDiscussionsLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint.

Creates a new discussion post on a team's page.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_create_discussion_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create a discussion\`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint.

Creates a new discussion post on a team's page.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsCreateDiscussionLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsCreateDiscussionLegacy(
    params: github.TeamsCreateDiscussionLegacyParams
  ): Promise<github.TeamsCreateDiscussionLegacyResponse> {
    return this.ky
      .post(`/teams/${params.team_id}/discussions`, {
        json: pick(params, 'title', 'body', 'private')
      })
      .json<github.TeamsCreateDiscussionLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint.

Get a specific discussion on a team's page.

OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_get_discussion_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint.

Get a specific discussion on a team's page.

OAuth app tokens and personal access tokens (classic) need the \`read:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsGetDiscussionLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsGetDiscussionLegacy(
    params: github.TeamsGetDiscussionLegacyParams
  ): Promise<github.TeamsGetDiscussionLegacyResponse> {
    return this.ky
      .get(
        `/teams/${params.team_id}/discussions/${params.discussion_number}`,
        {}
      )
      .json<github.TeamsGetDiscussionLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint.

Delete a discussion from a team's page.

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_delete_discussion_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Delete a discussion\`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint.

Delete a discussion from a team's page.

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsDeleteDiscussionLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsDeleteDiscussionLegacy(
    params: github.TeamsDeleteDiscussionLegacyParams
  ): Promise<github.TeamsDeleteDiscussionLegacyResponse> {
    return this.ky
      .delete(
        `/teams/${params.team_id}/discussions/${params.discussion_number}`,
        {}
      )
      .json<github.TeamsDeleteDiscussionLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint.

Edits the title and body text of a discussion post. Only the parameters you provide are updated.

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_update_discussion_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint.

Edits the title and body text of a discussion post. Only the parameters you provide are updated.

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsUpdateDiscussionLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsUpdateDiscussionLegacy(
    params: github.TeamsUpdateDiscussionLegacyParams
  ): Promise<github.TeamsUpdateDiscussionLegacyResponse> {
    return this.ky
      .patch(
        `/teams/${params.team_id}/discussions/${params.discussion_number}`,
        {
          json: pick(params, 'title', 'body')
        }
      )
      .json<github.TeamsUpdateDiscussionLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint.

List all comments on a team discussion.

OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_list_discussion_comments_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint.

List all comments on a team discussion.

OAuth app tokens and personal access tokens (classic) need the \`read:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsListDiscussionCommentsLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsListDiscussionCommentsLegacy(
    params: github.TeamsListDiscussionCommentsLegacyParams
  ): Promise<github.TeamsListDiscussionCommentsLegacyResponse> {
    return this.ky
      .get(
        `/teams/${params.team_id}/discussions/${params.discussion_number}/comments`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'direction', 'per_page', 'page')
          )
        }
      )
      .json<github.TeamsListDiscussionCommentsLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint.

Creates a new comment on a team discussion.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_create_discussion_comment_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint.

Creates a new comment on a team discussion.

This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsCreateDiscussionCommentLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsCreateDiscussionCommentLegacy(
    params: github.TeamsCreateDiscussionCommentLegacyParams
  ): Promise<github.TeamsCreateDiscussionCommentLegacyResponse> {
    return this.ky
      .post(
        `/teams/${params.team_id}/discussions/${params.discussion_number}/comments`,
        {
          json: pick(params, 'body')
        }
      )
      .json<github.TeamsCreateDiscussionCommentLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint.

Get a specific comment on a team discussion.

OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_get_discussion_comment_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint.

Get a specific comment on a team discussion.

OAuth app tokens and personal access tokens (classic) need the \`read:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsGetDiscussionCommentLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsGetDiscussionCommentLegacy(
    params: github.TeamsGetDiscussionCommentLegacyParams
  ): Promise<github.TeamsGetDiscussionCommentLegacyResponse> {
    return this.ky
      .get(
        `/teams/${params.team_id}/discussions/${params.discussion_number}/comments/${params.comment_number}`,
        {}
      )
      .json<github.TeamsGetDiscussionCommentLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint.

Deletes a comment on a team discussion.

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_delete_discussion_comment_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint.

Deletes a comment on a team discussion.

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsDeleteDiscussionCommentLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsDeleteDiscussionCommentLegacy(
    params: github.TeamsDeleteDiscussionCommentLegacyParams
  ): Promise<github.TeamsDeleteDiscussionCommentLegacyResponse> {
    return this.ky
      .delete(
        `/teams/${params.team_id}/discussions/${params.discussion_number}/comments/${params.comment_number}`,
        {}
      )
      .json<github.TeamsDeleteDiscussionCommentLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint.

Edits the body text of a discussion comment.

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_teams_update_discussion_comment_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint.

Edits the body text of a discussion comment.

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.TeamsUpdateDiscussionCommentLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsUpdateDiscussionCommentLegacy(
    params: github.TeamsUpdateDiscussionCommentLegacyParams
  ): Promise<github.TeamsUpdateDiscussionCommentLegacyResponse> {
    return this.ky
      .patch(
        `/teams/${params.team_id}/discussions/${params.discussion_number}/comments/${params.comment_number}`,
        {
          json: pick(params, 'body')
        }
      )
      .json<github.TeamsUpdateDiscussionCommentLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint.

List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).

OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_reactions_list_for_team_discussion_comment_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List reactions for a team discussion comment\`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint.

List the reactions to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).

OAuth app tokens and personal access tokens (classic) need the \`read:discussion\` scope to use this endpoint.`,
    inputSchema: github.ReactionsListForTeamDiscussionCommentLegacyParamsSchema,
    tags: ['reactions']
  })
  async reactionsListForTeamDiscussionCommentLegacy(
    params: github.ReactionsListForTeamDiscussionCommentLegacyParams
  ): Promise<github.ReactionsListForTeamDiscussionCommentLegacyResponse> {
    return this.ky
      .get(
        `/teams/${params.team_id}/discussions/${params.discussion_number}/comments/${params.comment_number}/reactions`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'content', 'per_page', 'page')
          )
        }
      )
      .json<github.ReactionsListForTeamDiscussionCommentLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint.

Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).

A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_reactions_create_for_team_discussion_comment_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint.

Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment).

A response with an HTTP \`200\` status means that you already added the reaction type to this team discussion comment.

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema:
      github.ReactionsCreateForTeamDiscussionCommentLegacyParamsSchema,
    tags: ['reactions']
  })
  async reactionsCreateForTeamDiscussionCommentLegacy(
    params: github.ReactionsCreateForTeamDiscussionCommentLegacyParams
  ): Promise<github.ReactionsCreateForTeamDiscussionCommentLegacyResponse> {
    return this.ky
      .post(
        `/teams/${params.team_id}/discussions/${params.discussion_number}/comments/${params.comment_number}/reactions`,
        {
          json: pick(params, 'content')
        }
      )
      .json<github.ReactionsCreateForTeamDiscussionCommentLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint.

List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).

OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_reactions_list_for_team_discussion_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List reactions for a team discussion\`](https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint.

List the reactions to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).

OAuth app tokens and personal access tokens (classic) need the \`read:discussion\` scope to use this endpoint.`,
    inputSchema: github.ReactionsListForTeamDiscussionLegacyParamsSchema,
    tags: ['reactions']
  })
  async reactionsListForTeamDiscussionLegacy(
    params: github.ReactionsListForTeamDiscussionLegacyParams
  ): Promise<github.ReactionsListForTeamDiscussionLegacyResponse> {
    return this.ky
      .get(
        `/teams/${params.team_id}/discussions/${params.discussion_number}/reactions`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'content', 'per_page', 'page')
          )
        }
      )
      .json<github.ReactionsListForTeamDiscussionLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint.

Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).

A response with an HTTP `200` status means that you already added the reaction type to this team discussion.

OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_reactions_create_for_team_discussion_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`Create reaction for a team discussion\`](https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint.

Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion).

A response with an HTTP \`200\` status means that you already added the reaction type to this team discussion.

OAuth app tokens and personal access tokens (classic) need the \`write:discussion\` scope to use this endpoint.`,
    inputSchema: github.ReactionsCreateForTeamDiscussionLegacyParamsSchema,
    tags: ['reactions']
  })
  async reactionsCreateForTeamDiscussionLegacy(
    params: github.ReactionsCreateForTeamDiscussionLegacyParams
  ): Promise<github.ReactionsCreateForTeamDiscussionLegacyResponse> {
    return this.ky
      .post(
        `/teams/${params.team_id}/discussions/${params.discussion_number}/reactions`,
        {
          json: pick(params, 'content')
        }
      )
      .json<github.ReactionsCreateForTeamDiscussionLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint.

The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`.
 */
  @aiFunction({
    name: 'github_teams_list_pending_invitations_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List pending team invitations\`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint.

The return hash contains a \`role\` field which refers to the Organization Invitation role and will be one of the following values: \`direct_member\`, \`admin\`, \`billing_manager\`, \`hiring_manager\`, or \`reinstate\`. If the invitee is not a GitHub member, the \`login\` field in the return hash will be \`null\`.`,
    inputSchema: github.TeamsListPendingInvitationsLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsListPendingInvitationsLegacy(
    params: github.TeamsListPendingInvitationsLegacyParams
  ): Promise<github.TeamsListPendingInvitationsLegacyResponse> {
    return this.ky
      .get(`/teams/${params.team_id}/invitations`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.TeamsListPendingInvitationsLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint.

Team members will include the members of child teams.
 */
  @aiFunction({
    name: 'github_teams_list_members_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List team members\`](https://docs.github.com/rest/teams/members#list-team-members) endpoint.

Team members will include the members of child teams.`,
    inputSchema: github.TeamsListMembersLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsListMembersLegacy(
    params: github.TeamsListMembersLegacyParams
  ): Promise<github.TeamsListMembersLegacyResponse> {
    return this.ky
      .get(`/teams/${params.team_id}/members`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'role', 'per_page', 'page')
        )
      })
      .json<github.TeamsListMembersLegacyResponse>()
  }

  /**
 * The "Get team member" endpoint (described below) is closing down.

We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships.

To list members in a team, the team must be visible to the authenticated user.
 */
  @aiFunction({
    name: 'github_teams_get_member_legacy',
    description: `The "Get team member" endpoint (described below) is closing down.

We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships.

To list members in a team, the team must be visible to the authenticated user.`,
    inputSchema: github.TeamsGetMemberLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsGetMemberLegacy(
    params: github.TeamsGetMemberLegacyParams
  ): Promise<github.TeamsGetMemberLegacyResponse> {
    return this.ky
      .get(`/teams/${params.team_id}/members/${params.username}`, {})
      .json<github.TeamsGetMemberLegacyResponse>()
  }

  /**
 * The "Add team member" endpoint (described below) is closing down.

We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization.

> [!NOTE]
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."

Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method).".
 */
  @aiFunction({
    name: 'github_teams_add_member_legacy',
    description: `The "Add team member" endpoint (described below) is closing down.

We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization.

> [!NOTE]
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."

Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method).".`,
    inputSchema: github.TeamsAddMemberLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsAddMemberLegacy(
    params: github.TeamsAddMemberLegacyParams
  ): Promise<github.TeamsAddMemberLegacyResponse> {
    return this.ky
      .put(`/teams/${params.team_id}/members/${params.username}`, {})
      .json<github.TeamsAddMemberLegacyResponse>()
  }

  /**
 * The "Remove team member" endpoint (described below) is closing down.

We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team.

> [!NOTE]
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).".
 */
  @aiFunction({
    name: 'github_teams_remove_member_legacy',
    description: `The "Remove team member" endpoint (described below) is closing down.

We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team.

> [!NOTE]
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).".`,
    inputSchema: github.TeamsRemoveMemberLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsRemoveMemberLegacy(
    params: github.TeamsRemoveMemberLegacyParams
  ): Promise<github.TeamsRemoveMemberLegacyResponse> {
    return this.ky
      .delete(`/teams/${params.team_id}/members/${params.username}`, {})
      .json<github.TeamsRemoveMemberLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint.

Team members will include the members of child teams.

To get a user's membership with a team, the team must be visible to the authenticated user.

**Note:**
The response contains the `state` of the membership and the member's `role`.

The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team).
 */
  @aiFunction({
    name: 'github_teams_get_membership_for_user_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint.

Team members will include the members of child teams.

To get a user's membership with a team, the team must be visible to the authenticated user.

**Note:**
The response contains the \`state\` of the membership and the member's \`role\`.

The \`role\` for organization owners is set to \`maintainer\`. For more information about \`maintainer\` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team).`,
    inputSchema: github.TeamsGetMembershipForUserLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsGetMembershipForUserLegacy(
    params: github.TeamsGetMembershipForUserLegacyParams
  ): Promise<github.TeamsGetMembershipForUserLegacyResponse> {
    return this.ky
      .get(`/teams/${params.team_id}/memberships/${params.username}`, {})
      .json<github.TeamsGetMembershipForUserLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer.

> [!NOTE]
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."

If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner.

If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.
 */
  @aiFunction({
    name: 'github_teams_add_or_update_membership_for_user_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer.

> [!NOTE]
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."

If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner.

If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.`,
    inputSchema: github.TeamsAddOrUpdateMembershipForUserLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsAddOrUpdateMembershipForUserLegacy(
    params: github.TeamsAddOrUpdateMembershipForUserLegacyParams
  ): Promise<github.TeamsAddOrUpdateMembershipForUserLegacyResponse> {
    return this.ky
      .put(`/teams/${params.team_id}/memberships/${params.username}`, {
        json: pick(params, 'role')
      })
      .json<github.TeamsAddOrUpdateMembershipForUserLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.

> [!NOTE]
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).".
 */
  @aiFunction({
    name: 'github_teams_remove_membership_for_user_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.

> [!NOTE]
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).".`,
    inputSchema: github.TeamsRemoveMembershipForUserLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsRemoveMembershipForUserLegacy(
    params: github.TeamsRemoveMembershipForUserLegacyParams
  ): Promise<github.TeamsRemoveMembershipForUserLegacyResponse> {
    return this.ky
      .delete(
        `/teams/${params.team_id}/memberships/${params.username}`,
        {}
      )
      .json<github.TeamsRemoveMembershipForUserLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_teams_list_projects_legacy',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.TeamsListProjectsLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsListProjectsLegacy(
    params: github.TeamsListProjectsLegacyParams
  ): Promise<github.TeamsListProjectsLegacyResponse> {
    return this.ky
      .get(`/teams/${params.team_id}/projects`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.TeamsListProjectsLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_teams_check_permissions_for_project_legacy',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.TeamsCheckPermissionsForProjectLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsCheckPermissionsForProjectLegacy(
    params: github.TeamsCheckPermissionsForProjectLegacyParams
  ): Promise<github.TeamsCheckPermissionsForProjectLegacyResponse> {
    return this.ky
      .get(`/teams/${params.team_id}/projects/${params.project_id}`, {})
      .json<github.TeamsCheckPermissionsForProjectLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_teams_add_or_update_project_permissions_legacy',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.TeamsAddOrUpdateProjectPermissionsLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsAddOrUpdateProjectPermissionsLegacy(
    params: github.TeamsAddOrUpdateProjectPermissionsLegacyParams
  ): Promise<github.TeamsAddOrUpdateProjectPermissionsLegacyResponse> {
    return this.ky
      .put(`/teams/${params.team_id}/projects/${params.project_id}`, {
        json: pick(params, 'permission')
      })
      .json<github.TeamsAddOrUpdateProjectPermissionsLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_teams_remove_project_legacy',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.TeamsRemoveProjectLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsRemoveProjectLegacy(
    params: github.TeamsRemoveProjectLegacyParams
  ): Promise<github.TeamsRemoveProjectLegacyResponse> {
    return this.ky
      .delete(
        `/teams/${params.team_id}/projects/${params.project_id}`,
        {}
      )
      .json<github.TeamsRemoveProjectLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint.
 */
  @aiFunction({
    name: 'github_teams_list_repos_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint.`,
    inputSchema: github.TeamsListReposLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsListReposLegacy(
    params: github.TeamsListReposLegacyParams
  ): Promise<github.TeamsListReposLegacyResponse> {
    return this.ky
      .get(`/teams/${params.team_id}/repos`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.TeamsListReposLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint.

> [!NOTE]
> Repositories inherited through a parent team will also be checked.

You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `Accept` header:.
 */
  @aiFunction({
    name: 'github_teams_check_permissions_for_repo_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint.

> [!NOTE]
> Repositories inherited through a parent team will also be checked.

You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the \`Accept\` header:.`,
    inputSchema: github.TeamsCheckPermissionsForRepoLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsCheckPermissionsForRepoLegacy(
    params: github.TeamsCheckPermissionsForRepoLegacyParams
  ): Promise<github.TeamsCheckPermissionsForRepoLegacyResponse> {
    return this.ky
      .get(
        `/teams/${params.team_id}/repos/${params.owner}/${params.repo}`,
        {}
      )
      .json<github.TeamsCheckPermissionsForRepoLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint.

To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization.

Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method).".
 */
  @aiFunction({
    name: 'github_teams_add_or_update_repo_permissions_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint.

To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a \`422 Unprocessable Entity\` status if you attempt to add a repository to a team that is not owned by the organization.

Note that, if you choose not to pass any parameters, you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method).".`,
    inputSchema: github.TeamsAddOrUpdateRepoPermissionsLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsAddOrUpdateRepoPermissionsLegacy(
    params: github.TeamsAddOrUpdateRepoPermissionsLegacyParams
  ): Promise<github.TeamsAddOrUpdateRepoPermissionsLegacyResponse> {
    return this.ky
      .put(
        `/teams/${params.team_id}/repos/${params.owner}/${params.repo}`,
        {
          json: pick(params, 'permission')
        }
      )
      .json<github.TeamsAddOrUpdateRepoPermissionsLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint.

If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team.
 */
  @aiFunction({
    name: 'github_teams_remove_repo_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint.

If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team.`,
    inputSchema: github.TeamsRemoveRepoLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsRemoveRepoLegacy(
    params: github.TeamsRemoveRepoLegacyParams
  ): Promise<github.TeamsRemoveRepoLegacyResponse> {
    return this.ky
      .delete(
        `/teams/${params.team_id}/repos/${params.owner}/${params.repo}`,
        {}
      )
      .json<github.TeamsRemoveRepoLegacyResponse>()
  }

  /**
 * > [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint.
 */
  @aiFunction({
    name: 'github_teams_list_child_legacy',
    description: `> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [\`List child teams\`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint.`,
    inputSchema: github.TeamsListChildLegacyParamsSchema,
    tags: ['teams']
  })
  async teamsListChildLegacy(
    params: github.TeamsListChildLegacyParams
  ): Promise<github.TeamsListChildLegacyResponse> {
    return this.ky
      .get(`/teams/${params.team_id}/teams`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.TeamsListChildLegacyResponse>()
  }

  /**
   * OAuth app tokens and personal access tokens (classic) need the `user` scope in order for the response to include private profile information.
   */
  @aiFunction({
    name: 'github_users_get_authenticated',
    description: `OAuth app tokens and personal access tokens (classic) need the \`user\` scope in order for the response to include private profile information.`,
    inputSchema: github.UsersGetAuthenticatedParamsSchema,
    tags: ['users']
  })
  async usersGetAuthenticated(
    _params: github.UsersGetAuthenticatedParams
  ): Promise<github.UsersGetAuthenticatedResponse> {
    return this.ky.get('/user').json<github.UsersGetAuthenticatedResponse>()
  }

  /**
   * **Note:** If your email is set to private and you send an `email` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API.
   */
  @aiFunction({
    name: 'github_users_update_authenticated',
    description: `**Note:** If your email is set to private and you send an \`email\` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API.`,
    inputSchema: github.UsersUpdateAuthenticatedParamsSchema,
    tags: ['users']
  })
  async usersUpdateAuthenticated(
    params: github.UsersUpdateAuthenticatedParams
  ): Promise<github.UsersUpdateAuthenticatedResponse> {
    return this.ky
      .patch('/user', {
        json: pick(
          params,
          'name',
          'email',
          'blog',
          'twitter_username',
          'company',
          'location',
          'hireable',
          'bio'
        )
      })
      .json<github.UsersUpdateAuthenticatedResponse>()
  }

  /**
   * List the users you've blocked on your personal account.
   */
  @aiFunction({
    name: 'github_users_list_blocked_by_authenticated_user',
    description: `List the users you've blocked on your personal account.`,
    inputSchema: github.UsersListBlockedByAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersListBlockedByAuthenticatedUser(
    params: github.UsersListBlockedByAuthenticatedUserParams
  ): Promise<github.UsersListBlockedByAuthenticatedUserResponse> {
    return this.ky
      .get('/user/blocks', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.UsersListBlockedByAuthenticatedUserResponse>()
  }

  /**
   * Returns a 204 if the given user is blocked by the authenticated user. Returns a 404 if the given user is not blocked by the authenticated user, or if the given user account has been identified as spam by GitHub.
   */
  @aiFunction({
    name: 'github_users_check_blocked',
    description: `Returns a 204 if the given user is blocked by the authenticated user. Returns a 404 if the given user is not blocked by the authenticated user, or if the given user account has been identified as spam by GitHub.`,
    inputSchema: github.UsersCheckBlockedParamsSchema,
    tags: ['users']
  })
  async usersCheckBlocked(
    params: github.UsersCheckBlockedParams
  ): Promise<github.UsersCheckBlockedResponse> {
    return this.ky
      .get(`/user/blocks/${params.username}`)
      .json<github.UsersCheckBlockedResponse>()
  }

  /**
   * Blocks the given user and returns a 204. If the authenticated user cannot block the given user a 422 is returned.
   */
  @aiFunction({
    name: 'github_users_block',
    description: `Blocks the given user and returns a 204. If the authenticated user cannot block the given user a 422 is returned.`,
    inputSchema: github.UsersBlockParamsSchema,
    tags: ['users']
  })
  async usersBlock(
    params: github.UsersBlockParams
  ): Promise<github.UsersBlockResponse> {
    return this.ky
      .put(`/user/blocks/${params.username}`)
      .json<github.UsersBlockResponse>()
  }

  /**
   * Unblocks the given user and returns a 204.
   */
  @aiFunction({
    name: 'github_users_unblock',
    description: `Unblocks the given user and returns a 204.`,
    inputSchema: github.UsersUnblockParamsSchema,
    tags: ['users']
  })
  async usersUnblock(
    params: github.UsersUnblockParams
  ): Promise<github.UsersUnblockResponse> {
    return this.ky
      .delete(`/user/blocks/${params.username}`)
      .json<github.UsersUnblockResponse>()
  }

  /**
 * Lists the authenticated user's codespaces.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_list_for_authenticated_user',
    description: `Lists the authenticated user's codespaces.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema: github.CodespacesListForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesListForAuthenticatedUser(
    params: github.CodespacesListForAuthenticatedUserParams
  ): Promise<github.CodespacesListForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/codespaces', {
        searchParams: sanitizeSearchParams(
          pick(params, 'per_page', 'page', 'repository_id')
        )
      })
      .json<github.CodespacesListForAuthenticatedUserResponse>()
  }

  /**
 * Creates a new codespace, owned by the authenticated user.

This endpoint requires either a `repository_id` OR a `pull_request` but not both.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_create_for_authenticated_user',
    description: `Creates a new codespace, owned by the authenticated user.

This endpoint requires either a \`repository_id\` OR a \`pull_request\` but not both.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    // TODO: Improve handling of union params
    inputSchema: github.CodespacesCreateForAuthenticatedUserParamsSchema as any,
    tags: ['codespaces']
  })
  async codespacesCreateForAuthenticatedUser(
    params: github.CodespacesCreateForAuthenticatedUserParams
  ): Promise<github.CodespacesCreateForAuthenticatedUserResponse> {
    return this.ky
      .post('/user/codespaces', {
        json: params
      })
      .json<github.CodespacesCreateForAuthenticatedUserResponse>()
  }

  /**
 * Lists all development environment secrets available for a user's codespaces without revealing their
encrypted values.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_list_secrets_for_authenticated_user',
    description: `Lists all development environment secrets available for a user's codespaces without revealing their
encrypted values.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` or \`codespace:secrets\` scope to use this endpoint.`,
    inputSchema: github.CodespacesListSecretsForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesListSecretsForAuthenticatedUser(
    params: github.CodespacesListSecretsForAuthenticatedUserParams
  ): Promise<github.CodespacesListSecretsForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/codespaces/secrets', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.CodespacesListSecretsForAuthenticatedUserResponse>()
  }

  /**
 * Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_get_public_key_for_authenticated_user',
    description: `Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` or \`codespace:secrets\` scope to use this endpoint.`,
    inputSchema: github.CodespacesGetPublicKeyForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesGetPublicKeyForAuthenticatedUser(
    _params: github.CodespacesGetPublicKeyForAuthenticatedUserParams
  ): Promise<github.CodespacesGetPublicKeyForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/codespaces/secrets/public-key')
      .json<github.CodespacesGetPublicKeyForAuthenticatedUserResponse>()
  }

  /**
 * Gets a development environment secret available to a user's codespaces without revealing its encrypted value.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_get_secret_for_authenticated_user',
    description: `Gets a development environment secret available to a user's codespaces without revealing its encrypted value.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` or \`codespace:secrets\` scope to use this endpoint.`,
    inputSchema: github.CodespacesGetSecretForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesGetSecretForAuthenticatedUser(
    params: github.CodespacesGetSecretForAuthenticatedUserParams
  ): Promise<github.CodespacesGetSecretForAuthenticatedUserResponse> {
    return this.ky
      .get(`/user/codespaces/secrets/${params.secret_name}`)
      .json<github.CodespacesGetSecretForAuthenticatedUserResponse>()
  }

  /**
 * Creates or updates a development environment secret for a user's codespace with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_create_or_update_secret_for_authenticated_user',
    description: `Creates or updates a development environment secret for a user's codespace with an encrypted value. Encrypt your secret using
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` or \`codespace:secrets\` scope to use this endpoint.`,
    inputSchema:
      github.CodespacesCreateOrUpdateSecretForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesCreateOrUpdateSecretForAuthenticatedUser(
    params: github.CodespacesCreateOrUpdateSecretForAuthenticatedUserParams
  ): Promise<github.CodespacesCreateOrUpdateSecretForAuthenticatedUserResponse> {
    return this.ky
      .put(`/user/codespaces/secrets/${params.secret_name}`, {
        json: pick(
          params,
          'encrypted_value',
          'key_id',
          'selected_repository_ids'
        )
      })
      .json<github.CodespacesCreateOrUpdateSecretForAuthenticatedUserResponse>()
  }

  /**
 * Deletes a development environment 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.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_delete_secret_for_authenticated_user',
    description: `Deletes a development environment 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.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` or \`codespace:secrets\` scope to use this endpoint.`,
    inputSchema: github.CodespacesDeleteSecretForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesDeleteSecretForAuthenticatedUser(
    params: github.CodespacesDeleteSecretForAuthenticatedUserParams
  ): Promise<github.CodespacesDeleteSecretForAuthenticatedUserResponse> {
    return this.ky
      .delete(`/user/codespaces/secrets/${params.secret_name}`)
      .json<github.CodespacesDeleteSecretForAuthenticatedUserResponse>()
  }

  /**
 * List the repositories that have been granted the ability to use a user's development environment secret.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_list_repositories_for_secret_for_authenticated_user',
    description: `List the repositories that have been granted the ability to use a user's development environment secret.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` or \`codespace:secrets\` scope to use this endpoint.`,
    inputSchema:
      github.CodespacesListRepositoriesForSecretForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesListRepositoriesForSecretForAuthenticatedUser(
    params: github.CodespacesListRepositoriesForSecretForAuthenticatedUserParams
  ): Promise<github.CodespacesListRepositoriesForSecretForAuthenticatedUserResponse> {
    return this.ky
      .get(`/user/codespaces/secrets/${params.secret_name}/repositories`)
      .json<github.CodespacesListRepositoriesForSecretForAuthenticatedUserResponse>()
  }

  /**
 * Select the repositories that will use a user's development environment secret.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_set_repositories_for_secret_for_authenticated_user',
    description: `Select the repositories that will use a user's development environment secret.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` or \`codespace:secrets\` scope to use this endpoint.`,
    inputSchema:
      github.CodespacesSetRepositoriesForSecretForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesSetRepositoriesForSecretForAuthenticatedUser(
    params: github.CodespacesSetRepositoriesForSecretForAuthenticatedUserParams
  ): Promise<github.CodespacesSetRepositoriesForSecretForAuthenticatedUserResponse> {
    return this.ky
      .put(`/user/codespaces/secrets/${params.secret_name}/repositories`, {
        json: pick(params, 'selected_repository_ids')
      })
      .json<github.CodespacesSetRepositoriesForSecretForAuthenticatedUserResponse>()
  }

  /**
 * Adds a repository to the selected repositories for a user's development environment secret.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_add_repository_for_secret_for_authenticated_user',
    description: `Adds a repository to the selected repositories for a user's development environment secret.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` or \`codespace:secrets\` scope to use this endpoint.`,
    inputSchema:
      github.CodespacesAddRepositoryForSecretForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesAddRepositoryForSecretForAuthenticatedUser(
    params: github.CodespacesAddRepositoryForSecretForAuthenticatedUserParams
  ): Promise<github.CodespacesAddRepositoryForSecretForAuthenticatedUserResponse> {
    return this.ky
      .put(
        `/user/codespaces/secrets/${params.secret_name}/repositories/${params.repository_id}`,
        {}
      )
      .json<github.CodespacesAddRepositoryForSecretForAuthenticatedUserResponse>()
  }

  /**
 * Removes a repository from the selected repositories for a user's development environment secret.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_remove_repository_for_secret_for_authenticated_user',
    description: `Removes a repository from the selected repositories for a user's development environment secret.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` or \`codespace:secrets\` scope to use this endpoint.`,
    inputSchema:
      github.CodespacesRemoveRepositoryForSecretForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesRemoveRepositoryForSecretForAuthenticatedUser(
    params: github.CodespacesRemoveRepositoryForSecretForAuthenticatedUserParams
  ): Promise<github.CodespacesRemoveRepositoryForSecretForAuthenticatedUserResponse> {
    return this.ky
      .delete(
        `/user/codespaces/secrets/${params.secret_name}/repositories/${params.repository_id}`,
        {}
      )
      .json<github.CodespacesRemoveRepositoryForSecretForAuthenticatedUserResponse>()
  }

  /**
 * Gets information about a user's codespace.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_get_for_authenticated_user',
    description: `Gets information about a user's codespace.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema: github.CodespacesGetForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesGetForAuthenticatedUser(
    params: github.CodespacesGetForAuthenticatedUserParams
  ): Promise<github.CodespacesGetForAuthenticatedUserResponse> {
    return this.ky
      .get(`/user/codespaces/${params.codespace_name}`)
      .json<github.CodespacesGetForAuthenticatedUserResponse>()
  }

  /**
 * Deletes a user's codespace.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_delete_for_authenticated_user',
    description: `Deletes a user's codespace.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema: github.CodespacesDeleteForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesDeleteForAuthenticatedUser(
    params: github.CodespacesDeleteForAuthenticatedUserParams
  ): Promise<github.CodespacesDeleteForAuthenticatedUserResponse> {
    return this.ky
      .delete(`/user/codespaces/${params.codespace_name}`)
      .json<github.CodespacesDeleteForAuthenticatedUserResponse>()
  }

  /**
 * Updates a codespace owned by the authenticated user. Currently only the codespace's machine type and recent folders can be modified using this endpoint.

If you specify a new machine type it will be applied the next time your codespace is started.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_update_for_authenticated_user',
    description: `Updates a codespace owned by the authenticated user. Currently only the codespace's machine type and recent folders can be modified using this endpoint.

If you specify a new machine type it will be applied the next time your codespace is started.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema: github.CodespacesUpdateForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesUpdateForAuthenticatedUser(
    params: github.CodespacesUpdateForAuthenticatedUserParams
  ): Promise<github.CodespacesUpdateForAuthenticatedUserResponse> {
    return this.ky
      .patch(`/user/codespaces/${params.codespace_name}`, {
        json: pick(params, 'machine', 'display_name', 'recent_folders')
      })
      .json<github.CodespacesUpdateForAuthenticatedUserResponse>()
  }

  /**
 * Triggers an export of the specified codespace and returns a URL and ID where the status of the export can be monitored.

If changes cannot be pushed to the codespace's repository, they will be pushed to a new or previously-existing fork instead.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_export_for_authenticated_user',
    description: `Triggers an export of the specified codespace and returns a URL and ID where the status of the export can be monitored.

If changes cannot be pushed to the codespace's repository, they will be pushed to a new or previously-existing fork instead.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema: github.CodespacesExportForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesExportForAuthenticatedUser(
    params: github.CodespacesExportForAuthenticatedUserParams
  ): Promise<github.CodespacesExportForAuthenticatedUserResponse> {
    return this.ky
      .post(`/user/codespaces/${params.codespace_name}/exports`)
      .json<github.CodespacesExportForAuthenticatedUserResponse>()
  }

  /**
 * Gets information about an export of a codespace.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_get_export_details_for_authenticated_user',
    description: `Gets information about an export of a codespace.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema:
      github.CodespacesGetExportDetailsForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesGetExportDetailsForAuthenticatedUser(
    params: github.CodespacesGetExportDetailsForAuthenticatedUserParams
  ): Promise<github.CodespacesGetExportDetailsForAuthenticatedUserResponse> {
    return this.ky
      .get(
        `/user/codespaces/${params.codespace_name}/exports/${params.export_id}`,
        {}
      )
      .json<github.CodespacesGetExportDetailsForAuthenticatedUserResponse>()
  }

  /**
 * List the machine types a codespace can transition to use.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_codespace_machines_for_authenticated_user',
    description: `List the machine types a codespace can transition to use.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema:
      github.CodespacesCodespaceMachinesForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesCodespaceMachinesForAuthenticatedUser(
    params: github.CodespacesCodespaceMachinesForAuthenticatedUserParams
  ): Promise<github.CodespacesCodespaceMachinesForAuthenticatedUserResponse> {
    return this.ky
      .get(`/user/codespaces/${params.codespace_name}/machines`)
      .json<github.CodespacesCodespaceMachinesForAuthenticatedUserResponse>()
  }

  /**
 * Publishes an unpublished codespace, creating a new repository and assigning it to the codespace.

The codespace's token is granted write permissions to the repository, allowing the user to push their changes.

This will fail for a codespace that is already published, meaning it has an associated repository.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_publish_for_authenticated_user',
    description: `Publishes an unpublished codespace, creating a new repository and assigning it to the codespace.

The codespace's token is granted write permissions to the repository, allowing the user to push their changes.

This will fail for a codespace that is already published, meaning it has an associated repository.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema: github.CodespacesPublishForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesPublishForAuthenticatedUser(
    params: github.CodespacesPublishForAuthenticatedUserParams
  ): Promise<github.CodespacesPublishForAuthenticatedUserResponse> {
    return this.ky
      .post(`/user/codespaces/${params.codespace_name}/publish`, {
        json: pick(params, 'name', 'private')
      })
      .json<github.CodespacesPublishForAuthenticatedUserResponse>()
  }

  /**
 * Starts a user's codespace.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_start_for_authenticated_user',
    description: `Starts a user's codespace.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema: github.CodespacesStartForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesStartForAuthenticatedUser(
    params: github.CodespacesStartForAuthenticatedUserParams
  ): Promise<github.CodespacesStartForAuthenticatedUserResponse> {
    return this.ky
      .post(`/user/codespaces/${params.codespace_name}/start`)
      .json<github.CodespacesStartForAuthenticatedUserResponse>()
  }

  /**
 * Stops a user's codespace.

OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_codespaces_stop_for_authenticated_user',
    description: `Stops a user's codespace.

OAuth app tokens and personal access tokens (classic) need the \`codespace\` scope to use this endpoint.`,
    inputSchema: github.CodespacesStopForAuthenticatedUserParamsSchema,
    tags: ['codespaces']
  })
  async codespacesStopForAuthenticatedUser(
    params: github.CodespacesStopForAuthenticatedUserParams
  ): Promise<github.CodespacesStopForAuthenticatedUserResponse> {
    return this.ky
      .post(`/user/codespaces/${params.codespace_name}/stop`)
      .json<github.CodespacesStopForAuthenticatedUserResponse>()
  }

  /**
 * Lists all packages that are owned by the authenticated user within the user's namespace, and that encountered a conflict during a Docker migration.

OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_packages_list_docker_migration_conflicting_packages_for_authenticated_user',
    description: `Lists all packages that are owned by the authenticated user within the user's namespace, and that encountered a conflict during a Docker migration.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` scope to use this endpoint.`,
    inputSchema:
      github.PackagesListDockerMigrationConflictingPackagesForAuthenticatedUserParamsSchema,
    tags: ['packages']
  })
  async packagesListDockerMigrationConflictingPackagesForAuthenticatedUser(
    _params: github.PackagesListDockerMigrationConflictingPackagesForAuthenticatedUserParams
  ): Promise<github.PackagesListDockerMigrationConflictingPackagesForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/docker/conflicts')
      .json<github.PackagesListDockerMigrationConflictingPackagesForAuthenticatedUserResponse>()
  }

  /**
   * Sets the visibility for your primary email addresses.
   */
  @aiFunction({
    name: 'github_users_set_primary_email_visibility_for_authenticated_user',
    description: `Sets the visibility for your primary email addresses.`,
    inputSchema:
      github.UsersSetPrimaryEmailVisibilityForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersSetPrimaryEmailVisibilityForAuthenticatedUser(
    params: github.UsersSetPrimaryEmailVisibilityForAuthenticatedUserParams
  ): Promise<github.UsersSetPrimaryEmailVisibilityForAuthenticatedUserResponse> {
    return this.ky
      .patch('/user/email/visibility', {
        json: params
      })
      .json<github.UsersSetPrimaryEmailVisibilityForAuthenticatedUserResponse>()
  }

  /**
 * Lists all of your email addresses, and specifies which one is visible
to the public.

OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_list_emails_for_authenticated_user',
    description: `Lists all of your email addresses, and specifies which one is visible
to the public.

OAuth app tokens and personal access tokens (classic) need the \`user:email\` scope to use this endpoint.`,
    inputSchema: github.UsersListEmailsForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersListEmailsForAuthenticatedUser(
    params: github.UsersListEmailsForAuthenticatedUserParams
  ): Promise<github.UsersListEmailsForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/emails', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.UsersListEmailsForAuthenticatedUserResponse>()
  }

  /**
   * OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint.
   */
  @aiFunction({
    name: 'github_users_add_email_for_authenticated_user',
    description: `OAuth app tokens and personal access tokens (classic) need the \`user\` scope to use this endpoint.`,
    // TODO: Improve handling of union params
    inputSchema: github.UsersAddEmailForAuthenticatedUserParamsSchema as any,
    tags: ['users']
  })
  async usersAddEmailForAuthenticatedUser(
    params: github.UsersAddEmailForAuthenticatedUserParams
  ): Promise<github.UsersAddEmailForAuthenticatedUserResponse> {
    return this.ky
      .post('/user/emails', {
        json: params
      })
      .json<github.UsersAddEmailForAuthenticatedUserResponse>()
  }

  /**
   * OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint.
   */
  @aiFunction({
    name: 'github_users_delete_email_for_authenticated_user',
    description: `OAuth app tokens and personal access tokens (classic) need the \`user\` scope to use this endpoint.`,
    // TODO: Improve handling of union params
    inputSchema: github.UsersDeleteEmailForAuthenticatedUserParamsSchema as any,
    tags: ['users']
  })
  async usersDeleteEmailForAuthenticatedUser(
    params: github.UsersDeleteEmailForAuthenticatedUserParams
  ): Promise<github.UsersDeleteEmailForAuthenticatedUserResponse> {
    return this.ky
      .delete('/user/emails', {
        json: params
      })
      .json<github.UsersDeleteEmailForAuthenticatedUserResponse>()
  }

  /**
   * Lists the people following the authenticated user.
   */
  @aiFunction({
    name: 'github_users_list_followers_for_authenticated_user',
    description: `Lists the people following the authenticated user.`,
    inputSchema: github.UsersListFollowersForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersListFollowersForAuthenticatedUser(
    params: github.UsersListFollowersForAuthenticatedUserParams
  ): Promise<github.UsersListFollowersForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/followers', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.UsersListFollowersForAuthenticatedUserResponse>()
  }

  /**
   * Lists the people who the authenticated user follows.
   */
  @aiFunction({
    name: 'github_users_list_followed_by_authenticated_user',
    description: `Lists the people who the authenticated user follows.`,
    inputSchema: github.UsersListFollowedByAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersListFollowedByAuthenticatedUser(
    params: github.UsersListFollowedByAuthenticatedUserParams
  ): Promise<github.UsersListFollowedByAuthenticatedUserResponse> {
    return this.ky
      .get('/user/following', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.UsersListFollowedByAuthenticatedUserResponse>()
  }

  /**
   * Check if a person is followed by the authenticated user.
   */
  @aiFunction({
    name: 'github_users_check_person_is_followed_by_authenticated',
    description: `Check if a person is followed by the authenticated user.`,
    inputSchema: github.UsersCheckPersonIsFollowedByAuthenticatedParamsSchema,
    tags: ['users']
  })
  async usersCheckPersonIsFollowedByAuthenticated(
    params: github.UsersCheckPersonIsFollowedByAuthenticatedParams
  ): Promise<github.UsersCheckPersonIsFollowedByAuthenticatedResponse> {
    return this.ky
      .get(`/user/following/${params.username}`)
      .json<github.UsersCheckPersonIsFollowedByAuthenticatedResponse>()
  }

  /**
 * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."

OAuth app tokens and personal access tokens (classic) need the `user:follow` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_follow',
    description: `Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."

OAuth app tokens and personal access tokens (classic) need the \`user:follow\` scope to use this endpoint.`,
    inputSchema: github.UsersFollowParamsSchema,
    tags: ['users']
  })
  async usersFollow(
    params: github.UsersFollowParams
  ): Promise<github.UsersFollowResponse> {
    return this.ky
      .put(`/user/following/${params.username}`)
      .json<github.UsersFollowResponse>()
  }

  /**
   * OAuth app tokens and personal access tokens (classic) need the `user:follow` scope to use this endpoint.
   */
  @aiFunction({
    name: 'github_users_unfollow',
    description: `OAuth app tokens and personal access tokens (classic) need the \`user:follow\` scope to use this endpoint.`,
    inputSchema: github.UsersUnfollowParamsSchema,
    tags: ['users']
  })
  async usersUnfollow(
    params: github.UsersUnfollowParams
  ): Promise<github.UsersUnfollowResponse> {
    return this.ky
      .delete(`/user/following/${params.username}`)
      .json<github.UsersUnfollowResponse>()
  }

  /**
 * Lists the current user's GPG keys.

OAuth app tokens and personal access tokens (classic) need the `read:gpg_key` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_list_gpg_keys_for_authenticated_user',
    description: `Lists the current user's GPG keys.

OAuth app tokens and personal access tokens (classic) need the \`read:gpg_key\` scope to use this endpoint.`,
    inputSchema: github.UsersListGpgKeysForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersListGpgKeysForAuthenticatedUser(
    params: github.UsersListGpgKeysForAuthenticatedUserParams
  ): Promise<github.UsersListGpgKeysForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/gpg_keys', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.UsersListGpgKeysForAuthenticatedUserResponse>()
  }

  /**
 * Adds a GPG key to the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_create_gpg_key_for_authenticated_user',
    description: `Adds a GPG key to the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the \`write:gpg_key\` scope to use this endpoint.`,
    inputSchema: github.UsersCreateGpgKeyForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersCreateGpgKeyForAuthenticatedUser(
    params: github.UsersCreateGpgKeyForAuthenticatedUserParams
  ): Promise<github.UsersCreateGpgKeyForAuthenticatedUserResponse> {
    return this.ky
      .post('/user/gpg_keys', {
        json: pick(params, 'name', 'armored_public_key')
      })
      .json<github.UsersCreateGpgKeyForAuthenticatedUserResponse>()
  }

  /**
 * View extended details for a single GPG key.

OAuth app tokens and personal access tokens (classic) need the `read:gpg_key` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_get_gpg_key_for_authenticated_user',
    description: `View extended details for a single GPG key.

OAuth app tokens and personal access tokens (classic) need the \`read:gpg_key\` scope to use this endpoint.`,
    inputSchema: github.UsersGetGpgKeyForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersGetGpgKeyForAuthenticatedUser(
    params: github.UsersGetGpgKeyForAuthenticatedUserParams
  ): Promise<github.UsersGetGpgKeyForAuthenticatedUserResponse> {
    return this.ky
      .get(`/user/gpg_keys/${params.gpg_key_id}`)
      .json<github.UsersGetGpgKeyForAuthenticatedUserResponse>()
  }

  /**
 * Removes a GPG key from the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the `admin:gpg_key` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_delete_gpg_key_for_authenticated_user',
    description: `Removes a GPG key from the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the \`admin:gpg_key\` scope to use this endpoint.`,
    inputSchema: github.UsersDeleteGpgKeyForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersDeleteGpgKeyForAuthenticatedUser(
    params: github.UsersDeleteGpgKeyForAuthenticatedUserParams
  ): Promise<github.UsersDeleteGpgKeyForAuthenticatedUserResponse> {
    return this.ky
      .delete(`/user/gpg_keys/${params.gpg_key_id}`)
      .json<github.UsersDeleteGpgKeyForAuthenticatedUserResponse>()
  }

  /**
 * Lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.

The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.

You can find the permissions for the installation under the `permissions` key.
 */
  @aiFunction({
    name: 'github_apps_list_installations_for_authenticated_user',
    description: `Lists installations of your GitHub App that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access.

The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.

You can find the permissions for the installation under the \`permissions\` key.`,
    inputSchema: github.AppsListInstallationsForAuthenticatedUserParamsSchema,
    tags: ['apps']
  })
  async appsListInstallationsForAuthenticatedUser(
    params: github.AppsListInstallationsForAuthenticatedUserParams
  ): Promise<github.AppsListInstallationsForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/installations', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.AppsListInstallationsForAuthenticatedUserResponse>()
  }

  /**
 * List repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access for an installation.

The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.

The access the user has to each repository is included in the hash under the `permissions` key.
 */
  @aiFunction({
    name: 'github_apps_list_installation_repos_for_authenticated_user',
    description: `List repositories that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access for an installation.

The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.

The access the user has to each repository is included in the hash under the \`permissions\` key.`,
    inputSchema:
      github.AppsListInstallationReposForAuthenticatedUserParamsSchema,
    tags: ['apps']
  })
  async appsListInstallationReposForAuthenticatedUser(
    params: github.AppsListInstallationReposForAuthenticatedUserParams
  ): Promise<github.AppsListInstallationReposForAuthenticatedUserResponse> {
    return this.ky
      .get(`/user/installations/${params.installation_id}/repositories`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.AppsListInstallationReposForAuthenticatedUserResponse>()
  }

  /**
 * Add a single repository to an installation. The authenticated user must have admin access to the repository.

This endpoint only works for PATs (classic) with the `repo` scope.
 */
  @aiFunction({
    name: 'github_apps_add_repo_to_installation_for_authenticated_user',
    description: `Add a single repository to an installation. The authenticated user must have admin access to the repository.

This endpoint only works for PATs (classic) with the \`repo\` scope.`,
    inputSchema:
      github.AppsAddRepoToInstallationForAuthenticatedUserParamsSchema,
    tags: ['apps']
  })
  async appsAddRepoToInstallationForAuthenticatedUser(
    params: github.AppsAddRepoToInstallationForAuthenticatedUserParams
  ): Promise<github.AppsAddRepoToInstallationForAuthenticatedUserResponse> {
    return this.ky
      .put(
        `/user/installations/${params.installation_id}/repositories/${params.repository_id}`,
        {}
      )
      .json<github.AppsAddRepoToInstallationForAuthenticatedUserResponse>()
  }

  /**
 * Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the `repository_selection` of `selected`.

This endpoint only works for PATs (classic) with the `repo` scope.
 */
  @aiFunction({
    name: 'github_apps_remove_repo_from_installation_for_authenticated_user',
    description: `Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the \`repository_selection\` of \`selected\`.

This endpoint only works for PATs (classic) with the \`repo\` scope.`,
    inputSchema:
      github.AppsRemoveRepoFromInstallationForAuthenticatedUserParamsSchema,
    tags: ['apps']
  })
  async appsRemoveRepoFromInstallationForAuthenticatedUser(
    params: github.AppsRemoveRepoFromInstallationForAuthenticatedUserParams
  ): Promise<github.AppsRemoveRepoFromInstallationForAuthenticatedUserResponse> {
    return this.ky
      .delete(
        `/user/installations/${params.installation_id}/repositories/${params.repository_id}`,
        {}
      )
      .json<github.AppsRemoveRepoFromInstallationForAuthenticatedUserResponse>()
  }

  /**
   * Shows which type of GitHub user can interact with your public repositories and when the restriction expires.
   */
  @aiFunction({
    name: 'github_interactions_get_restrictions_for_authenticated_user',
    description: `Shows which type of GitHub user can interact with your public repositories and when the restriction expires.`,
    inputSchema:
      github.InteractionsGetRestrictionsForAuthenticatedUserParamsSchema,
    tags: ['interactions']
  })
  async interactionsGetRestrictionsForAuthenticatedUser(
    _params: github.InteractionsGetRestrictionsForAuthenticatedUserParams
  ): Promise<github.InteractionsGetRestrictionsForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/interaction-limits')
      .json<github.InteractionsGetRestrictionsForAuthenticatedUserResponse>()
  }

  /**
   * Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user.
   */
  @aiFunction({
    name: 'github_interactions_set_restrictions_for_authenticated_user',
    description: `Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user.`,
    inputSchema:
      github.InteractionsSetRestrictionsForAuthenticatedUserParamsSchema,
    tags: ['interactions']
  })
  async interactionsSetRestrictionsForAuthenticatedUser(
    params: github.InteractionsSetRestrictionsForAuthenticatedUserParams
  ): Promise<github.InteractionsSetRestrictionsForAuthenticatedUserResponse> {
    return this.ky
      .put('/user/interaction-limits', {
        json: pick(params, 'limit', 'expiry')
      })
      .json<github.InteractionsSetRestrictionsForAuthenticatedUserResponse>()
  }

  /**
   * Removes any interaction restrictions from your public repositories.
   */
  @aiFunction({
    name: 'github_interactions_remove_restrictions_for_authenticated_user',
    description: `Removes any interaction restrictions from your public repositories.`,
    inputSchema:
      github.InteractionsRemoveRestrictionsForAuthenticatedUserParamsSchema,
    tags: ['interactions']
  })
  async interactionsRemoveRestrictionsForAuthenticatedUser(
    _params: github.InteractionsRemoveRestrictionsForAuthenticatedUserParams
  ): Promise<github.InteractionsRemoveRestrictionsForAuthenticatedUserResponse> {
    return this.ky
      .delete('/user/interaction-limits')
      .json<github.InteractionsRemoveRestrictionsForAuthenticatedUserResponse>()
  }

  /**
 * List issues across owned and member repositories assigned to the authenticated user.

> [!NOTE]
> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
 */
  @aiFunction({
    name: 'github_issues_list_for_authenticated_user',
    description: `List issues across owned and member repositories assigned to the authenticated user.

> [!NOTE]
> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the \`pull_request\` key. Be aware that the \`id\` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.raw+json\`**: Returns the raw markdown body. Response will include \`body\`. This is the default if you do not pass any specific media type.
- **\`application/vnd.github.text+json\`**: Returns a text only representation of the markdown body. Response will include \`body_text\`.
- **\`application/vnd.github.html+json\`**: Returns HTML rendered from the body's markdown. Response will include \`body_html\`.
- **\`application/vnd.github.full+json\`**: Returns raw, text, and HTML representations. Response will include \`body\`, \`body_text\`, and \`body_html\`.`,
    inputSchema: github.IssuesListForAuthenticatedUserParamsSchema,
    tags: ['issues']
  })
  async issuesListForAuthenticatedUser(
    params: github.IssuesListForAuthenticatedUserParams
  ): Promise<github.IssuesListForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/issues', {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'filter',
            'state',
            'labels',
            'sort',
            'direction',
            'since',
            'per_page',
            'page'
          )
        )
      })
      .json<github.IssuesListForAuthenticatedUserResponse>()
  }

  /**
 * Lists the public SSH keys for the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the `read:public_key` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_list_public_ssh_keys_for_authenticated_user',
    description: `Lists the public SSH keys for the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the \`read:public_key\` scope to use this endpoint.`,
    inputSchema: github.UsersListPublicSshKeysForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersListPublicSshKeysForAuthenticatedUser(
    params: github.UsersListPublicSshKeysForAuthenticatedUserParams
  ): Promise<github.UsersListPublicSshKeysForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/keys', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.UsersListPublicSshKeysForAuthenticatedUserResponse>()
  }

  /**
 * Adds a public SSH key to the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_create_public_ssh_key_for_authenticated_user',
    description: `Adds a public SSH key to the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the \`write:gpg_key\` scope to use this endpoint.`,
    inputSchema: github.UsersCreatePublicSshKeyForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersCreatePublicSshKeyForAuthenticatedUser(
    params: github.UsersCreatePublicSshKeyForAuthenticatedUserParams
  ): Promise<github.UsersCreatePublicSshKeyForAuthenticatedUserResponse> {
    return this.ky
      .post('/user/keys', {
        json: pick(params, 'title', 'key')
      })
      .json<github.UsersCreatePublicSshKeyForAuthenticatedUserResponse>()
  }

  /**
 * View extended details for a single public SSH key.

OAuth app tokens and personal access tokens (classic) need the `read:public_key` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_get_public_ssh_key_for_authenticated_user',
    description: `View extended details for a single public SSH key.

OAuth app tokens and personal access tokens (classic) need the \`read:public_key\` scope to use this endpoint.`,
    inputSchema: github.UsersGetPublicSshKeyForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersGetPublicSshKeyForAuthenticatedUser(
    params: github.UsersGetPublicSshKeyForAuthenticatedUserParams
  ): Promise<github.UsersGetPublicSshKeyForAuthenticatedUserResponse> {
    return this.ky
      .get(`/user/keys/${params.key_id}`)
      .json<github.UsersGetPublicSshKeyForAuthenticatedUserResponse>()
  }

  /**
 * Removes a public SSH key from the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the `admin:public_key` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_delete_public_ssh_key_for_authenticated_user',
    description: `Removes a public SSH key from the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the \`admin:public_key\` scope to use this endpoint.`,
    inputSchema: github.UsersDeletePublicSshKeyForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersDeletePublicSshKeyForAuthenticatedUser(
    params: github.UsersDeletePublicSshKeyForAuthenticatedUserParams
  ): Promise<github.UsersDeletePublicSshKeyForAuthenticatedUserResponse> {
    return this.ky
      .delete(`/user/keys/${params.key_id}`)
      .json<github.UsersDeletePublicSshKeyForAuthenticatedUserResponse>()
  }

  /**
   * Lists the active subscriptions for the authenticated user.
   */
  @aiFunction({
    name: 'github_apps_list_subscriptions_for_authenticated_user',
    description: `Lists the active subscriptions for the authenticated user.`,
    inputSchema: github.AppsListSubscriptionsForAuthenticatedUserParamsSchema,
    tags: ['apps']
  })
  async appsListSubscriptionsForAuthenticatedUser(
    params: github.AppsListSubscriptionsForAuthenticatedUserParams
  ): Promise<github.AppsListSubscriptionsForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/marketplace_purchases', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.AppsListSubscriptionsForAuthenticatedUserResponse>()
  }

  /**
   * Lists the active subscriptions for the authenticated user.
   */
  @aiFunction({
    name: 'github_apps_list_subscriptions_for_authenticated_user_stubbed',
    description: `Lists the active subscriptions for the authenticated user.`,
    inputSchema:
      github.AppsListSubscriptionsForAuthenticatedUserStubbedParamsSchema,
    tags: ['apps']
  })
  async appsListSubscriptionsForAuthenticatedUserStubbed(
    params: github.AppsListSubscriptionsForAuthenticatedUserStubbedParams
  ): Promise<github.AppsListSubscriptionsForAuthenticatedUserStubbedResponse> {
    return this.ky
      .get('/user/marketplace_purchases/stubbed', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.AppsListSubscriptionsForAuthenticatedUserStubbedResponse>()
  }

  /**
   * Lists all of the authenticated user's organization memberships.
   */
  @aiFunction({
    name: 'github_orgs_list_memberships_for_authenticated_user',
    description: `Lists all of the authenticated user's organization memberships.`,
    inputSchema: github.OrgsListMembershipsForAuthenticatedUserParamsSchema,
    tags: ['orgs']
  })
  async orgsListMembershipsForAuthenticatedUser(
    params: github.OrgsListMembershipsForAuthenticatedUserParams
  ): Promise<github.OrgsListMembershipsForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/memberships/orgs', {
        searchParams: sanitizeSearchParams(
          pick(params, 'state', 'per_page', 'page')
        )
      })
      .json<github.OrgsListMembershipsForAuthenticatedUserResponse>()
  }

  /**
   * If the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a `404` is returned. This endpoint will return a `403` if the request is made by a GitHub App that is blocked by the organization.
   */
  @aiFunction({
    name: 'github_orgs_get_membership_for_authenticated_user',
    description: `If the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a \`404\` is returned. This endpoint will return a \`403\` if the request is made by a GitHub App that is blocked by the organization.`,
    inputSchema: github.OrgsGetMembershipForAuthenticatedUserParamsSchema,
    tags: ['orgs']
  })
  async orgsGetMembershipForAuthenticatedUser(
    params: github.OrgsGetMembershipForAuthenticatedUserParams
  ): Promise<github.OrgsGetMembershipForAuthenticatedUserResponse> {
    return this.ky
      .get(`/user/memberships/orgs/${params.org}`)
      .json<github.OrgsGetMembershipForAuthenticatedUserResponse>()
  }

  /**
   * Converts the authenticated user to an active member of the organization, if that user has a pending invitation from the organization.
   */
  @aiFunction({
    name: 'github_orgs_update_membership_for_authenticated_user',
    description: `Converts the authenticated user to an active member of the organization, if that user has a pending invitation from the organization.`,
    inputSchema: github.OrgsUpdateMembershipForAuthenticatedUserParamsSchema,
    tags: ['orgs']
  })
  async orgsUpdateMembershipForAuthenticatedUser(
    params: github.OrgsUpdateMembershipForAuthenticatedUserParams
  ): Promise<github.OrgsUpdateMembershipForAuthenticatedUserResponse> {
    return this.ky
      .patch(`/user/memberships/orgs/${params.org}`, {
        json: pick(params, 'state')
      })
      .json<github.OrgsUpdateMembershipForAuthenticatedUserResponse>()
  }

  /**
   * Lists all migrations a user has started.
   */
  @aiFunction({
    name: 'github_migrations_list_for_authenticated_user',
    description: `Lists all migrations a user has started.`,
    inputSchema: github.MigrationsListForAuthenticatedUserParamsSchema,
    tags: ['migrations']
  })
  async migrationsListForAuthenticatedUser(
    params: github.MigrationsListForAuthenticatedUserParams
  ): Promise<github.MigrationsListForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/migrations', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.MigrationsListForAuthenticatedUserResponse>()
  }

  /**
   * Initiates the generation of a user migration archive.
   */
  @aiFunction({
    name: 'github_migrations_start_for_authenticated_user',
    description: `Initiates the generation of a user migration archive.`,
    inputSchema: github.MigrationsStartForAuthenticatedUserParamsSchema,
    tags: ['migrations']
  })
  async migrationsStartForAuthenticatedUser(
    params: github.MigrationsStartForAuthenticatedUserParams
  ): Promise<github.MigrationsStartForAuthenticatedUserResponse> {
    return this.ky
      .post('/user/migrations', {
        json: pick(
          params,
          'lock_repositories',
          'exclude_metadata',
          'exclude_git_data',
          'exclude_attachments',
          'exclude_releases',
          'exclude_owner_projects',
          'org_metadata_only',
          'exclude',
          'repositories'
        )
      })
      .json<github.MigrationsStartForAuthenticatedUserResponse>()
  }

  /**
 * Fetches a single user migration. The response includes the `state` of the migration, which can be one of the following values:

*   `pending` - the migration hasn't started yet.
*   `exporting` - the migration is in progress.
*   `exported` - the migration finished successfully.
*   `failed` - the migration failed.

Once the migration has been `exported` you can [download the migration archive](https://docs.github.com/rest/migrations/users#download-a-user-migration-archive).
 */
  @aiFunction({
    name: 'github_migrations_get_status_for_authenticated_user',
    description: `Fetches a single user migration. The response includes the \`state\` of the migration, which can be one of the following values:

*   \`pending\` - the migration hasn't started yet.
*   \`exporting\` - the migration is in progress.
*   \`exported\` - the migration finished successfully.
*   \`failed\` - the migration failed.

Once the migration has been \`exported\` you can [download the migration archive](https://docs.github.com/rest/migrations/users#download-a-user-migration-archive).`,
    inputSchema: github.MigrationsGetStatusForAuthenticatedUserParamsSchema,
    tags: ['migrations']
  })
  async migrationsGetStatusForAuthenticatedUser(
    params: github.MigrationsGetStatusForAuthenticatedUserParams
  ): Promise<github.MigrationsGetStatusForAuthenticatedUserResponse> {
    return this.ky
      .get(`/user/migrations/${params.migration_id}`, {
        searchParams: sanitizeSearchParams(pick(params, 'exclude'))
      })
      .json<github.MigrationsGetStatusForAuthenticatedUserResponse>()
  }

  /**
 * Fetches the URL to download the migration archive as a `tar.gz` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects:

*   attachments
*   bases
*   commit\_comments
*   issue\_comments
*   issue\_events
*   issues
*   milestones
*   organizations
*   projects
*   protected\_branches
*   pull\_request\_reviews
*   pull\_requests
*   releases
*   repositories
*   review\_comments
*   schema
*   users

The archive will also contain an `attachments` directory that includes all attachment files uploaded to GitHub.com and a `repositories` directory that contains the repository's Git data.
 */
  @aiFunction({
    name: 'github_migrations_get_archive_for_authenticated_user',
    description: `Fetches the URL to download the migration archive as a \`tar.gz\` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects:

*   attachments
*   bases
*   commit\_comments
*   issue\_comments
*   issue\_events
*   issues
*   milestones
*   organizations
*   projects
*   protected\_branches
*   pull\_request\_reviews
*   pull\_requests
*   releases
*   repositories
*   review\_comments
*   schema
*   users

The archive will also contain an \`attachments\` directory that includes all attachment files uploaded to GitHub.com and a \`repositories\` directory that contains the repository's Git data.`,
    inputSchema: github.MigrationsGetArchiveForAuthenticatedUserParamsSchema,
    tags: ['migrations']
  })
  async migrationsGetArchiveForAuthenticatedUser(
    params: github.MigrationsGetArchiveForAuthenticatedUserParams
  ): Promise<github.MigrationsGetArchiveForAuthenticatedUserResponse> {
    return this.ky
      .get(`/user/migrations/${params.migration_id}/archive`)
      .json<github.MigrationsGetArchiveForAuthenticatedUserResponse>()
  }

  /**
   * Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://docs.github.com/rest/migrations/users#list-user-migrations) and [Get a user migration status](https://docs.github.com/rest/migrations/users#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted.
   */
  @aiFunction({
    name: 'github_migrations_delete_archive_for_authenticated_user',
    description: `Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://docs.github.com/rest/migrations/users#list-user-migrations) and [Get a user migration status](https://docs.github.com/rest/migrations/users#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted.`,
    inputSchema: github.MigrationsDeleteArchiveForAuthenticatedUserParamsSchema,
    tags: ['migrations']
  })
  async migrationsDeleteArchiveForAuthenticatedUser(
    params: github.MigrationsDeleteArchiveForAuthenticatedUserParams
  ): Promise<github.MigrationsDeleteArchiveForAuthenticatedUserResponse> {
    return this.ky
      .delete(`/user/migrations/${params.migration_id}/archive`)
      .json<github.MigrationsDeleteArchiveForAuthenticatedUserResponse>()
  }

  /**
   * Unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/migrations/users#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/repos/repos#delete-a-repository) if you no longer need the source data. Returns a status of `404 Not Found` if the repository is not locked.
   */
  @aiFunction({
    name: 'github_migrations_unlock_repo_for_authenticated_user',
    description: `Unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/migrations/users#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/repos/repos#delete-a-repository) if you no longer need the source data. Returns a status of \`404 Not Found\` if the repository is not locked.`,
    inputSchema: github.MigrationsUnlockRepoForAuthenticatedUserParamsSchema,
    tags: ['migrations']
  })
  async migrationsUnlockRepoForAuthenticatedUser(
    params: github.MigrationsUnlockRepoForAuthenticatedUserParams
  ): Promise<github.MigrationsUnlockRepoForAuthenticatedUserResponse> {
    return this.ky
      .delete(
        `/user/migrations/${params.migration_id}/repos/${params.repo_name}/lock`,
        {}
      )
      .json<github.MigrationsUnlockRepoForAuthenticatedUserResponse>()
  }

  /**
   * Lists all the repositories for this user migration.
   */
  @aiFunction({
    name: 'github_migrations_list_repos_for_authenticated_user',
    description: `Lists all the repositories for this user migration.`,
    inputSchema: github.MigrationsListReposForAuthenticatedUserParamsSchema,
    tags: ['migrations']
  })
  async migrationsListReposForAuthenticatedUser(
    params: github.MigrationsListReposForAuthenticatedUserParams
  ): Promise<github.MigrationsListReposForAuthenticatedUserResponse> {
    return this.ky
      .get(`/user/migrations/${params.migration_id}/repositories`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.MigrationsListReposForAuthenticatedUserResponse>()
  }

  /**
 * List organizations for the authenticated user.

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response.

> [!NOTE]
> Requests using a fine-grained access token will receive a `200 Success` response with an empty list.
 */
  @aiFunction({
    name: 'github_orgs_list_for_authenticated_user',
    description: `List organizations for the authenticated user.

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with \`read:org\` scope, you can publicize your organization membership with \`user\` scope, etc.). Therefore, this API requires at least \`user\` or \`read:org\` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a \`403 Forbidden\` response.

> [!NOTE]
> Requests using a fine-grained access token will receive a \`200 Success\` response with an empty list.`,
    inputSchema: github.OrgsListForAuthenticatedUserParamsSchema,
    tags: ['orgs']
  })
  async orgsListForAuthenticatedUser(
    params: github.OrgsListForAuthenticatedUserParams
  ): Promise<github.OrgsListForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/orgs', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.OrgsListForAuthenticatedUserResponse>()
  }

  /**
 * Lists packages owned by the authenticated user within the user's namespace.

OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_list_packages_for_authenticated_user',
    description: `Lists packages owned by the authenticated user within the user's namespace.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesListPackagesForAuthenticatedUserParamsSchema,
    tags: ['packages']
  })
  async packagesListPackagesForAuthenticatedUser(
    params: github.PackagesListPackagesForAuthenticatedUserParams
  ): Promise<github.PackagesListPackagesForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/packages', {
        searchParams: sanitizeSearchParams(
          pick(params, 'package_type', 'visibility', 'page', 'per_page')
        )
      })
      .json<github.PackagesListPackagesForAuthenticatedUserResponse>()
  }

  /**
 * Gets a specific package for a package owned by the authenticated user.

OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_get_package_for_authenticated_user',
    description: `Gets a specific package for a package owned by the authenticated user.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesGetPackageForAuthenticatedUserParamsSchema,
    tags: ['packages']
  })
  async packagesGetPackageForAuthenticatedUser(
    params: github.PackagesGetPackageForAuthenticatedUserParams
  ): Promise<github.PackagesGetPackageForAuthenticatedUserResponse> {
    return this.ky
      .get(
        `/user/packages/${params.package_type}/${params.package_name}`,
        {}
      )
      .json<github.PackagesGetPackageForAuthenticatedUserResponse>()
  }

  /**
 * Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.

OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_delete_package_for_authenticated_user',
    description: `Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` and \`delete:packages\` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesDeletePackageForAuthenticatedUserParamsSchema,
    tags: ['packages']
  })
  async packagesDeletePackageForAuthenticatedUser(
    params: github.PackagesDeletePackageForAuthenticatedUserParams
  ): Promise<github.PackagesDeletePackageForAuthenticatedUserResponse> {
    return this.ky
      .delete(
        `/user/packages/${params.package_type}/${params.package_name}`,
        {}
      )
      .json<github.PackagesDeletePackageForAuthenticatedUserResponse>()
  }

  /**
 * Restores a package owned by the authenticated user.

You can restore a deleted package under the following conditions:
  - The package was deleted within the last 30 days.
  - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_restore_package_for_authenticated_user',
    description: `Restores a package owned by the authenticated user.

You can restore a deleted package under the following conditions:
  - The package was deleted within the last 30 days.
  - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` and \`write:packages\` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesRestorePackageForAuthenticatedUserParamsSchema,
    tags: ['packages']
  })
  async packagesRestorePackageForAuthenticatedUser(
    params: github.PackagesRestorePackageForAuthenticatedUserParams
  ): Promise<github.PackagesRestorePackageForAuthenticatedUserResponse> {
    return this.ky
      .post(
        `/user/packages/${params.package_type}/${params.package_name}/restore`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'token'))
        }
      )
      .json<github.PackagesRestorePackageForAuthenticatedUserResponse>()
  }

  /**
 * Lists package versions for a package owned by the authenticated user.

OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_get_all_package_versions_for_package_owned_by_authenticated_user',
    description: `Lists package versions for a package owned by the authenticated user.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema:
      github.PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserParamsSchema,
    tags: ['packages']
  })
  async packagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUser(
    params: github.PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserParams
  ): Promise<github.PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserResponse> {
    return this.ky
      .get(
        `/user/packages/${params.package_type}/${params.package_name}/versions`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'page', 'per_page', 'state')
          )
        }
      )
      .json<github.PackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserResponse>()
  }

  /**
 * Gets a specific package version for a package owned by the authenticated user.

OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_get_package_version_for_authenticated_user',
    description: `Gets a specific package version for a package owned by the authenticated user.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema:
      github.PackagesGetPackageVersionForAuthenticatedUserParamsSchema,
    tags: ['packages']
  })
  async packagesGetPackageVersionForAuthenticatedUser(
    params: github.PackagesGetPackageVersionForAuthenticatedUserParams
  ): Promise<github.PackagesGetPackageVersionForAuthenticatedUserResponse> {
    return this.ky
      .get(
        `/user/packages/${params.package_type}/${params.package_name}/versions/${params.package_version_id}`,
        {}
      )
      .json<github.PackagesGetPackageVersionForAuthenticatedUserResponse>()
  }

  /**
 * Deletes a specific package version for a package owned by the authenticated user.  If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.

The authenticated user must have admin permissions in the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_delete_package_version_for_authenticated_user',
    description: `Deletes a specific package version for a package owned by the authenticated user.  If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.

The authenticated user must have admin permissions in the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` and \`delete:packages\` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema:
      github.PackagesDeletePackageVersionForAuthenticatedUserParamsSchema,
    tags: ['packages']
  })
  async packagesDeletePackageVersionForAuthenticatedUser(
    params: github.PackagesDeletePackageVersionForAuthenticatedUserParams
  ): Promise<github.PackagesDeletePackageVersionForAuthenticatedUserResponse> {
    return this.ky
      .delete(
        `/user/packages/${params.package_type}/${params.package_name}/versions/${params.package_version_id}`,
        {}
      )
      .json<github.PackagesDeletePackageVersionForAuthenticatedUserResponse>()
  }

  /**
 * Restores a package version owned by the authenticated user.

You can restore a deleted package version under the following conditions:
  - The package was deleted within the last 30 days.
  - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_restore_package_version_for_authenticated_user',
    description: `Restores a package version owned by the authenticated user.

You can restore a deleted package version under the following conditions:
  - The package was deleted within the last 30 days.
  - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` and \`write:packages\` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema:
      github.PackagesRestorePackageVersionForAuthenticatedUserParamsSchema,
    tags: ['packages']
  })
  async packagesRestorePackageVersionForAuthenticatedUser(
    params: github.PackagesRestorePackageVersionForAuthenticatedUserParams
  ): Promise<github.PackagesRestorePackageVersionForAuthenticatedUserResponse> {
    return this.ky
      .post(
        `/user/packages/${params.package_type}/${params.package_name}/versions/${params.package_version_id}/restore`,
        {}
      )
      .json<github.PackagesRestorePackageVersionForAuthenticatedUserResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_create_for_authenticated_user',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsCreateForAuthenticatedUserParamsSchema,
    tags: ['projects']
  })
  async projectsCreateForAuthenticatedUser(
    params: github.ProjectsCreateForAuthenticatedUserParams
  ): Promise<github.ProjectsCreateForAuthenticatedUserResponse> {
    return this.ky
      .post('/user/projects', {
        json: pick(params, 'name', 'body')
      })
      .json<github.ProjectsCreateForAuthenticatedUserResponse>()
  }

  /**
 * Lists your publicly visible email address, which you can set with the
[Set primary email visibility for the authenticated user](https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user)
endpoint.

OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_list_public_emails_for_authenticated_user',
    description: `Lists your publicly visible email address, which you can set with the
[Set primary email visibility for the authenticated user](https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user)
endpoint.

OAuth app tokens and personal access tokens (classic) need the \`user:email\` scope to use this endpoint.`,
    inputSchema: github.UsersListPublicEmailsForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersListPublicEmailsForAuthenticatedUser(
    params: github.UsersListPublicEmailsForAuthenticatedUserParams
  ): Promise<github.UsersListPublicEmailsForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/public_emails', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.UsersListPublicEmailsForAuthenticatedUserResponse>()
  }

  /**
 * Lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.

The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.
 */
  @aiFunction({
    name: 'github_repos_list_for_authenticated_user',
    description: `Lists repositories that the authenticated user has explicit permission (\`:read\`, \`:write\`, or \`:admin\`) to access.

The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.`,
    inputSchema: github.ReposListForAuthenticatedUserParamsSchema,
    tags: ['repos']
  })
  async reposListForAuthenticatedUser(
    params: github.ReposListForAuthenticatedUserParams
  ): Promise<github.ReposListForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/repos', {
        searchParams: sanitizeSearchParams(
          pick(
            params,
            'visibility',
            'affiliation',
            'type',
            'sort',
            'direction',
            'per_page',
            'page',
            'since',
            'before'
          )
        )
      })
      .json<github.ReposListForAuthenticatedUserResponse>()
  }

  /**
 * Creates a new repository for the authenticated user.

OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository.
 */
  @aiFunction({
    name: 'github_repos_create_for_authenticated_user',
    description: `Creates a new repository for the authenticated user.

OAuth app tokens and personal access tokens (classic) need the \`public_repo\` or \`repo\` scope to create a public repository, and \`repo\` scope to create a private repository.`,
    inputSchema: github.ReposCreateForAuthenticatedUserParamsSchema,
    tags: ['repos']
  })
  async reposCreateForAuthenticatedUser(
    params: github.ReposCreateForAuthenticatedUserParams
  ): Promise<github.ReposCreateForAuthenticatedUserResponse> {
    return this.ky
      .post('/user/repos', {
        json: pick(
          params,
          'name',
          'description',
          'homepage',
          'private',
          'has_issues',
          'has_projects',
          'has_wiki',
          'has_discussions',
          'team_id',
          'auto_init',
          'gitignore_template',
          'license_template',
          'allow_squash_merge',
          'allow_merge_commit',
          'allow_rebase_merge',
          'allow_auto_merge',
          'delete_branch_on_merge',
          'squash_merge_commit_title',
          'squash_merge_commit_message',
          'merge_commit_title',
          'merge_commit_message',
          'has_downloads',
          'is_template'
        )
      })
      .json<github.ReposCreateForAuthenticatedUserResponse>()
  }

  /**
   * When authenticating as a user, this endpoint will list all currently open repository invitations for that user.
   */
  @aiFunction({
    name: 'github_repos_list_invitations_for_authenticated_user',
    description: `When authenticating as a user, this endpoint will list all currently open repository invitations for that user.`,
    inputSchema: github.ReposListInvitationsForAuthenticatedUserParamsSchema,
    tags: ['repos']
  })
  async reposListInvitationsForAuthenticatedUser(
    params: github.ReposListInvitationsForAuthenticatedUserParams
  ): Promise<github.ReposListInvitationsForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/repository_invitations', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ReposListInvitationsForAuthenticatedUserResponse>()
  }

  /**
   * Decline a repository invitation.
   */
  @aiFunction({
    name: 'github_repos_decline_invitation_for_authenticated_user',
    description: `Decline a repository invitation.`,
    inputSchema: github.ReposDeclineInvitationForAuthenticatedUserParamsSchema,
    tags: ['repos']
  })
  async reposDeclineInvitationForAuthenticatedUser(
    params: github.ReposDeclineInvitationForAuthenticatedUserParams
  ): Promise<github.ReposDeclineInvitationForAuthenticatedUserResponse> {
    return this.ky
      .delete(`/user/repository_invitations/${params.invitation_id}`)
      .json<github.ReposDeclineInvitationForAuthenticatedUserResponse>()
  }

  /**
   * Accept a repository invitation.
   */
  @aiFunction({
    name: 'github_repos_accept_invitation_for_authenticated_user',
    description: `Accept a repository invitation.`,
    inputSchema: github.ReposAcceptInvitationForAuthenticatedUserParamsSchema,
    tags: ['repos']
  })
  async reposAcceptInvitationForAuthenticatedUser(
    params: github.ReposAcceptInvitationForAuthenticatedUserParams
  ): Promise<github.ReposAcceptInvitationForAuthenticatedUserResponse> {
    return this.ky
      .patch(`/user/repository_invitations/${params.invitation_id}`)
      .json<github.ReposAcceptInvitationForAuthenticatedUserResponse>()
  }

  /**
   * Lists all of your social accounts.
   */
  @aiFunction({
    name: 'github_users_list_social_accounts_for_authenticated_user',
    description: `Lists all of your social accounts.`,
    inputSchema: github.UsersListSocialAccountsForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersListSocialAccountsForAuthenticatedUser(
    params: github.UsersListSocialAccountsForAuthenticatedUserParams
  ): Promise<github.UsersListSocialAccountsForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/social_accounts', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.UsersListSocialAccountsForAuthenticatedUserResponse>()
  }

  /**
 * Add one or more social accounts to the authenticated user's profile.

OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_add_social_account_for_authenticated_user',
    description: `Add one or more social accounts to the authenticated user's profile.

OAuth app tokens and personal access tokens (classic) need the \`user\` scope to use this endpoint.`,
    inputSchema: github.UsersAddSocialAccountForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersAddSocialAccountForAuthenticatedUser(
    params: github.UsersAddSocialAccountForAuthenticatedUserParams
  ): Promise<github.UsersAddSocialAccountForAuthenticatedUserResponse> {
    return this.ky
      .post('/user/social_accounts', {
        json: params
      })
      .json<github.UsersAddSocialAccountForAuthenticatedUserResponse>()
  }

  /**
 * Deletes one or more social accounts from the authenticated user's profile.

OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_delete_social_account_for_authenticated_user',
    description: `Deletes one or more social accounts from the authenticated user's profile.

OAuth app tokens and personal access tokens (classic) need the \`user\` scope to use this endpoint.`,
    inputSchema:
      github.UsersDeleteSocialAccountForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersDeleteSocialAccountForAuthenticatedUser(
    params: github.UsersDeleteSocialAccountForAuthenticatedUserParams
  ): Promise<github.UsersDeleteSocialAccountForAuthenticatedUserResponse> {
    return this.ky
      .delete('/user/social_accounts', {
        json: params
      })
      .json<github.UsersDeleteSocialAccountForAuthenticatedUserResponse>()
  }

  /**
 * Lists the SSH signing keys for the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the `read:ssh_signing_key` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_list_ssh_signing_keys_for_authenticated_user',
    description: `Lists the SSH signing keys for the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the \`read:ssh_signing_key\` scope to use this endpoint.`,
    inputSchema: github.UsersListSshSigningKeysForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersListSshSigningKeysForAuthenticatedUser(
    params: github.UsersListSshSigningKeysForAuthenticatedUserParams
  ): Promise<github.UsersListSshSigningKeysForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/ssh_signing_keys', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.UsersListSshSigningKeysForAuthenticatedUserResponse>()
  }

  /**
 * Creates an SSH signing key for the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the `write:ssh_signing_key` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_create_ssh_signing_key_for_authenticated_user',
    description: `Creates an SSH signing key for the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the \`write:ssh_signing_key\` scope to use this endpoint.`,
    inputSchema:
      github.UsersCreateSshSigningKeyForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersCreateSshSigningKeyForAuthenticatedUser(
    params: github.UsersCreateSshSigningKeyForAuthenticatedUserParams
  ): Promise<github.UsersCreateSshSigningKeyForAuthenticatedUserResponse> {
    return this.ky
      .post('/user/ssh_signing_keys', {
        json: pick(params, 'title', 'key')
      })
      .json<github.UsersCreateSshSigningKeyForAuthenticatedUserResponse>()
  }

  /**
 * Gets extended details for an SSH signing key.

OAuth app tokens and personal access tokens (classic) need the `read:ssh_signing_key` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_get_ssh_signing_key_for_authenticated_user',
    description: `Gets extended details for an SSH signing key.

OAuth app tokens and personal access tokens (classic) need the \`read:ssh_signing_key\` scope to use this endpoint.`,
    inputSchema: github.UsersGetSshSigningKeyForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersGetSshSigningKeyForAuthenticatedUser(
    params: github.UsersGetSshSigningKeyForAuthenticatedUserParams
  ): Promise<github.UsersGetSshSigningKeyForAuthenticatedUserResponse> {
    return this.ky
      .get(`/user/ssh_signing_keys/${params.ssh_signing_key_id}`)
      .json<github.UsersGetSshSigningKeyForAuthenticatedUserResponse>()
  }

  /**
 * Deletes an SSH signing key from the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the `admin:ssh_signing_key` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_delete_ssh_signing_key_for_authenticated_user',
    description: `Deletes an SSH signing key from the authenticated user's GitHub account.

OAuth app tokens and personal access tokens (classic) need the \`admin:ssh_signing_key\` scope to use this endpoint.`,
    inputSchema:
      github.UsersDeleteSshSigningKeyForAuthenticatedUserParamsSchema,
    tags: ['users']
  })
  async usersDeleteSshSigningKeyForAuthenticatedUser(
    params: github.UsersDeleteSshSigningKeyForAuthenticatedUserParams
  ): Promise<github.UsersDeleteSshSigningKeyForAuthenticatedUserResponse> {
    return this.ky
      .delete(`/user/ssh_signing_keys/${params.ssh_signing_key_id}`)
      .json<github.UsersDeleteSshSigningKeyForAuthenticatedUserResponse>()
  }

  /**
 * Lists repositories the authenticated user has starred.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created.
 */
  @aiFunction({
    name: 'github_activity_list_repos_starred_by_authenticated_user',
    description: `Lists repositories the authenticated user has starred.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.star+json\`**: Includes a timestamp of when the star was created.`,
    inputSchema: github.ActivityListReposStarredByAuthenticatedUserParamsSchema,
    tags: ['activity']
  })
  async activityListReposStarredByAuthenticatedUser(
    params: github.ActivityListReposStarredByAuthenticatedUserParams
  ): Promise<github.ActivityListReposStarredByAuthenticatedUserResponse> {
    return this.ky
      .get('/user/starred', {
        searchParams: sanitizeSearchParams(
          pick(params, 'sort', 'direction', 'per_page', 'page')
        )
      })
      .json<github.ActivityListReposStarredByAuthenticatedUserResponse>()
  }

  /**
   * Whether the authenticated user has starred the repository.
   */
  @aiFunction({
    name: 'github_activity_check_repo_is_starred_by_authenticated_user',
    description: `Whether the authenticated user has starred the repository.`,
    inputSchema:
      github.ActivityCheckRepoIsStarredByAuthenticatedUserParamsSchema,
    tags: ['activity']
  })
  async activityCheckRepoIsStarredByAuthenticatedUser(
    params: github.ActivityCheckRepoIsStarredByAuthenticatedUserParams
  ): Promise<github.ActivityCheckRepoIsStarredByAuthenticatedUserResponse> {
    return this.ky
      .get(`/user/starred/${params.owner}/${params.repo}`, {})
      .json<github.ActivityCheckRepoIsStarredByAuthenticatedUserResponse>()
  }

  /**
   * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method).".
   */
  @aiFunction({
    name: 'github_activity_star_repo_for_authenticated_user',
    description: `Note that you'll need to set \`Content-Length\` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method).".`,
    inputSchema: github.ActivityStarRepoForAuthenticatedUserParamsSchema,
    tags: ['activity']
  })
  async activityStarRepoForAuthenticatedUser(
    params: github.ActivityStarRepoForAuthenticatedUserParams
  ): Promise<github.ActivityStarRepoForAuthenticatedUserResponse> {
    return this.ky
      .put(`/user/starred/${params.owner}/${params.repo}`, {})
      .json<github.ActivityStarRepoForAuthenticatedUserResponse>()
  }

  /**
   * Unstar a repository that the authenticated user has previously starred.
   */
  @aiFunction({
    name: 'github_activity_unstar_repo_for_authenticated_user',
    description: `Unstar a repository that the authenticated user has previously starred.`,
    inputSchema: github.ActivityUnstarRepoForAuthenticatedUserParamsSchema,
    tags: ['activity']
  })
  async activityUnstarRepoForAuthenticatedUser(
    params: github.ActivityUnstarRepoForAuthenticatedUserParams
  ): Promise<github.ActivityUnstarRepoForAuthenticatedUserResponse> {
    return this.ky
      .delete(`/user/starred/${params.owner}/${params.repo}`, {})
      .json<github.ActivityUnstarRepoForAuthenticatedUserResponse>()
  }

  /**
   * Lists repositories the authenticated user is watching.
   */
  @aiFunction({
    name: 'github_activity_list_watched_repos_for_authenticated_user',
    description: `Lists repositories the authenticated user is watching.`,
    inputSchema:
      github.ActivityListWatchedReposForAuthenticatedUserParamsSchema,
    tags: ['activity']
  })
  async activityListWatchedReposForAuthenticatedUser(
    params: github.ActivityListWatchedReposForAuthenticatedUserParams
  ): Promise<github.ActivityListWatchedReposForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/subscriptions', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActivityListWatchedReposForAuthenticatedUserResponse>()
  }

  /**
 * List all of the teams across all of the organizations to which the authenticated
user belongs.

OAuth app tokens and personal access tokens (classic) need the `user`, `repo`, or `read:org` scope to use this endpoint.

When using a fine-grained personal access token, the resource owner of the token must be a single organization, and the response will only include the teams from that organization.
 */
  @aiFunction({
    name: 'github_teams_list_for_authenticated_user',
    description: `List all of the teams across all of the organizations to which the authenticated
user belongs.

OAuth app tokens and personal access tokens (classic) need the \`user\`, \`repo\`, or \`read:org\` scope to use this endpoint.

When using a fine-grained personal access token, the resource owner of the token must be a single organization, and the response will only include the teams from that organization.`,
    inputSchema: github.TeamsListForAuthenticatedUserParamsSchema,
    tags: ['teams']
  })
  async teamsListForAuthenticatedUser(
    params: github.TeamsListForAuthenticatedUserParams
  ): Promise<github.TeamsListForAuthenticatedUserResponse> {
    return this.ky
      .get('/user/teams', {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.TeamsListForAuthenticatedUserResponse>()
  }

  /**
 * Provides publicly available information about someone with a GitHub account. This method takes their durable user `ID` instead of their `login`, which can change over time.

If you are requesting information about an [Enterprise Managed User](https://docs.github.com/enterprise-cloud@latest/admin/managing-iam/understanding-iam-for-enterprises/about-enterprise-managed-users), or a GitHub App bot that is installed in an organization that uses Enterprise Managed Users, your requests must be authenticated as a user or GitHub App that has access to the organization to view that account's information. If you are not authorized, the request will return a `404 Not Found` status.

The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be public which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication).

The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see [Emails API](https://docs.github.com/rest/users/emails).
 */
  @aiFunction({
    name: 'github_users_get_by_id',
    description: `Provides publicly available information about someone with a GitHub account. This method takes their durable user \`ID\` instead of their \`login\`, which can change over time.

If you are requesting information about an [Enterprise Managed User](https://docs.github.com/enterprise-cloud@latest/admin/managing-iam/understanding-iam-for-enterprises/about-enterprise-managed-users), or a GitHub App bot that is installed in an organization that uses Enterprise Managed Users, your requests must be authenticated as a user or GitHub App that has access to the organization to view that account's information. If you are not authorized, the request will return a \`404 Not Found\` status.

The \`email\` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be public which provides an email entry for this endpoint. If you do not set a public email address for \`email\`, then it will have a value of \`null\`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication).

The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see [Emails API](https://docs.github.com/rest/users/emails).`,
    inputSchema: github.UsersGetByIdParamsSchema,
    tags: ['users']
  })
  async usersGetById(
    params: github.UsersGetByIdParams
  ): Promise<github.UsersGetByIdResponse> {
    return this.ky
      .get(`/user/${params.account_id}`)
      .json<github.UsersGetByIdResponse>()
  }

  /**
 * Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts.

Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of users.
 */
  @aiFunction({
    name: 'github_users_list',
    description: `Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts.

Note: Pagination is powered exclusively by the \`since\` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of users.`,
    inputSchema: github.UsersListParamsSchema,
    tags: ['users']
  })
  async usersList(
    params: github.UsersListParams
  ): Promise<github.UsersListResponse> {
    return this.ky
      .get('/users', {
        searchParams: sanitizeSearchParams(pick(params, 'since', 'per_page'))
      })
      .json<github.UsersListResponse>()
  }

  /**
 * Provides publicly available information about someone with a GitHub account.

If you are requesting information about an [Enterprise Managed User](https://docs.github.com/enterprise-cloud@latest/admin/managing-iam/understanding-iam-for-enterprises/about-enterprise-managed-users), or a GitHub App bot that is installed in an organization that uses Enterprise Managed Users, your requests must be authenticated as a user or GitHub App that has access to the organization to view that account's information. If you are not authorized, the request will return a `404 Not Found` status.

The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be public which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication).

The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see [Emails API](https://docs.github.com/rest/users/emails).
 */
  @aiFunction({
    name: 'github_users_get_by_username',
    description: `Provides publicly available information about someone with a GitHub account.

If you are requesting information about an [Enterprise Managed User](https://docs.github.com/enterprise-cloud@latest/admin/managing-iam/understanding-iam-for-enterprises/about-enterprise-managed-users), or a GitHub App bot that is installed in an organization that uses Enterprise Managed Users, your requests must be authenticated as a user or GitHub App that has access to the organization to view that account's information. If you are not authorized, the request will return a \`404 Not Found\` status.

The \`email\` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be public which provides an email entry for this endpoint. If you do not set a public email address for \`email\`, then it will have a value of \`null\`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication).

The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see [Emails API](https://docs.github.com/rest/users/emails).`,
    inputSchema: github.UsersGetByUsernameParamsSchema,
    tags: ['users']
  })
  async usersGetByUsername(
    params: github.UsersGetByUsernameParams
  ): Promise<github.UsersGetByUsernameResponse> {
    return this.ky
      .get(`/users/${params.username}`)
      .json<github.UsersGetByUsernameResponse>()
  }

  /**
 * List a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user.

The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required.

**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
 */
  @aiFunction({
    name: 'github_users_list_attestations',
    description: `List a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user.

The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the \`attestations:read\` permission is required.

**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI \`attestation verify\` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).`,
    inputSchema: github.UsersListAttestationsParamsSchema,
    tags: ['users']
  })
  async usersListAttestations(
    params: github.UsersListAttestationsParams
  ): Promise<github.UsersListAttestationsResponse> {
    return this.ky
      .get(
        `/users/${params.username}/attestations/${params.subject_digest}`,
        {
          searchParams: sanitizeSearchParams(
            pick(params, 'per_page', 'before', 'after', 'predicate_type')
          )
        }
      )
      .json<github.UsersListAttestationsResponse>()
  }

  /**
 * Lists all packages that are in a specific user's namespace, that the requesting user has access to, and that encountered a conflict during Docker migration.

OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_packages_list_docker_migration_conflicting_packages_for_user',
    description: `Lists all packages that are in a specific user's namespace, that the requesting user has access to, and that encountered a conflict during Docker migration.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` scope to use this endpoint.`,
    inputSchema:
      github.PackagesListDockerMigrationConflictingPackagesForUserParamsSchema,
    tags: ['packages']
  })
  async packagesListDockerMigrationConflictingPackagesForUser(
    params: github.PackagesListDockerMigrationConflictingPackagesForUserParams
  ): Promise<github.PackagesListDockerMigrationConflictingPackagesForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/docker/conflicts`)
      .json<github.PackagesListDockerMigrationConflictingPackagesForUserResponse>()
  }

  /**
 * If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. _Optional_: use the fine-grained token with following permission set to view private events: "Events" user permissions (read).

> [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
 */
  @aiFunction({
    name: 'github_activity_list_events_for_authenticated_user',
    description: `If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. _Optional_: use the fine-grained token with following permission set to view private events: "Events" user permissions (read).

> [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.`,
    inputSchema: github.ActivityListEventsForAuthenticatedUserParamsSchema,
    tags: ['activity']
  })
  async activityListEventsForAuthenticatedUser(
    params: github.ActivityListEventsForAuthenticatedUserParams
  ): Promise<github.ActivityListEventsForAuthenticatedUserResponse> {
    return this.ky
      .get(`/users/${params.username}/events`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActivityListEventsForAuthenticatedUserResponse>()
  }

  /**
 * This is the user's organization dashboard. You must be authenticated as the user to view this.

> [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
 */
  @aiFunction({
    name: 'github_activity_list_org_events_for_authenticated_user',
    description: `This is the user's organization dashboard. You must be authenticated as the user to view this.

> [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.`,
    inputSchema: github.ActivityListOrgEventsForAuthenticatedUserParamsSchema,
    tags: ['activity']
  })
  async activityListOrgEventsForAuthenticatedUser(
    params: github.ActivityListOrgEventsForAuthenticatedUserParams
  ): Promise<github.ActivityListOrgEventsForAuthenticatedUserResponse> {
    return this.ky
      .get(`/users/${params.username}/events/orgs/${params.org}`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActivityListOrgEventsForAuthenticatedUserResponse>()
  }

  /**
 * > [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
 */
  @aiFunction({
    name: 'github_activity_list_public_events_for_user',
    description: `> [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.`,
    inputSchema: github.ActivityListPublicEventsForUserParamsSchema,
    tags: ['activity']
  })
  async activityListPublicEventsForUser(
    params: github.ActivityListPublicEventsForUserParams
  ): Promise<github.ActivityListPublicEventsForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/events/public`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActivityListPublicEventsForUserResponse>()
  }

  /**
   * Lists the people following the specified user.
   */
  @aiFunction({
    name: 'github_users_list_followers_for_user',
    description: `Lists the people following the specified user.`,
    inputSchema: github.UsersListFollowersForUserParamsSchema,
    tags: ['users']
  })
  async usersListFollowersForUser(
    params: github.UsersListFollowersForUserParams
  ): Promise<github.UsersListFollowersForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/followers`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.UsersListFollowersForUserResponse>()
  }

  /**
   * Lists the people who the specified user follows.
   */
  @aiFunction({
    name: 'github_users_list_following_for_user',
    description: `Lists the people who the specified user follows.`,
    inputSchema: github.UsersListFollowingForUserParamsSchema,
    tags: ['users']
  })
  async usersListFollowingForUser(
    params: github.UsersListFollowingForUserParams
  ): Promise<github.UsersListFollowingForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/following`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.UsersListFollowingForUserResponse>()
  }

  /**
   * Check if a user follows another user.
   */
  @aiFunction({
    name: 'github_users_check_following_for_user',
    description: `Check if a user follows another user.`,
    inputSchema: github.UsersCheckFollowingForUserParamsSchema,
    tags: ['users']
  })
  async usersCheckFollowingForUser(
    params: github.UsersCheckFollowingForUserParams
  ): Promise<github.UsersCheckFollowingForUserResponse> {
    return this.ky
      .get(
        `/users/${params.username}/following/${params.target_user}`,
        {}
      )
      .json<github.UsersCheckFollowingForUserResponse>()
  }

  /**
   * Lists public gists for the specified user:.
   */
  @aiFunction({
    name: 'github_gists_list_for_user',
    description: `Lists public gists for the specified user:.`,
    inputSchema: github.GistsListForUserParamsSchema,
    tags: ['gists']
  })
  async gistsListForUser(
    params: github.GistsListForUserParams
  ): Promise<github.GistsListForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/gists`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'since', 'per_page', 'page')
        )
      })
      .json<github.GistsListForUserResponse>()
  }

  /**
   * Lists the GPG keys for a user. This information is accessible by anyone.
   */
  @aiFunction({
    name: 'github_users_list_gpg_keys_for_user',
    description: `Lists the GPG keys for a user. This information is accessible by anyone.`,
    inputSchema: github.UsersListGpgKeysForUserParamsSchema,
    tags: ['users']
  })
  async usersListGpgKeysForUser(
    params: github.UsersListGpgKeysForUserParams
  ): Promise<github.UsersListGpgKeysForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/gpg_keys`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.UsersListGpgKeysForUserResponse>()
  }

  /**
 * Provides hovercard information. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations.

  The `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository, you would use a `subject_type` value of `repository` and a `subject_id` value of `1300192` (the ID of the `Spoon-Knife` repository).

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_users_get_context_for_user',
    description: `Provides hovercard information. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations.

  The \`subject_type\` and \`subject_id\` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about \`octocat\` who owns the \`Spoon-Knife\` repository, you would use a \`subject_type\` value of \`repository\` and a \`subject_id\` value of \`1300192\` (the ID of the \`Spoon-Knife\` repository).

OAuth app tokens and personal access tokens (classic) need the \`repo\` scope to use this endpoint.`,
    inputSchema: github.UsersGetContextForUserParamsSchema,
    tags: ['users']
  })
  async usersGetContextForUser(
    params: github.UsersGetContextForUserParams
  ): Promise<github.UsersGetContextForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/hovercard`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'subject_type', 'subject_id')
        )
      })
      .json<github.UsersGetContextForUserResponse>()
  }

  /**
 * Enables an authenticated GitHub App to find the user’s installation information.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
 */
  @aiFunction({
    name: 'github_apps_get_user_installation',
    description: `Enables an authenticated GitHub App to find the user’s installation information.

You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.`,
    inputSchema: github.AppsGetUserInstallationParamsSchema,
    tags: ['apps']
  })
  async appsGetUserInstallation(
    params: github.AppsGetUserInstallationParams
  ): Promise<github.AppsGetUserInstallationResponse> {
    return this.ky
      .get(`/users/${params.username}/installation`)
      .json<github.AppsGetUserInstallationResponse>()
  }

  /**
   * Lists the _verified_ public SSH keys for a user. This is accessible by anyone.
   */
  @aiFunction({
    name: 'github_users_list_public_keys_for_user',
    description: `Lists the _verified_ public SSH keys for a user. This is accessible by anyone.`,
    inputSchema: github.UsersListPublicKeysForUserParamsSchema,
    tags: ['users']
  })
  async usersListPublicKeysForUser(
    params: github.UsersListPublicKeysForUserParams
  ): Promise<github.UsersListPublicKeysForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/keys`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.UsersListPublicKeysForUserResponse>()
  }

  /**
 * List [public organization memberships](https://docs.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user.

This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user) API instead.
 */
  @aiFunction({
    name: 'github_orgs_list_for_user',
    description: `List [public organization memberships](https://docs.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user.

This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user) API instead.`,
    inputSchema: github.OrgsListForUserParamsSchema,
    tags: ['orgs']
  })
  async orgsListForUser(
    params: github.OrgsListForUserParams
  ): Promise<github.OrgsListForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/orgs`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.OrgsListForUserResponse>()
  }

  /**
 * Lists all packages in a user's namespace for which the requesting user has access.

OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_list_packages_for_user',
    description: `Lists all packages in a user's namespace for which the requesting user has access.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesListPackagesForUserParamsSchema,
    tags: ['packages']
  })
  async packagesListPackagesForUser(
    params: github.PackagesListPackagesForUserParams
  ): Promise<github.PackagesListPackagesForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/packages`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'package_type', 'visibility', 'page', 'per_page')
        )
      })
      .json<github.PackagesListPackagesForUserResponse>()
  }

  /**
 * Gets a specific package metadata for a public package owned by a user.

OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_get_package_for_user',
    description: `Gets a specific package metadata for a public package owned by a user.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesGetPackageForUserParamsSchema,
    tags: ['packages']
  })
  async packagesGetPackageForUser(
    params: github.PackagesGetPackageForUserParams
  ): Promise<github.PackagesGetPackageForUserResponse> {
    return this.ky
      .get(
        `/users/${params.username}/packages/${params.package_type}/${params.package_name}`,
        {}
      )
      .json<github.PackagesGetPackageForUserResponse>()
  }

  /**
 * Deletes an entire package for a user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.

If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_delete_package_for_user',
    description: `Deletes an entire package for a user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.

If the \`package_type\` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` and \`delete:packages\` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesDeletePackageForUserParamsSchema,
    tags: ['packages']
  })
  async packagesDeletePackageForUser(
    params: github.PackagesDeletePackageForUserParams
  ): Promise<github.PackagesDeletePackageForUserResponse> {
    return this.ky
      .delete(
        `/users/${params.username}/packages/${params.package_type}/${params.package_name}`,
        {}
      )
      .json<github.PackagesDeletePackageForUserResponse>()
  }

  /**
 * Restores an entire package for a user.

You can restore a deleted package under the following conditions:
  - The package was deleted within the last 30 days.
  - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_restore_package_for_user',
    description: `Restores an entire package for a user.

You can restore a deleted package under the following conditions:
  - The package was deleted within the last 30 days.
  - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

If the \`package_type\` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` and \`write:packages\` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesRestorePackageForUserParamsSchema,
    tags: ['packages']
  })
  async packagesRestorePackageForUser(
    params: github.PackagesRestorePackageForUserParams
  ): Promise<github.PackagesRestorePackageForUserResponse> {
    return this.ky
      .post(
        `/users/${params.username}/packages/${params.package_type}/${params.package_name}/restore`,
        {
          searchParams: sanitizeSearchParams(pick(params, 'token'))
        }
      )
      .json<github.PackagesRestorePackageForUserResponse>()
  }

  /**
 * Lists package versions for a public package owned by a specified user.

OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_get_all_package_versions_for_package_owned_by_user',
    description: `Lists package versions for a public package owned by a specified user.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema:
      github.PackagesGetAllPackageVersionsForPackageOwnedByUserParamsSchema,
    tags: ['packages']
  })
  async packagesGetAllPackageVersionsForPackageOwnedByUser(
    params: github.PackagesGetAllPackageVersionsForPackageOwnedByUserParams
  ): Promise<github.PackagesGetAllPackageVersionsForPackageOwnedByUserResponse> {
    return this.ky
      .get(
        `/users/${params.username}/packages/${params.package_type}/${params.package_name}/versions`,
        {}
      )
      .json<github.PackagesGetAllPackageVersionsForPackageOwnedByUserResponse>()
  }

  /**
 * Gets a specific package version for a public package owned by a specified user.

OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_get_package_version_for_user',
    description: `Gets a specific package version for a public package owned by a specified user.

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesGetPackageVersionForUserParamsSchema,
    tags: ['packages']
  })
  async packagesGetPackageVersionForUser(
    params: github.PackagesGetPackageVersionForUserParams
  ): Promise<github.PackagesGetPackageVersionForUserResponse> {
    return this.ky
      .get(
        `/users/${params.username}/packages/${params.package_type}/${params.package_name}/versions/${params.package_version_id}`,
        {}
      )
      .json<github.PackagesGetPackageVersionForUserResponse>()
  }

  /**
 * Deletes a specific package version for a user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.

If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_delete_package_version_for_user',
    description: `Deletes a specific package version for a user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.

If the \`package_type\` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` and \`delete:packages\` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesDeletePackageVersionForUserParamsSchema,
    tags: ['packages']
  })
  async packagesDeletePackageVersionForUser(
    params: github.PackagesDeletePackageVersionForUserParams
  ): Promise<github.PackagesDeletePackageVersionForUserResponse> {
    return this.ky
      .delete(
        `/users/${params.username}/packages/${params.package_type}/${params.package_name}/versions/${params.package_version_id}`,
        {}
      )
      .json<github.PackagesDeletePackageVersionForUserResponse>()
  }

  /**
 * Restores a specific package version for a user.

You can restore a deleted package under the following conditions:
  - The package was deleted within the last 30 days.
  - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".
 */
  @aiFunction({
    name: 'github_packages_restore_package_version_for_user',
    description: `Restores a specific package version for a user.

You can restore a deleted package under the following conditions:
  - The package was deleted within the last 30 days.
  - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

If the \`package_type\` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."

OAuth app tokens and personal access tokens (classic) need the \`read:packages\` and \`write:packages\` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).".`,
    inputSchema: github.PackagesRestorePackageVersionForUserParamsSchema,
    tags: ['packages']
  })
  async packagesRestorePackageVersionForUser(
    params: github.PackagesRestorePackageVersionForUserParams
  ): Promise<github.PackagesRestorePackageVersionForUserResponse> {
    return this.ky
      .post(
        `/users/${params.username}/packages/${params.package_type}/${params.package_name}/versions/${params.package_version_id}/restore`,
        {}
      )
      .json<github.PackagesRestorePackageVersionForUserResponse>()
  }

  /**
 * > [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
 */
  @aiFunction({
    name: 'github_projects_list_for_user',
    description: `> [!WARNING]
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.`,
    inputSchema: github.ProjectsListForUserParamsSchema,
    tags: ['projects']
  })
  async projectsListForUser(
    params: github.ProjectsListForUserParams
  ): Promise<github.ProjectsListForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/projects`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'state', 'per_page', 'page')
        )
      })
      .json<github.ProjectsListForUserResponse>()
  }

  /**
 * These are events that you've received by watching repositories and following users. If you are authenticated as the
given user, you will see private events. Otherwise, you'll only see public events.

> [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
 */
  @aiFunction({
    name: 'github_activity_list_received_events_for_user',
    description: `These are events that you've received by watching repositories and following users. If you are authenticated as the
given user, you will see private events. Otherwise, you'll only see public events.

> [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.`,
    inputSchema: github.ActivityListReceivedEventsForUserParamsSchema,
    tags: ['activity']
  })
  async activityListReceivedEventsForUser(
    params: github.ActivityListReceivedEventsForUserParams
  ): Promise<github.ActivityListReceivedEventsForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/received_events`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActivityListReceivedEventsForUserResponse>()
  }

  /**
 * > [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
 */
  @aiFunction({
    name: 'github_activity_list_received_public_events_for_user',
    description: `> [!NOTE]
> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.`,
    inputSchema: github.ActivityListReceivedPublicEventsForUserParamsSchema,
    tags: ['activity']
  })
  async activityListReceivedPublicEventsForUser(
    params: github.ActivityListReceivedPublicEventsForUserParams
  ): Promise<github.ActivityListReceivedPublicEventsForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/received_events/public`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActivityListReceivedPublicEventsForUserResponse>()
  }

  /**
   * Lists public repositories for the specified user.
   */
  @aiFunction({
    name: 'github_repos_list_for_user',
    description: `Lists public repositories for the specified user.`,
    inputSchema: github.ReposListForUserParamsSchema,
    tags: ['repos']
  })
  async reposListForUser(
    params: github.ReposListForUserParams
  ): Promise<github.ReposListForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/repos`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'type', 'sort', 'direction', 'per_page', 'page')
        )
      })
      .json<github.ReposListForUserResponse>()
  }

  /**
 * Gets the summary of the free and paid GitHub Actions minutes used.

Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".

OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_billing_get_github_actions_billing_user',
    description: `Gets the summary of the free and paid GitHub Actions minutes used.

Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)".

OAuth app tokens and personal access tokens (classic) need the \`user\` scope to use this endpoint.`,
    inputSchema: github.BillingGetGithubActionsBillingUserParamsSchema,
    tags: ['billing']
  })
  async billingGetGithubActionsBillingUser(
    params: github.BillingGetGithubActionsBillingUserParams
  ): Promise<github.BillingGetGithubActionsBillingUserResponse> {
    return this.ky
      .get(`/users/${params.username}/settings/billing/actions`)
      .json<github.BillingGetGithubActionsBillingUserResponse>()
  }

  /**
 * Gets the free and paid storage used for GitHub Packages in gigabytes.

Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."

OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_billing_get_github_packages_billing_user',
    description: `Gets the free and paid storage used for GitHub Packages in gigabytes.

Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."

OAuth app tokens and personal access tokens (classic) need the \`user\` scope to use this endpoint.`,
    inputSchema: github.BillingGetGithubPackagesBillingUserParamsSchema,
    tags: ['billing']
  })
  async billingGetGithubPackagesBillingUser(
    params: github.BillingGetGithubPackagesBillingUserParams
  ): Promise<github.BillingGetGithubPackagesBillingUserResponse> {
    return this.ky
      .get(`/users/${params.username}/settings/billing/packages`)
      .json<github.BillingGetGithubPackagesBillingUserResponse>()
  }

  /**
 * Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages.

Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."

OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint.
 */
  @aiFunction({
    name: 'github_billing_get_shared_storage_billing_user',
    description: `Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages.

Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)."

OAuth app tokens and personal access tokens (classic) need the \`user\` scope to use this endpoint.`,
    inputSchema: github.BillingGetSharedStorageBillingUserParamsSchema,
    tags: ['billing']
  })
  async billingGetSharedStorageBillingUser(
    params: github.BillingGetSharedStorageBillingUserParams
  ): Promise<github.BillingGetSharedStorageBillingUserResponse> {
    return this.ky
      .get(`/users/${params.username}/settings/billing/shared-storage`)
      .json<github.BillingGetSharedStorageBillingUserResponse>()
  }

  /**
   * Lists social media accounts for a user. This endpoint is accessible by anyone.
   */
  @aiFunction({
    name: 'github_users_list_social_accounts_for_user',
    description: `Lists social media accounts for a user. This endpoint is accessible by anyone.`,
    inputSchema: github.UsersListSocialAccountsForUserParamsSchema,
    tags: ['users']
  })
  async usersListSocialAccountsForUser(
    params: github.UsersListSocialAccountsForUserParams
  ): Promise<github.UsersListSocialAccountsForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/social_accounts`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.UsersListSocialAccountsForUserResponse>()
  }

  /**
   * Lists the SSH signing keys for a user. This operation is accessible by anyone.
   */
  @aiFunction({
    name: 'github_users_list_ssh_signing_keys_for_user',
    description: `Lists the SSH signing keys for a user. This operation is accessible by anyone.`,
    inputSchema: github.UsersListSshSigningKeysForUserParamsSchema,
    tags: ['users']
  })
  async usersListSshSigningKeysForUser(
    params: github.UsersListSshSigningKeysForUserParams
  ): Promise<github.UsersListSshSigningKeysForUserResponse> {
    return this.ky
      .get(`/users/${params.username}/ssh_signing_keys`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.UsersListSshSigningKeysForUserResponse>()
  }

  /**
 * Lists repositories a user has starred.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created.
 */
  @aiFunction({
    name: 'github_activity_list_repos_starred_by_user',
    description: `Lists repositories a user has starred.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **\`application/vnd.github.star+json\`**: Includes a timestamp of when the star was created.`,
    inputSchema: github.ActivityListReposStarredByUserParamsSchema,
    tags: ['activity']
  })
  async activityListReposStarredByUser(
    params: github.ActivityListReposStarredByUserParams
  ): Promise<github.ActivityListReposStarredByUserResponse> {
    return this.ky
      .get(`/users/${params.username}/starred`, {
        searchParams: sanitizeSearchParams(
          pick(params, 'sort', 'direction', 'per_page', 'page')
        )
      })
      .json<github.ActivityListReposStarredByUserResponse>()
  }

  /**
   * Lists repositories a user is watching.
   */
  @aiFunction({
    name: 'github_activity_list_repos_watched_by_user',
    description: `Lists repositories a user is watching.`,
    inputSchema: github.ActivityListReposWatchedByUserParamsSchema,
    tags: ['activity']
  })
  async activityListReposWatchedByUser(
    params: github.ActivityListReposWatchedByUserParams
  ): Promise<github.ActivityListReposWatchedByUserResponse> {
    return this.ky
      .get(`/users/${params.username}/subscriptions`, {
        searchParams: sanitizeSearchParams(pick(params, 'per_page', 'page'))
      })
      .json<github.ActivityListReposWatchedByUserResponse>()
  }

  /**
   * Get all supported GitHub API versions.
   */
  @aiFunction({
    name: 'github_meta_get_all_versions',
    description: `Get all supported GitHub API versions.`,
    inputSchema: github.MetaGetAllVersionsParamsSchema,
    tags: ['meta']
  })
  async metaGetAllVersions(
    _params: github.MetaGetAllVersionsParams
  ): Promise<github.MetaGetAllVersionsResponse> {
    return this.ky.get('/versions').json<github.MetaGetAllVersionsResponse>()
  }

  /**
   * Get a random sentence from the Zen of GitHub.
   */
  @aiFunction({
    name: 'github_meta_get_zen',
    description: `Get a random sentence from the Zen of GitHub.`,
    inputSchema: github.MetaGetZenParamsSchema,
    tags: ['meta']
  })
  async metaGetZen(
    _params: github.MetaGetZenParams
  ): Promise<github.MetaGetZenResponse> {
    return this.ky.get('/zen').json<github.MetaGetZenResponse>()
  }
}
