Skip to content

Commit a346e32

Browse files
Commit via running: make Sources/secret-scanning
1 parent 1a3b6eb commit a346e32

2 files changed

Lines changed: 71 additions & 2 deletions

File tree

Sources/secret-scanning/Client.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,13 @@ public struct Client: APIProtocol {
183183
name: "hide_secret",
184184
value: input.query.hideSecret
185185
)
186+
try converter.setQueryItemAsURI(
187+
in: &request,
188+
style: .form,
189+
explode: true,
190+
name: "is_bypassed",
191+
value: input.query.isBypassed
192+
)
186193
converter.setAcceptHeader(
187194
in: &request.headerFields,
188195
contentTypes: input.headers.accept
@@ -727,6 +734,13 @@ public struct Client: APIProtocol {
727734
name: "hide_secret",
728735
value: input.query.hideSecret
729736
)
737+
try converter.setQueryItemAsURI(
738+
in: &request,
739+
style: .form,
740+
explode: true,
741+
name: "is_bypassed",
742+
value: input.query.isBypassed
743+
)
730744
converter.setAcceptHeader(
731745
in: &request.headerFields,
732746
contentTypes: input.headers.accept
@@ -967,6 +981,8 @@ public struct Client: APIProtocol {
967981
return .ok(.init(body: body))
968982
case 400:
969983
return .badRequest(.init())
984+
case 403:
985+
return .forbidden(.init())
970986
case 404:
971987
return .notFound(.init())
972988
case 422:

Sources/secret-scanning/Types.swift

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3017,6 +3017,10 @@ public enum Components {
30173017
///
30183018
/// - Remark: Generated from `#/components/parameters/secret-scanning-alert-hide-secret`.
30193019
public typealias SecretScanningAlertHideSecret = Swift.Bool
3020+
/// A boolean value (`true` or `false`) indicating whether to filter alerts by their push protection bypass status. When set to `true`, only alerts that were created because a push protection rule was bypassed will be returned. When set to `false`, only alerts that were not caused by a push protection bypass will be returned.
3021+
///
3022+
/// - Remark: Generated from `#/components/parameters/secret-scanning-alert-bypassed`.
3023+
public typealias SecretScanningAlertBypassed = Swift.Bool
30203024
/// The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation.
30213025
///
30223026
/// - Remark: Generated from `#/components/parameters/alert-number`.
@@ -3380,6 +3384,10 @@ public enum Operations {
33803384
///
33813385
/// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/hide_secret`.
33823386
public var hideSecret: Components.Parameters.SecretScanningAlertHideSecret?
3387+
/// A boolean value (`true` or `false`) indicating whether to filter alerts by their push protection bypass status. When set to `true`, only alerts that were created because a push protection rule was bypassed will be returned. When set to `false`, only alerts that were not caused by a push protection bypass will be returned.
3388+
///
3389+
/// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/is_bypassed`.
3390+
public var isBypassed: Components.Parameters.SecretScanningAlertBypassed?
33833391
/// Creates a new `Query`.
33843392
///
33853393
/// - Parameters:
@@ -3400,6 +3408,7 @@ public enum Operations {
34003408
/// - isPubliclyLeaked: A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present.
34013409
/// - isMultiRepo: A boolean value representing whether or not to filter alerts by the multi-repo tag being present.
34023410
/// - hideSecret: A boolean value representing whether or not to hide literal secrets in the results.
3411+
/// - isBypassed: A boolean value (`true` or `false`) indicating whether to filter alerts by their push protection bypass status. When set to `true`, only alerts that were created because a push protection rule was bypassed will be returned. When set to `false`, only alerts that were not caused by a push protection bypass will be returned.
34033412
public init(
34043413
state: Components.Parameters.SecretScanningAlertState? = nil,
34053414
secretType: Components.Parameters.SecretScanningAlertSecretType? = nil,
@@ -3417,7 +3426,8 @@ public enum Operations {
34173426
validity: Components.Parameters.SecretScanningAlertValidity? = nil,
34183427
isPubliclyLeaked: Components.Parameters.SecretScanningAlertPubliclyLeaked? = nil,
34193428
isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? = nil,
3420-
hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil
3429+
hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil,
3430+
isBypassed: Components.Parameters.SecretScanningAlertBypassed? = nil
34213431
) {
34223432
self.state = state
34233433
self.secretType = secretType
@@ -3436,6 +3446,7 @@ public enum Operations {
34363446
self.isPubliclyLeaked = isPubliclyLeaked
34373447
self.isMultiRepo = isMultiRepo
34383448
self.hideSecret = hideSecret
3449+
self.isBypassed = isBypassed
34393450
}
34403451
}
34413452
public var query: Operations.SecretScanningListAlertsForOrg.Input.Query
@@ -4320,6 +4331,10 @@ public enum Operations {
43204331
///
43214332
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/hide_secret`.
43224333
public var hideSecret: Components.Parameters.SecretScanningAlertHideSecret?
4334+
/// A boolean value (`true` or `false`) indicating whether to filter alerts by their push protection bypass status. When set to `true`, only alerts that were created because a push protection rule was bypassed will be returned. When set to `false`, only alerts that were not caused by a push protection bypass will be returned.
4335+
///
4336+
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/is_bypassed`.
4337+
public var isBypassed: Components.Parameters.SecretScanningAlertBypassed?
43234338
/// Creates a new `Query`.
43244339
///
43254340
/// - Parameters:
@@ -4340,6 +4355,7 @@ public enum Operations {
43404355
/// - isPubliclyLeaked: A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present.
43414356
/// - isMultiRepo: A boolean value representing whether or not to filter alerts by the multi-repo tag being present.
43424357
/// - hideSecret: A boolean value representing whether or not to hide literal secrets in the results.
4358+
/// - isBypassed: A boolean value (`true` or `false`) indicating whether to filter alerts by their push protection bypass status. When set to `true`, only alerts that were created because a push protection rule was bypassed will be returned. When set to `false`, only alerts that were not caused by a push protection bypass will be returned.
43434359
public init(
43444360
state: Components.Parameters.SecretScanningAlertState? = nil,
43454361
secretType: Components.Parameters.SecretScanningAlertSecretType? = nil,
@@ -4357,7 +4373,8 @@ public enum Operations {
43574373
validity: Components.Parameters.SecretScanningAlertValidity? = nil,
43584374
isPubliclyLeaked: Components.Parameters.SecretScanningAlertPubliclyLeaked? = nil,
43594375
isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? = nil,
4360-
hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil
4376+
hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil,
4377+
isBypassed: Components.Parameters.SecretScanningAlertBypassed? = nil
43614378
) {
43624379
self.state = state
43634380
self.secretType = secretType
@@ -4376,6 +4393,7 @@ public enum Operations {
43764393
self.isPubliclyLeaked = isPubliclyLeaked
43774394
self.isMultiRepo = isMultiRepo
43784395
self.hideSecret = hideSecret
4396+
self.isBypassed = isBypassed
43794397
}
43804398
}
43814399
public var query: Operations.SecretScanningListAlertsForRepo.Input.Query
@@ -5046,6 +5064,41 @@ public enum Operations {
50465064
}
50475065
}
50485066
}
5067+
public struct Forbidden: Sendable, Hashable {
5068+
/// Creates a new `Forbidden`.
5069+
public init() {}
5070+
}
5071+
/// Delegated alert dismissal is enabled and the authenticated user is not a valid reviewer.
5072+
///
5073+
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/403`.
5074+
///
5075+
/// HTTP response code: `403 forbidden`.
5076+
case forbidden(Operations.SecretScanningUpdateAlert.Output.Forbidden)
5077+
/// Delegated alert dismissal is enabled and the authenticated user is not a valid reviewer.
5078+
///
5079+
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/403`.
5080+
///
5081+
/// HTTP response code: `403 forbidden`.
5082+
public static var forbidden: Self {
5083+
.forbidden(.init())
5084+
}
5085+
/// The associated value of the enum case if `self` is `.forbidden`.
5086+
///
5087+
/// - Throws: An error if `self` is not `.forbidden`.
5088+
/// - SeeAlso: `.forbidden`.
5089+
public var forbidden: Operations.SecretScanningUpdateAlert.Output.Forbidden {
5090+
get throws {
5091+
switch self {
5092+
case let .forbidden(response):
5093+
return response
5094+
default:
5095+
try throwUnexpectedResponseStatus(
5096+
expectedStatus: "forbidden",
5097+
response: self
5098+
)
5099+
}
5100+
}
5101+
}
50495102
public struct NotFound: Sendable, Hashable {
50505103
/// Creates a new `NotFound`.
50515104
public init() {}

0 commit comments

Comments
 (0)