Skip to content

Bump Submodule/github/rest-api-description from c52348c to 664cf25 #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/apps/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ public struct Client: APIProtocol {
}
/// Delete an installation for the authenticated app
///
/// 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.
/// Uninstalls a GitHub App on a user, organization, or enterprise 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.
///
Expand Down Expand Up @@ -1243,7 +1243,7 @@ public struct Client: APIProtocol {
}
/// Suspend an app installation
///
/// 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.
/// Suspends a GitHub App on a user, organization, or enterprise 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.
///
Expand Down
18 changes: 12 additions & 6 deletions Sources/apps/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public protocol APIProtocol: Sendable {
func appsGetInstallation(_ input: Operations.AppsGetInstallation.Input) async throws -> Operations.AppsGetInstallation.Output
/// Delete an installation for the authenticated app
///
/// 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.
/// Uninstalls a GitHub App on a user, organization, or enterprise 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.
///
Expand All @@ -121,7 +121,7 @@ public protocol APIProtocol: Sendable {
func appsCreateInstallationAccessToken(_ input: Operations.AppsCreateInstallationAccessToken.Input) async throws -> Operations.AppsCreateInstallationAccessToken.Output
/// Suspend an app installation
///
/// 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.
/// Suspends a GitHub App on a user, organization, or enterprise 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.
///
Expand Down Expand Up @@ -496,7 +496,7 @@ extension APIProtocol {
}
/// Delete an installation for the authenticated app
///
/// 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.
/// Uninstalls a GitHub App on a user, organization, or enterprise 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.
///
Expand Down Expand Up @@ -536,7 +536,7 @@ extension APIProtocol {
}
/// Suspend an app installation
///
/// 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.
/// Suspends a GitHub App on a user, organization, or enterprise 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.
///
Expand Down Expand Up @@ -3180,6 +3180,8 @@ public enum Components {
public var htmlUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/installation/app_id`.
public var appId: Swift.Int
/// - Remark: Generated from `#/components/schemas/installation/client_id`.
public var clientId: Swift.String?
/// The ID of the user or organization this token is being scoped to.
///
/// - Remark: Generated from `#/components/schemas/installation/target_id`.
Expand Down Expand Up @@ -3218,6 +3220,7 @@ public enum Components {
/// - repositoriesUrl:
/// - htmlUrl:
/// - appId:
/// - clientId:
/// - targetId: The ID of the user or organization this token is being scoped to.
/// - targetType:
/// - permissions:
Expand All @@ -3239,6 +3242,7 @@ public enum Components {
repositoriesUrl: Swift.String,
htmlUrl: Swift.String,
appId: Swift.Int,
clientId: Swift.String? = nil,
targetId: Swift.Int,
targetType: Swift.String,
permissions: Components.Schemas.AppPermissions,
Expand All @@ -3260,6 +3264,7 @@ public enum Components {
self.repositoriesUrl = repositoriesUrl
self.htmlUrl = htmlUrl
self.appId = appId
self.clientId = clientId
self.targetId = targetId
self.targetType = targetType
self.permissions = permissions
Expand All @@ -3282,6 +3287,7 @@ public enum Components {
case repositoriesUrl = "repositories_url"
case htmlUrl = "html_url"
case appId = "app_id"
case clientId = "client_id"
case targetId = "target_id"
case targetType = "target_type"
case permissions
Expand Down Expand Up @@ -6825,7 +6831,7 @@ public enum Operations {
}
/// Delete an installation for the authenticated app
///
/// 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.
/// Uninstalls a GitHub App on a user, organization, or enterprise 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.
///
Expand Down Expand Up @@ -7238,7 +7244,7 @@ public enum Operations {
}
/// Suspend an app installation
///
/// 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.
/// Suspends a GitHub App on a user, organization, or enterprise 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.
///
Expand Down
22 changes: 22 additions & 0 deletions Sources/code-scanning/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3100,6 +3100,28 @@ public struct Client: APIProtocol {
preconditionFailure("bestContentType chose an invalid content type.")
}
return .conflict(.init(body: body))
case 422:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.CodeScanningInvalidState.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.BasicError.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .unprocessableContent(.init(body: body))
case 503:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.ServiceUnavailable.Body
Expand Down
51 changes: 51 additions & 0 deletions Sources/code-scanning/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3979,6 +3979,34 @@ public enum Components {
self.body = body
}
}
public struct CodeScanningInvalidState: Sendable, Hashable {
/// - Remark: Generated from `#/components/responses/code_scanning_invalid_state/content`.
@frozen public enum Body: Sendable, Hashable {
/// - Remark: Generated from `#/components/responses/code_scanning_invalid_state/content/application\/json`.
case json(Components.Schemas.BasicError)
/// 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.BasicError {
get throws {
switch self {
case let .json(body):
return body
}
}
}
}
/// Received HTTP response body
public var body: Components.Responses.CodeScanningInvalidState.Body
/// Creates a new `CodeScanningInvalidState`.
///
/// - Parameters:
/// - body: Received HTTP response body
public init(body: Components.Responses.CodeScanningInvalidState.Body) {
self.body = body
}
}
}
/// Types generated from the `#/components/headers` section of the OpenAPI document.
public enum Headers {
Expand Down Expand Up @@ -9066,6 +9094,29 @@ public enum Operations {
}
}
}
/// Response if the configuration change cannot be made because the repository is not in the required state
///
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/default-setup/patch(code-scanning/update-default-setup)/responses/422`.
///
/// HTTP response code: `422 unprocessableContent`.
case unprocessableContent(Components.Responses.CodeScanningInvalidState)
/// 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.CodeScanningInvalidState {
get throws {
switch self {
case let .unprocessableContent(response):
return response
default:
try throwUnexpectedResponseStatus(
expectedStatus: "unprocessableContent",
response: self
)
}
}
}
/// Service unavailable
///
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/default-setup/patch(code-scanning/update-default-setup)/responses/503`.
Expand Down
4 changes: 2 additions & 2 deletions Sources/code-security/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6067,14 +6067,14 @@ public enum Operations {
@frozen public enum Body: Sendable, Hashable {
/// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/detach/DELETE/requestBody/json`.
public struct JsonPayload: Codable, Hashable, Sendable {
/// An array of repository IDs to detach from configurations.
/// An array of repository IDs to detach from configurations. Up to 1000 IDs can be provided.
///
/// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/detach/DELETE/requestBody/json/selected_repository_ids`.
public var selectedRepositoryIds: [Swift.Int]?
/// Creates a new `JsonPayload`.
///
/// - Parameters:
/// - selectedRepositoryIds: An array of repository IDs to detach from configurations.
/// - selectedRepositoryIds: An array of repository IDs to detach from configurations. Up to 1000 IDs can be provided.
public init(selectedRepositoryIds: [Swift.Int]? = nil) {
self.selectedRepositoryIds = selectedRepositoryIds
}
Expand Down
6 changes: 6 additions & 0 deletions Sources/orgs/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4377,6 +4377,9 @@ public struct Client: APIProtocol {
///
/// 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.
///
/// > [!NOTE]
/// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team.
///
/// - Remark: HTTP `DELETE /orgs/{org}/members/{username}`.
/// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)`.
public func orgsRemoveMember(_ input: Operations.OrgsRemoveMember.Input) async throws -> Operations.OrgsRemoveMember.Output {
Expand Down Expand Up @@ -4683,6 +4686,9 @@ public struct Client: APIProtocol {
///
/// 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.
///
/// > [!NOTE]
/// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team.
///
/// - Remark: HTTP `DELETE /orgs/{org}/memberships/{username}`.
/// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)`.
public func orgsRemoveMembershipForUser(_ input: Operations.OrgsRemoveMembershipForUser.Input) async throws -> Operations.OrgsRemoveMembershipForUser.Output {
Expand Down
Loading