Skip to content
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

Bump Submodule/github/rest-api-description from 2365ff8 to 37bd18b #35

Merged
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
268 changes: 268 additions & 0 deletions Sources/git/Client.swift

Large diffs are not rendered by default.

326 changes: 307 additions & 19 deletions Sources/git/Types.swift

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Sources/orgs/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public struct Client: APIProtocol {
}
/// List organizations
///
/// Lists all organizations, in the order that they were created on GitHub.
/// 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.
///
Expand Down
6 changes: 3 additions & 3 deletions Sources/orgs/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import struct Foundation.Date
public protocol APIProtocol: Sendable {
/// List organizations
///
/// Lists all organizations, in the order that they were created on GitHub.
/// 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.
///
Expand Down Expand Up @@ -730,7 +730,7 @@ public protocol APIProtocol: Sendable {
extension APIProtocol {
/// List organizations
///
/// Lists all organizations, in the order that they were created on GitHub.
/// 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.
///
Expand Down Expand Up @@ -6965,7 +6965,7 @@ public enum Components {
public enum Operations {
/// List organizations
///
/// Lists all organizations, in the order that they were created on GitHub.
/// 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.
///
Expand Down
162 changes: 162 additions & 0 deletions Sources/repos/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6852,6 +6852,28 @@ public struct Client: APIProtocol {
preconditionFailure("bestContentType chose an invalid content type.")
}
return .unprocessableContent(.init(body: body))
case 409:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.conflict.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.basic_hyphen_error.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .conflict(.init(body: body))
default:
return .undocumented(
statusCode: response.status.code,
Expand Down Expand Up @@ -7173,6 +7195,28 @@ public struct Client: APIProtocol {
headers: headers,
body: body
))
case 409:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.conflict.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.basic_hyphen_error.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .conflict(.init(body: body))
default:
return .undocumented(
statusCode: response.status.code,
Expand Down Expand Up @@ -7378,6 +7422,28 @@ public struct Client: APIProtocol {
preconditionFailure("bestContentType chose an invalid content type.")
}
return .serviceUnavailable(.init(body: body))
case 409:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.conflict.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.basic_hyphen_error.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .conflict(.init(body: body))
default:
return .undocumented(
statusCode: response.status.code,
Expand Down Expand Up @@ -13844,6 +13910,102 @@ public struct Client: APIProtocol {
}
)
}
/// Check if private vulnerability reporting is enabled for a repository
///
/// 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)".
///
/// - Remark: HTTP `GET /repos/{owner}/{repo}/private-vulnerability-reporting`.
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/private-vulnerability-reporting/get(repos/check-private-vulnerability-reporting)`.
public func repos_sol_check_hyphen_private_hyphen_vulnerability_hyphen_reporting(_ input: Operations.repos_sol_check_hyphen_private_hyphen_vulnerability_hyphen_reporting.Input) async throws -> Operations.repos_sol_check_hyphen_private_hyphen_vulnerability_hyphen_reporting.Output {
try await client.send(
input: input,
forOperation: Operations.repos_sol_check_hyphen_private_hyphen_vulnerability_hyphen_reporting.id,
serializer: { input in
let path = try converter.renderedPath(
template: "/repos/{}/{}/private-vulnerability-reporting",
parameters: [
input.path.owner,
input.path.repo
]
)
var request: HTTPTypes.HTTPRequest = .init(
soar_path: path,
method: .get
)
suppressMutabilityWarning(&request)
converter.setAcceptHeader(
in: &request.headerFields,
contentTypes: input.headers.accept
)
return (request, nil)
},
deserializer: { response, responseBody in
switch response.status.code {
case 200:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Operations.repos_sol_check_hyphen_private_hyphen_vulnerability_hyphen_reporting.Output.Ok.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Operations.repos_sol_check_hyphen_private_hyphen_vulnerability_hyphen_reporting.Output.Ok.Body.jsonPayload.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .ok(.init(body: body))
case 422:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.bad_request.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json",
"application/scim+json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.basic_hyphen_error.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
case "application/scim+json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.scim_hyphen_error.self,
from: responseBody,
transforming: { value in
.application_scim_plus_json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .unprocessableContent(.init(body: body))
default:
return .undocumented(
statusCode: response.status.code,
.init(
headerFields: response.headerFields,
body: responseBody
)
)
}
}
)
}
/// Enable private vulnerability reporting for a repository
///
/// 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)."
Expand Down
Loading