diff --git a/Sources/code-scanning/Client.swift b/Sources/code-scanning/Client.swift index ea544637a0b..69f41aa4377 100644 --- a/Sources/code-scanning/Client.swift +++ b/Sources/code-scanning/Client.swift @@ -2083,6 +2083,8 @@ public struct Client: APIProtocol { /// /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. /// + /// This endpoint is limited to 1,000 requests per hour for each user or app installation calling it. + /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/code-scanning/sarifs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/sarifs/post(code-scanning/upload-sarif)`. public func code_hyphen_scanning_sol_upload_hyphen_sarif(_ input: Operations.code_hyphen_scanning_sol_upload_hyphen_sarif.Input) async throws -> Operations.code_hyphen_scanning_sol_upload_hyphen_sarif.Output { diff --git a/Sources/code-scanning/Types.swift b/Sources/code-scanning/Types.swift index 215f92ffe5c..e7261d0f263 100644 --- a/Sources/code-scanning/Types.swift +++ b/Sources/code-scanning/Types.swift @@ -252,6 +252,8 @@ public protocol APIProtocol: Sendable { /// /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. /// + /// This endpoint is limited to 1,000 requests per hour for each user or app installation calling it. + /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/code-scanning/sarifs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/sarifs/post(code-scanning/upload-sarif)`. func code_hyphen_scanning_sol_upload_hyphen_sarif(_ input: Operations.code_hyphen_scanning_sol_upload_hyphen_sarif.Input) async throws -> Operations.code_hyphen_scanning_sol_upload_hyphen_sarif.Output @@ -618,6 +620,8 @@ extension APIProtocol { /// /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. /// + /// This endpoint is limited to 1,000 requests per hour for each user or app installation calling it. + /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/code-scanning/sarifs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/sarifs/post(code-scanning/upload-sarif)`. public func code_hyphen_scanning_sol_upload_hyphen_sarif( @@ -6277,6 +6281,8 @@ public enum Operations { /// /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. /// + /// This endpoint is limited to 1,000 requests per hour for each user or app installation calling it. + /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/code-scanning/sarifs`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/sarifs/post(code-scanning/upload-sarif)`. public enum code_hyphen_scanning_sol_upload_hyphen_sarif { diff --git a/Sources/gists/Types.swift b/Sources/gists/Types.swift index aba5a1ea73b..fac5344e483 100644 --- a/Sources/gists/Types.swift +++ b/Sources/gists/Types.swift @@ -1266,6 +1266,8 @@ public enum Components { public var location: Swift.String? /// - Remark: Generated from `#/components/schemas/public-user/email`. public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/public-user/notification_email`. + public var notification_email: Swift.String? /// - Remark: Generated from `#/components/schemas/public-user/hireable`. public var hireable: Swift.Bool? /// - Remark: Generated from `#/components/schemas/public-user/bio`. @@ -1359,6 +1361,7 @@ public enum Components { /// - blog: /// - location: /// - email: + /// - notification_email: /// - hireable: /// - bio: /// - twitter_username: @@ -1399,6 +1402,7 @@ public enum Components { blog: Swift.String? = nil, location: Swift.String? = nil, email: Swift.String? = nil, + notification_email: Swift.String? = nil, hireable: Swift.Bool? = nil, bio: Swift.String? = nil, twitter_username: Swift.String? = nil, @@ -1439,6 +1443,7 @@ public enum Components { self.blog = blog self.location = location self.email = email + self.notification_email = notification_email self.hireable = hireable self.bio = bio self.twitter_username = twitter_username @@ -1480,6 +1485,7 @@ public enum Components { case blog case location case email + case notification_email case hireable case bio case twitter_username @@ -1591,6 +1597,10 @@ public enum Components { Swift.String.self, forKey: .email ) + notification_email = try container.decodeIfPresent( + Swift.String.self, + forKey: .notification_email + ) hireable = try container.decodeIfPresent( Swift.Bool.self, forKey: .hireable @@ -1679,6 +1689,7 @@ public enum Components { "blog", "location", "email", + "notification_email", "hireable", "bio", "twitter_username", diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index e2333870823..85a5f0dc208 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -12034,6 +12034,108 @@ public enum Components { case parameters } } + /// A tool that must provide code scanning results for this rule to pass. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool`. + public struct repository_hyphen_rule_hyphen_params_hyphen_code_hyphen_scanning_hyphen_tool: Codable, Hashable, Sendable { + /// The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool/alerts_threshold`. + @frozen public enum alerts_thresholdPayload: String, Codable, Hashable, Sendable { + case none = "none" + case errors = "errors" + case errors_and_warnings = "errors_and_warnings" + case all = "all" + } + /// The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool/alerts_threshold`. + public var alerts_threshold: Components.Schemas.repository_hyphen_rule_hyphen_params_hyphen_code_hyphen_scanning_hyphen_tool.alerts_thresholdPayload + /// The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool/security_alerts_threshold`. + @frozen public enum security_alerts_thresholdPayload: String, Codable, Hashable, Sendable { + case none = "none" + case critical = "critical" + case high_or_higher = "high_or_higher" + case medium_or_higher = "medium_or_higher" + case all = "all" + } + /// The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool/security_alerts_threshold`. + public var security_alerts_threshold: Components.Schemas.repository_hyphen_rule_hyphen_params_hyphen_code_hyphen_scanning_hyphen_tool.security_alerts_thresholdPayload + /// The name of a code scanning tool + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-code-scanning-tool/tool`. + public var tool: Swift.String + /// Creates a new `repository_hyphen_rule_hyphen_params_hyphen_code_hyphen_scanning_hyphen_tool`. + /// + /// - Parameters: + /// - alerts_threshold: The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + /// - security_alerts_threshold: The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + /// - tool: The name of a code scanning tool + public init( + alerts_threshold: Components.Schemas.repository_hyphen_rule_hyphen_params_hyphen_code_hyphen_scanning_hyphen_tool.alerts_thresholdPayload, + security_alerts_threshold: Components.Schemas.repository_hyphen_rule_hyphen_params_hyphen_code_hyphen_scanning_hyphen_tool.security_alerts_thresholdPayload, + tool: Swift.String + ) { + self.alerts_threshold = alerts_threshold + self.security_alerts_threshold = security_alerts_threshold + self.tool = tool + } + public enum CodingKeys: String, CodingKey { + case alerts_threshold + case security_alerts_threshold + case tool + } + } + /// Choose which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning`. + public struct repository_hyphen_rule_hyphen_code_hyphen_scanning: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning/type`. + @frozen public enum _typePayload: String, Codable, Hashable, Sendable { + case code_scanning = "code_scanning" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning/type`. + public var _type: Components.Schemas.repository_hyphen_rule_hyphen_code_hyphen_scanning._typePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning/parameters`. + public struct parametersPayload: Codable, Hashable, Sendable { + /// Tools that must provide code scanning results for this rule to pass. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning/parameters/code_scanning_tools`. + public var code_scanning_tools: [Components.Schemas.repository_hyphen_rule_hyphen_params_hyphen_code_hyphen_scanning_hyphen_tool] + /// Creates a new `parametersPayload`. + /// + /// - Parameters: + /// - code_scanning_tools: Tools that must provide code scanning results for this rule to pass. + public init(code_scanning_tools: [Components.Schemas.repository_hyphen_rule_hyphen_params_hyphen_code_hyphen_scanning_hyphen_tool]) { + self.code_scanning_tools = code_scanning_tools + } + public enum CodingKeys: String, CodingKey { + case code_scanning_tools + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-code-scanning/parameters`. + public var parameters: Components.Schemas.repository_hyphen_rule_hyphen_code_hyphen_scanning.parametersPayload? + /// Creates a new `repository_hyphen_rule_hyphen_code_hyphen_scanning`. + /// + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.repository_hyphen_rule_hyphen_code_hyphen_scanning._typePayload, + parameters: Components.Schemas.repository_hyphen_rule_hyphen_code_hyphen_scanning.parametersPayload? = nil + ) { + self._type = _type + self.parameters = parameters + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case parameters + } + } /// A repository rule. /// /// - Remark: Generated from `#/components/schemas/repository-rule`. @@ -12284,6 +12386,8 @@ public enum Components { case case18(Components.Schemas.repository_hyphen_rule.Case18Payload) /// - Remark: Generated from `#/components/schemas/repository-rule/case19`. case repository_hyphen_rule_hyphen_workflows(Components.Schemas.repository_hyphen_rule_hyphen_workflows) + /// - Remark: Generated from `#/components/schemas/repository-rule/case20`. + case repository_hyphen_rule_hyphen_code_hyphen_scanning(Components.Schemas.repository_hyphen_rule_hyphen_code_hyphen_scanning) public init(from decoder: any Decoder) throws { var errors: [any Error] = [] do { @@ -12400,6 +12504,12 @@ public enum Components { } catch { errors.append(error) } + do { + self = .repository_hyphen_rule_hyphen_code_hyphen_scanning(try .init(from: decoder)) + return + } catch { + errors.append(error) + } throw Swift.DecodingError.failedToDecodeOneOfSchema( type: Self.self, codingPath: decoder.codingPath, @@ -12446,6 +12556,8 @@ public enum Components { try value.encode(to: encoder) case let .repository_hyphen_rule_hyphen_workflows(value): try value.encode(to: encoder) + case let .repository_hyphen_rule_hyphen_code_hyphen_scanning(value): + try value.encode(to: encoder) } } } @@ -20835,6 +20947,35 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case15`. case case15(Components.Schemas.repository_hyphen_rule_hyphen_detailed.Case15Payload) + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case16`. + public struct Case16Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case16/value1`. + public var value1: Components.Schemas.repository_hyphen_rule_hyphen_code_hyphen_scanning + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case16/value2`. + public var value2: Components.Schemas.repository_hyphen_rule_hyphen_ruleset_hyphen_info + /// Creates a new `Case16Payload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.repository_hyphen_rule_hyphen_code_hyphen_scanning, + value2: Components.Schemas.repository_hyphen_rule_hyphen_ruleset_hyphen_info + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + value1 = try .init(from: decoder) + value2 = try .init(from: decoder) + } + public func encode(to encoder: any Encoder) throws { + try value1.encode(to: encoder) + try value2.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case16`. + case case16(Components.Schemas.repository_hyphen_rule_hyphen_detailed.Case16Payload) public init(from decoder: any Decoder) throws { var errors: [any Error] = [] do { @@ -20927,6 +21068,12 @@ public enum Components { } catch { errors.append(error) } + do { + self = .case16(try .init(from: decoder)) + return + } catch { + errors.append(error) + } throw Swift.DecodingError.failedToDecodeOneOfSchema( type: Self.self, codingPath: decoder.codingPath, @@ -20965,6 +21112,8 @@ public enum Components { try value.encode(to: encoder) case let .case15(value): try value.encode(to: encoder) + case let .case16(value): + try value.encode(to: encoder) } } } diff --git a/Sources/users/Types.swift b/Sources/users/Types.swift index 0dfd2206e15..cd172f78da8 100644 --- a/Sources/users/Types.swift +++ b/Sources/users/Types.swift @@ -1380,6 +1380,8 @@ public enum Components { public var location: Swift.String? /// - Remark: Generated from `#/components/schemas/public-user/email`. public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/public-user/notification_email`. + public var notification_email: Swift.String? /// - Remark: Generated from `#/components/schemas/public-user/hireable`. public var hireable: Swift.Bool? /// - Remark: Generated from `#/components/schemas/public-user/bio`. @@ -1473,6 +1475,7 @@ public enum Components { /// - blog: /// - location: /// - email: + /// - notification_email: /// - hireable: /// - bio: /// - twitter_username: @@ -1513,6 +1516,7 @@ public enum Components { blog: Swift.String? = nil, location: Swift.String? = nil, email: Swift.String? = nil, + notification_email: Swift.String? = nil, hireable: Swift.Bool? = nil, bio: Swift.String? = nil, twitter_username: Swift.String? = nil, @@ -1553,6 +1557,7 @@ public enum Components { self.blog = blog self.location = location self.email = email + self.notification_email = notification_email self.hireable = hireable self.bio = bio self.twitter_username = twitter_username @@ -1594,6 +1599,7 @@ public enum Components { case blog case location case email + case notification_email case hireable case bio case twitter_username @@ -1705,6 +1711,10 @@ public enum Components { Swift.String.self, forKey: .email ) + notification_email = try container.decodeIfPresent( + Swift.String.self, + forKey: .notification_email + ) hireable = try container.decodeIfPresent( Swift.Bool.self, forKey: .hireable @@ -1793,6 +1803,7 @@ public enum Components { "blog", "location", "email", + "notification_email", "hireable", "bio", "twitter_username", @@ -1862,6 +1873,8 @@ public enum Components { public var location: Swift.String? /// - Remark: Generated from `#/components/schemas/private-user/email`. public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/private-user/notification_email`. + public var notification_email: Swift.String? /// - Remark: Generated from `#/components/schemas/private-user/hireable`. public var hireable: Swift.Bool? /// - Remark: Generated from `#/components/schemas/private-user/bio`. @@ -1961,6 +1974,7 @@ public enum Components { /// - blog: /// - location: /// - email: + /// - notification_email: /// - hireable: /// - bio: /// - twitter_username: @@ -2004,6 +2018,7 @@ public enum Components { blog: Swift.String? = nil, location: Swift.String? = nil, email: Swift.String? = nil, + notification_email: Swift.String? = nil, hireable: Swift.Bool? = nil, bio: Swift.String? = nil, twitter_username: Swift.String? = nil, @@ -2047,6 +2062,7 @@ public enum Components { self.blog = blog self.location = location self.email = email + self.notification_email = notification_email self.hireable = hireable self.bio = bio self.twitter_username = twitter_username @@ -2091,6 +2107,7 @@ public enum Components { case blog case location case email + case notification_email case hireable case bio case twitter_username diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index 315cea70bdf..1e07c603738 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit 315cea70bdf7693058de84c6390ba9776eed00c0 +Subproject commit 1e07c6037387c7923c9e5665d335687deadb68e1