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 fd544c2 to 3e3e138 #62

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
28 changes: 27 additions & 1 deletion Sources/actions/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5528,29 +5528,55 @@ public enum Components {
}
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`.
public var secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload?
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`.
public struct secret_scanning_non_provider_patternsPayload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`.
@frozen public enum statusPayload: String, Codable, Hashable, Sendable {
case enabled = "enabled"
case disabled = "disabled"
}
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`.
public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload.statusPayload?
/// Creates a new `secret_scanning_non_provider_patternsPayload`.
///
/// - Parameters:
/// - status:
public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload.statusPayload? = nil) {
self.status = status
}
public enum CodingKeys: String, CodingKey {
case status
}
}
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`.
public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload?
/// Creates a new `security_hyphen_and_hyphen_analysis`.
///
/// - Parameters:
/// - advanced_security:
/// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository.
/// - secret_scanning:
/// - secret_scanning_push_protection:
/// - secret_scanning_non_provider_patterns:
public init(
advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil,
dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil,
secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil,
secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil
secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil,
secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil
) {
self.advanced_security = advanced_security
self.dependabot_security_updates = dependabot_security_updates
self.secret_scanning = secret_scanning
self.secret_scanning_push_protection = secret_scanning_push_protection
self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns
}
public enum CodingKeys: String, CodingKey {
case advanced_security
case dependabot_security_updates
case secret_scanning
case secret_scanning_push_protection
case secret_scanning_non_provider_patterns
}
}
/// Minimal Repository
Expand Down
28 changes: 27 additions & 1 deletion Sources/activity/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3493,29 +3493,55 @@ public enum Components {
}
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`.
public var secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload?
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`.
public struct secret_scanning_non_provider_patternsPayload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`.
@frozen public enum statusPayload: String, Codable, Hashable, Sendable {
case enabled = "enabled"
case disabled = "disabled"
}
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`.
public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload.statusPayload?
/// Creates a new `secret_scanning_non_provider_patternsPayload`.
///
/// - Parameters:
/// - status:
public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload.statusPayload? = nil) {
self.status = status
}
public enum CodingKeys: String, CodingKey {
case status
}
}
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`.
public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload?
/// Creates a new `security_hyphen_and_hyphen_analysis`.
///
/// - Parameters:
/// - advanced_security:
/// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository.
/// - secret_scanning:
/// - secret_scanning_push_protection:
/// - secret_scanning_non_provider_patterns:
public init(
advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil,
dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil,
secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil,
secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil
secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil,
secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil
) {
self.advanced_security = advanced_security
self.dependabot_security_updates = dependabot_security_updates
self.secret_scanning = secret_scanning
self.secret_scanning_push_protection = secret_scanning_push_protection
self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns
}
public enum CodingKeys: String, CodingKey {
case advanced_security
case dependabot_security_updates
case secret_scanning
case secret_scanning_push_protection
case secret_scanning_non_provider_patterns
}
}
/// Minimal Repository
Expand Down
28 changes: 27 additions & 1 deletion Sources/checks/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1086,29 +1086,55 @@ public enum Components {
}
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`.
public var secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload?
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`.
public struct secret_scanning_non_provider_patternsPayload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`.
@frozen public enum statusPayload: String, Codable, Hashable, Sendable {
case enabled = "enabled"
case disabled = "disabled"
}
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`.
public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload.statusPayload?
/// Creates a new `secret_scanning_non_provider_patternsPayload`.
///
/// - Parameters:
/// - status:
public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload.statusPayload? = nil) {
self.status = status
}
public enum CodingKeys: String, CodingKey {
case status
}
}
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`.
public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload?
/// Creates a new `security_hyphen_and_hyphen_analysis`.
///
/// - Parameters:
/// - advanced_security:
/// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository.
/// - secret_scanning:
/// - secret_scanning_push_protection:
/// - secret_scanning_non_provider_patterns:
public init(
advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil,
dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil,
secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil,
secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil
secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil,
secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil
) {
self.advanced_security = advanced_security
self.dependabot_security_updates = dependabot_security_updates
self.secret_scanning = secret_scanning
self.secret_scanning_push_protection = secret_scanning_push_protection
self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns
}
public enum CodingKeys: String, CodingKey {
case advanced_security
case dependabot_security_updates
case secret_scanning
case secret_scanning_push_protection
case secret_scanning_non_provider_patterns
}
}
/// Minimal Repository
Expand Down
155 changes: 155 additions & 0 deletions Sources/code-security/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,161 @@ public struct Client: APIProtocol {
}
)
}
/// Detach configurations from repositories
///
/// 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.
///
/// - Remark: HTTP `DELETE /orgs/{org}/code-security/configurations/detach`.
/// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/detach/delete(code-security/detach-configuration)`.
public func code_hyphen_security_sol_detach_hyphen_configuration(_ input: Operations.code_hyphen_security_sol_detach_hyphen_configuration.Input) async throws -> Operations.code_hyphen_security_sol_detach_hyphen_configuration.Output {
try await client.send(
input: input,
forOperation: Operations.code_hyphen_security_sol_detach_hyphen_configuration.id,
serializer: { input in
let path = try converter.renderedPath(
template: "/orgs/{}/code-security/configurations/detach",
parameters: [
input.path.org
]
)
var request: HTTPTypes.HTTPRequest = .init(
soar_path: path,
method: .delete
)
suppressMutabilityWarning(&request)
converter.setAcceptHeader(
in: &request.headerFields,
contentTypes: input.headers.accept
)
let body: OpenAPIRuntime.HTTPBody?
switch input.body {
case let .json(value):
body = try converter.setRequiredRequestBodyAsJSON(
value,
headerFields: &request.headerFields,
contentType: "application/json; charset=utf-8"
)
}
return (request, body)
},
deserializer: { response, responseBody in
switch response.status.code {
case 204:
return .noContent(.init())
case 400:
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 .badRequest(.init(body: body))
case 403:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.forbidden.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 .forbidden(.init(body: body))
case 404:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.not_found.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 .notFound(.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,
.init(
headerFields: response.headerFields,
body: responseBody
)
)
}
}
)
}
/// Get a code security configuration
///
/// Gets a code security configuration available in an organization.
Expand Down
Loading