diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index ba61188be70..444a889e184 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -5875,12 +5875,12 @@ public struct Client: APIProtocol { /// List repository collaborators /// /// 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. + /// The `permissions` hash returned in the response contains the base role permissions of the collaborator. The `role_name` is the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// Team members will include the members of child teams. /// - /// The authenticated user must have push access to the repository to use this endpoint. - /// + /// The authenticated user must have write, maintain, or admin privileges on the repository to use this endpoint. For organization-owned repositories, the authenticated user needs to be a member of the organization. /// OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators`. @@ -6054,11 +6054,13 @@ public struct Client: APIProtocol { } /// Add a repository collaborator /// - /// 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)." + /// Add a user to a repository with a specified level of access. If the repository is owned by an organization, this API does not add the user to the organization - a user that has repository access without being an organization member is called an "outside collaborator" (if they are not an Enterprise Managed User) or a "repository collaborator" if they are an Enterprise Managed User. These users are exempt from some organization policies - see "[Adding outside collaborators to repositories](https://docs.github.com/organizations/managing-user-access-to-your-organizations-repositories/managing-outside-collaborators/adding-outside-collaborators-to-repositories-in-your-organization)" to learn more about these collaborator types. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). /// - /// 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)." + /// Adding an outside collaborator may be restricted by enterprise and organization 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)" and "[Setting permissions for adding outside collaborators](https://docs.github.com/organizations/managing-organization-settings/setting-permissions-for-adding-outside-collaborators)" for organization settings. /// - /// 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: + /// 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 role 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} @@ -6068,6 +6070,8 @@ public struct Client: APIProtocol { /// /// 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). /// + /// For Enterprise Managed Users, this endpoint does not send invitations - these users are automatically added to organizations and repositories. Enterprise Managed Users can only be added to organizations and repositories within their enterprise. + /// /// **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. @@ -6141,7 +6145,7 @@ public struct Client: APIProtocol { return .noContent(.init()) case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Operations.ReposAddCollaborator.Output.UnprocessableContent.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6308,13 +6312,15 @@ public struct Client: APIProtocol { } /// Get repository permissions for a user /// - /// Checks the repository permission of a collaborator. The possible repository - /// permissions are `admin`, `write`, `read`, and `none`. + /// Checks the repository permission and role of a collaborator. + /// + /// 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`. + /// The `role_name` attribute provides the name of the assigned role, including custom roles. The + /// `permission` can also be used to determine which base level of access the collaborator has to the repository. /// - /// *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. + /// The calculated permissions are the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators/{username}/permission`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/collaborators/{username}/permission/get(repos/get-collaborator-permission-level)`. diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index 7b59bef5b06..3037d3659d6 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -544,12 +544,12 @@ public protocol APIProtocol: Sendable { /// List repository collaborators /// /// 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. + /// The `permissions` hash returned in the response contains the base role permissions of the collaborator. The `role_name` is the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// Team members will include the members of child teams. /// - /// The authenticated user must have push access to the repository to use this endpoint. - /// + /// The authenticated user must have write, maintain, or admin privileges on the repository to use this endpoint. For organization-owned repositories, the authenticated user needs to be a member of the organization. /// OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators`. @@ -570,11 +570,13 @@ public protocol APIProtocol: Sendable { func reposCheckCollaborator(_ input: Operations.ReposCheckCollaborator.Input) async throws -> Operations.ReposCheckCollaborator.Output /// Add a repository collaborator /// - /// 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)." + /// Add a user to a repository with a specified level of access. If the repository is owned by an organization, this API does not add the user to the organization - a user that has repository access without being an organization member is called an "outside collaborator" (if they are not an Enterprise Managed User) or a "repository collaborator" if they are an Enterprise Managed User. These users are exempt from some organization policies - see "[Adding outside collaborators to repositories](https://docs.github.com/organizations/managing-user-access-to-your-organizations-repositories/managing-outside-collaborators/adding-outside-collaborators-to-repositories-in-your-organization)" to learn more about these collaborator types. /// - /// 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)." + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). /// - /// 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: + /// Adding an outside collaborator may be restricted by enterprise and organization 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)" and "[Setting permissions for adding outside collaborators](https://docs.github.com/organizations/managing-organization-settings/setting-permissions-for-adding-outside-collaborators)" for organization settings. + /// + /// 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 role 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} @@ -584,6 +586,8 @@ public protocol APIProtocol: Sendable { /// /// 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). /// + /// For Enterprise Managed Users, this endpoint does not send invitations - these users are automatically added to organizations and repositories. Enterprise Managed Users can only be added to organizations and repositories within their enterprise. + /// /// **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. @@ -625,13 +629,15 @@ public protocol APIProtocol: Sendable { func reposRemoveCollaborator(_ input: Operations.ReposRemoveCollaborator.Input) async throws -> Operations.ReposRemoveCollaborator.Output /// Get repository permissions for a user /// - /// Checks the repository permission of a collaborator. The possible repository - /// permissions are `admin`, `write`, `read`, and `none`. + /// Checks the repository permission and role of a collaborator. + /// + /// 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`. + /// The `role_name` attribute provides the name of the assigned role, including custom roles. The + /// `permission` can also be used to determine which base level of access the collaborator has to the repository. /// - /// *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. + /// The calculated permissions are the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators/{username}/permission`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/collaborators/{username}/permission/get(repos/get-collaborator-permission-level)`. @@ -3147,12 +3153,12 @@ extension APIProtocol { /// List repository collaborators /// /// 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. + /// The `permissions` hash returned in the response contains the base role permissions of the collaborator. The `role_name` is the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// Team members will include the members of child teams. /// - /// The authenticated user must have push access to the repository to use this endpoint. - /// + /// The authenticated user must have write, maintain, or admin privileges on the repository to use this endpoint. For organization-owned repositories, the authenticated user needs to be a member of the organization. /// OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators`. @@ -3185,11 +3191,13 @@ extension APIProtocol { } /// Add a repository collaborator /// - /// 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)." + /// Add a user to a repository with a specified level of access. If the repository is owned by an organization, this API does not add the user to the organization - a user that has repository access without being an organization member is called an "outside collaborator" (if they are not an Enterprise Managed User) or a "repository collaborator" if they are an Enterprise Managed User. These users are exempt from some organization policies - see "[Adding outside collaborators to repositories](https://docs.github.com/organizations/managing-user-access-to-your-organizations-repositories/managing-outside-collaborators/adding-outside-collaborators-to-repositories-in-your-organization)" to learn more about these collaborator types. /// - /// 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)." + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). /// - /// 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: + /// Adding an outside collaborator may be restricted by enterprise and organization 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)" and "[Setting permissions for adding outside collaborators](https://docs.github.com/organizations/managing-organization-settings/setting-permissions-for-adding-outside-collaborators)" for organization settings. + /// + /// 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 role 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} @@ -3199,6 +3207,8 @@ extension APIProtocol { /// /// 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). /// + /// For Enterprise Managed Users, this endpoint does not send invitations - these users are automatically added to organizations and repositories. Enterprise Managed Users can only be added to organizations and repositories within their enterprise. + /// /// **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. @@ -3258,13 +3268,15 @@ extension APIProtocol { } /// Get repository permissions for a user /// - /// Checks the repository permission of a collaborator. The possible repository - /// permissions are `admin`, `write`, `read`, and `none`. + /// Checks the repository permission and role of a collaborator. /// - /// *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. + /// 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`. + /// The `role_name` attribute provides the name of the assigned role, including custom roles. The + /// `permission` can also be used to determine which base level of access the collaborator has to the repository. + /// + /// The calculated permissions are the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators/{username}/permission`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/collaborators/{username}/permission/get(repos/get-collaborator-permission-level)`. @@ -36233,12 +36245,12 @@ public enum Operations { /// List repository collaborators /// /// 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. + /// The `permissions` hash returned in the response contains the base role permissions of the collaborator. The `role_name` is the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// Team members will include the members of child teams. /// - /// The authenticated user must have push access to the repository to use this endpoint. - /// + /// The authenticated user must have write, maintain, or admin privileges on the repository to use this endpoint. For organization-owned repositories, the authenticated user needs to be a member of the organization. /// OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators`. @@ -36608,11 +36620,13 @@ public enum Operations { } /// Add a repository collaborator /// - /// 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)." + /// Add a user to a repository with a specified level of access. If the repository is owned by an organization, this API does not add the user to the organization - a user that has repository access without being an organization member is called an "outside collaborator" (if they are not an Enterprise Managed User) or a "repository collaborator" if they are an Enterprise Managed User. These users are exempt from some organization policies - see "[Adding outside collaborators to repositories](https://docs.github.com/organizations/managing-user-access-to-your-organizations-repositories/managing-outside-collaborators/adding-outside-collaborators-to-repositories-in-your-organization)" to learn more about these collaborator types. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). /// - /// 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)." + /// Adding an outside collaborator may be restricted by enterprise and organization 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)" and "[Setting permissions for adding outside collaborators](https://docs.github.com/organizations/managing-organization-settings/setting-permissions-for-adding-outside-collaborators)" for organization settings. /// - /// 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: + /// 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 role 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} @@ -36622,6 +36636,8 @@ public enum Operations { /// /// 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). /// + /// For Enterprise Managed Users, this endpoint does not send invitations - these users are automatically added to organizations and repositories. Enterprise Managed Users can only be added to organizations and repositories within their enterprise. + /// /// **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. @@ -36810,17 +36826,47 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/collaborators/{username}/PUT/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/collaborators/{username}/PUT/responses/422/content/application\/json`. + case json(Components.Schemas.ValidationError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ReposAddCollaborator.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ReposAddCollaborator.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Response when: + /// - validation failed, or the endpoint has been spammed + /// - an Enterprise Managed User (EMU) account was invited to a repository in an enterprise with personal user accounts /// /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/collaborators/{username}/put(repos/add-collaborator)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) + case unprocessableContent(Operations.ReposAddCollaborator.Output.UnprocessableContent) /// The associated value of the enum case if `self` is `.unprocessableContent`. /// /// - Throws: An error if `self` is not `.unprocessableContent`. /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + public var unprocessableContent: Operations.ReposAddCollaborator.Output.UnprocessableContent { get throws { switch self { case let .unprocessableContent(response): @@ -37088,13 +37134,15 @@ public enum Operations { } /// Get repository permissions for a user /// - /// Checks the repository permission of a collaborator. The possible repository - /// permissions are `admin`, `write`, `read`, and `none`. + /// Checks the repository permission and role of a collaborator. + /// + /// 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`. + /// The `role_name` attribute provides the name of the assigned role, including custom roles. The + /// `permission` can also be used to determine which base level of access the collaborator has to the repository. /// - /// *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. + /// The calculated permissions are the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators/{username}/permission`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/collaborators/{username}/permission/get(repos/get-collaborator-permission-level)`. diff --git a/Sources/teams/Types.swift b/Sources/teams/Types.swift index 855c4585213..1ae0e1b9343 100644 --- a/Sources/teams/Types.swift +++ b/Sources/teams/Types.swift @@ -5717,7 +5717,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/teams/POST/requestBody/json/description`. public var description: Swift.String? - /// List GitHub IDs for organization members who will become team maintainers. + /// List GitHub usernames for organization members who will become team maintainers. /// /// - Remark: Generated from `#/paths/orgs/{org}/teams/POST/requestBody/json/maintainers`. public var maintainers: [Swift.String]? @@ -5787,7 +5787,7 @@ public enum Operations { /// - Parameters: /// - name: The name of the team. /// - description: The description of the team. - /// - maintainers: List GitHub IDs for organization members who will become team maintainers. + /// - maintainers: List GitHub usernames for organization members who will become team maintainers. /// - repoNames: The full name (e.g., "organization-name/repository-name") of repositories to add the team to. /// - privacy: The level of privacy this team should have. The options are: /// - notificationSetting: The notification setting the team has chosen. The options are: diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index 467f6a98a97..0956844c508 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit 467f6a98a97a73630a1f1e75ddee01cb59f33dd5 +Subproject commit 0956844c50850685dce43634d73a69f4dac7989e