Skip to content

Commit 3d7ff4b

Browse files
Merge pull request #62 from Wei18/dependabot/submodules/Submodule/github/rest-api-description-3e3e138
Bump Submodule/github/rest-api-description from `fd544c2` to `3e3e138`
2 parents 673e733 + 2098712 commit 3d7ff4b

File tree

17 files changed

+1129
-144
lines changed

17 files changed

+1129
-144
lines changed

Sources/actions/Types.swift

+27-1
Original file line numberDiff line numberDiff line change
@@ -5528,29 +5528,55 @@ public enum Components {
55285528
}
55295529
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`.
55305530
public var secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload?
5531+
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`.
5532+
public struct secret_scanning_non_provider_patternsPayload: Codable, Hashable, Sendable {
5533+
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`.
5534+
@frozen public enum statusPayload: String, Codable, Hashable, Sendable {
5535+
case enabled = "enabled"
5536+
case disabled = "disabled"
5537+
}
5538+
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`.
5539+
public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload.statusPayload?
5540+
/// Creates a new `secret_scanning_non_provider_patternsPayload`.
5541+
///
5542+
/// - Parameters:
5543+
/// - status:
5544+
public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload.statusPayload? = nil) {
5545+
self.status = status
5546+
}
5547+
public enum CodingKeys: String, CodingKey {
5548+
case status
5549+
}
5550+
}
5551+
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`.
5552+
public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload?
55315553
/// Creates a new `security_hyphen_and_hyphen_analysis`.
55325554
///
55335555
/// - Parameters:
55345556
/// - advanced_security:
55355557
/// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository.
55365558
/// - secret_scanning:
55375559
/// - secret_scanning_push_protection:
5560+
/// - secret_scanning_non_provider_patterns:
55385561
public init(
55395562
advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil,
55405563
dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil,
55415564
secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil,
5542-
secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil
5565+
secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil,
5566+
secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil
55435567
) {
55445568
self.advanced_security = advanced_security
55455569
self.dependabot_security_updates = dependabot_security_updates
55465570
self.secret_scanning = secret_scanning
55475571
self.secret_scanning_push_protection = secret_scanning_push_protection
5572+
self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns
55485573
}
55495574
public enum CodingKeys: String, CodingKey {
55505575
case advanced_security
55515576
case dependabot_security_updates
55525577
case secret_scanning
55535578
case secret_scanning_push_protection
5579+
case secret_scanning_non_provider_patterns
55545580
}
55555581
}
55565582
/// Minimal Repository

Sources/activity/Types.swift

+27-1
Original file line numberDiff line numberDiff line change
@@ -3493,29 +3493,55 @@ public enum Components {
34933493
}
34943494
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`.
34953495
public var secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload?
3496+
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`.
3497+
public struct secret_scanning_non_provider_patternsPayload: Codable, Hashable, Sendable {
3498+
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`.
3499+
@frozen public enum statusPayload: String, Codable, Hashable, Sendable {
3500+
case enabled = "enabled"
3501+
case disabled = "disabled"
3502+
}
3503+
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`.
3504+
public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload.statusPayload?
3505+
/// Creates a new `secret_scanning_non_provider_patternsPayload`.
3506+
///
3507+
/// - Parameters:
3508+
/// - status:
3509+
public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload.statusPayload? = nil) {
3510+
self.status = status
3511+
}
3512+
public enum CodingKeys: String, CodingKey {
3513+
case status
3514+
}
3515+
}
3516+
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`.
3517+
public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload?
34963518
/// Creates a new `security_hyphen_and_hyphen_analysis`.
34973519
///
34983520
/// - Parameters:
34993521
/// - advanced_security:
35003522
/// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository.
35013523
/// - secret_scanning:
35023524
/// - secret_scanning_push_protection:
3525+
/// - secret_scanning_non_provider_patterns:
35033526
public init(
35043527
advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil,
35053528
dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil,
35063529
secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil,
3507-
secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil
3530+
secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil,
3531+
secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil
35083532
) {
35093533
self.advanced_security = advanced_security
35103534
self.dependabot_security_updates = dependabot_security_updates
35113535
self.secret_scanning = secret_scanning
35123536
self.secret_scanning_push_protection = secret_scanning_push_protection
3537+
self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns
35133538
}
35143539
public enum CodingKeys: String, CodingKey {
35153540
case advanced_security
35163541
case dependabot_security_updates
35173542
case secret_scanning
35183543
case secret_scanning_push_protection
3544+
case secret_scanning_non_provider_patterns
35193545
}
35203546
}
35213547
/// Minimal Repository

Sources/checks/Types.swift

+27-1
Original file line numberDiff line numberDiff line change
@@ -1086,29 +1086,55 @@ public enum Components {
10861086
}
10871087
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`.
10881088
public var secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload?
1089+
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`.
1090+
public struct secret_scanning_non_provider_patternsPayload: Codable, Hashable, Sendable {
1091+
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`.
1092+
@frozen public enum statusPayload: String, Codable, Hashable, Sendable {
1093+
case enabled = "enabled"
1094+
case disabled = "disabled"
1095+
}
1096+
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`.
1097+
public var status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload.statusPayload?
1098+
/// Creates a new `secret_scanning_non_provider_patternsPayload`.
1099+
///
1100+
/// - Parameters:
1101+
/// - status:
1102+
public init(status: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload.statusPayload? = nil) {
1103+
self.status = status
1104+
}
1105+
public enum CodingKeys: String, CodingKey {
1106+
case status
1107+
}
1108+
}
1109+
/// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`.
1110+
public var secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload?
10891111
/// Creates a new `security_hyphen_and_hyphen_analysis`.
10901112
///
10911113
/// - Parameters:
10921114
/// - advanced_security:
10931115
/// - dependabot_security_updates: Enable or disable Dependabot security updates for the repository.
10941116
/// - secret_scanning:
10951117
/// - secret_scanning_push_protection:
1118+
/// - secret_scanning_non_provider_patterns:
10961119
public init(
10971120
advanced_security: Components.Schemas.security_hyphen_and_hyphen_analysis.advanced_securityPayload? = nil,
10981121
dependabot_security_updates: Components.Schemas.security_hyphen_and_hyphen_analysis.dependabot_security_updatesPayload? = nil,
10991122
secret_scanning: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanningPayload? = nil,
1100-
secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil
1123+
secret_scanning_push_protection: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_push_protectionPayload? = nil,
1124+
secret_scanning_non_provider_patterns: Components.Schemas.security_hyphen_and_hyphen_analysis.secret_scanning_non_provider_patternsPayload? = nil
11011125
) {
11021126
self.advanced_security = advanced_security
11031127
self.dependabot_security_updates = dependabot_security_updates
11041128
self.secret_scanning = secret_scanning
11051129
self.secret_scanning_push_protection = secret_scanning_push_protection
1130+
self.secret_scanning_non_provider_patterns = secret_scanning_non_provider_patterns
11061131
}
11071132
public enum CodingKeys: String, CodingKey {
11081133
case advanced_security
11091134
case dependabot_security_updates
11101135
case secret_scanning
11111136
case secret_scanning_push_protection
1137+
case secret_scanning_non_provider_patterns
11121138
}
11131139
}
11141140
/// Minimal Repository

Sources/code-security/Client.swift

+155
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,161 @@ public struct Client: APIProtocol {
369369
}
370370
)
371371
}
372+
/// Detach configurations from repositories
373+
///
374+
/// Detach code security configuration(s) from a set of repositories.
375+
/// Repositories will retain their settings but will no longer be associated with the configuration.
376+
///
377+
/// The authenticated user must be an administrator or security manager for the organization to use this endpoint.
378+
///
379+
/// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint.
380+
///
381+
/// - Remark: HTTP `DELETE /orgs/{org}/code-security/configurations/detach`.
382+
/// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/detach/delete(code-security/detach-configuration)`.
383+
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 {
384+
try await client.send(
385+
input: input,
386+
forOperation: Operations.code_hyphen_security_sol_detach_hyphen_configuration.id,
387+
serializer: { input in
388+
let path = try converter.renderedPath(
389+
template: "/orgs/{}/code-security/configurations/detach",
390+
parameters: [
391+
input.path.org
392+
]
393+
)
394+
var request: HTTPTypes.HTTPRequest = .init(
395+
soar_path: path,
396+
method: .delete
397+
)
398+
suppressMutabilityWarning(&request)
399+
converter.setAcceptHeader(
400+
in: &request.headerFields,
401+
contentTypes: input.headers.accept
402+
)
403+
let body: OpenAPIRuntime.HTTPBody?
404+
switch input.body {
405+
case let .json(value):
406+
body = try converter.setRequiredRequestBodyAsJSON(
407+
value,
408+
headerFields: &request.headerFields,
409+
contentType: "application/json; charset=utf-8"
410+
)
411+
}
412+
return (request, body)
413+
},
414+
deserializer: { response, responseBody in
415+
switch response.status.code {
416+
case 204:
417+
return .noContent(.init())
418+
case 400:
419+
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
420+
let body: Components.Responses.bad_request.Body
421+
let chosenContentType = try converter.bestContentType(
422+
received: contentType,
423+
options: [
424+
"application/json",
425+
"application/scim+json"
426+
]
427+
)
428+
switch chosenContentType {
429+
case "application/json":
430+
body = try await converter.getResponseBodyAsJSON(
431+
Components.Schemas.basic_hyphen_error.self,
432+
from: responseBody,
433+
transforming: { value in
434+
.json(value)
435+
}
436+
)
437+
case "application/scim+json":
438+
body = try await converter.getResponseBodyAsJSON(
439+
Components.Schemas.scim_hyphen_error.self,
440+
from: responseBody,
441+
transforming: { value in
442+
.application_scim_plus_json(value)
443+
}
444+
)
445+
default:
446+
preconditionFailure("bestContentType chose an invalid content type.")
447+
}
448+
return .badRequest(.init(body: body))
449+
case 403:
450+
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
451+
let body: Components.Responses.forbidden.Body
452+
let chosenContentType = try converter.bestContentType(
453+
received: contentType,
454+
options: [
455+
"application/json"
456+
]
457+
)
458+
switch chosenContentType {
459+
case "application/json":
460+
body = try await converter.getResponseBodyAsJSON(
461+
Components.Schemas.basic_hyphen_error.self,
462+
from: responseBody,
463+
transforming: { value in
464+
.json(value)
465+
}
466+
)
467+
default:
468+
preconditionFailure("bestContentType chose an invalid content type.")
469+
}
470+
return .forbidden(.init(body: body))
471+
case 404:
472+
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
473+
let body: Components.Responses.not_found.Body
474+
let chosenContentType = try converter.bestContentType(
475+
received: contentType,
476+
options: [
477+
"application/json"
478+
]
479+
)
480+
switch chosenContentType {
481+
case "application/json":
482+
body = try await converter.getResponseBodyAsJSON(
483+
Components.Schemas.basic_hyphen_error.self,
484+
from: responseBody,
485+
transforming: { value in
486+
.json(value)
487+
}
488+
)
489+
default:
490+
preconditionFailure("bestContentType chose an invalid content type.")
491+
}
492+
return .notFound(.init(body: body))
493+
case 409:
494+
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
495+
let body: Components.Responses.conflict.Body
496+
let chosenContentType = try converter.bestContentType(
497+
received: contentType,
498+
options: [
499+
"application/json"
500+
]
501+
)
502+
switch chosenContentType {
503+
case "application/json":
504+
body = try await converter.getResponseBodyAsJSON(
505+
Components.Schemas.basic_hyphen_error.self,
506+
from: responseBody,
507+
transforming: { value in
508+
.json(value)
509+
}
510+
)
511+
default:
512+
preconditionFailure("bestContentType chose an invalid content type.")
513+
}
514+
return .conflict(.init(body: body))
515+
default:
516+
return .undocumented(
517+
statusCode: response.status.code,
518+
.init(
519+
headerFields: response.headerFields,
520+
body: responseBody
521+
)
522+
)
523+
}
524+
}
525+
)
526+
}
372527
/// Get a code security configuration
373528
///
374529
/// Gets a code security configuration available in an organization.

0 commit comments

Comments
 (0)