Skip to content

Commit c4790b8

Browse files
Commit via running ake Sources/security-advisories
1 parent b1fd707 commit c4790b8

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

Sources/security-advisories/Client.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,20 @@ public struct Client: APIProtocol {
137137
name: "modified",
138138
value: input.query.modified
139139
)
140+
try converter.setQueryItemAsURI(
141+
in: &request,
142+
style: .form,
143+
explode: true,
144+
name: "epss_percentage",
145+
value: input.query.epss_percentage
146+
)
147+
try converter.setQueryItemAsURI(
148+
in: &request,
149+
style: .form,
150+
explode: true,
151+
name: "epss_percentile",
152+
value: input.query.epss_percentile
153+
)
140154
try converter.setQueryItemAsURI(
141155
in: &request,
142156
style: .form,

Sources/security-advisories/Types.swift

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,31 @@ public enum Components {
764764
public typealias cwesPayload = [Components.Schemas.global_hyphen_advisory.cwesPayloadPayload]
765765
/// - Remark: Generated from `#/components/schemas/global-advisory/cwes`.
766766
public var cwes: Components.Schemas.global_hyphen_advisory.cwesPayload?
767+
/// - Remark: Generated from `#/components/schemas/global-advisory/epss`.
768+
public struct epssPayload: Codable, Hashable, Sendable {
769+
/// - Remark: Generated from `#/components/schemas/global-advisory/epss/percentage`.
770+
public var percentage: Swift.Double?
771+
/// - Remark: Generated from `#/components/schemas/global-advisory/epss/percentile`.
772+
public var percentile: Swift.Double?
773+
/// Creates a new `epssPayload`.
774+
///
775+
/// - Parameters:
776+
/// - percentage:
777+
/// - percentile:
778+
public init(
779+
percentage: Swift.Double? = nil,
780+
percentile: Swift.Double? = nil
781+
) {
782+
self.percentage = percentage
783+
self.percentile = percentile
784+
}
785+
public enum CodingKeys: String, CodingKey {
786+
case percentage
787+
case percentile
788+
}
789+
}
790+
/// - Remark: Generated from `#/components/schemas/global-advisory/epss`.
791+
public var epss: Components.Schemas.global_hyphen_advisory.epssPayload?
767792
/// - Remark: Generated from `#/components/schemas/global-advisory/creditsPayload`.
768793
public struct creditsPayloadPayload: Codable, Hashable, Sendable {
769794
/// - Remark: Generated from `#/components/schemas/global-advisory/creditsPayload/user`.
@@ -818,6 +843,7 @@ public enum Components {
818843
/// - vulnerabilities: The products and respective version ranges affected by the advisory.
819844
/// - cvss:
820845
/// - cwes:
846+
/// - epss:
821847
/// - credits: The users who contributed to the advisory.
822848
public init(
823849
ghsa_id: Swift.String,
@@ -840,6 +866,7 @@ public enum Components {
840866
vulnerabilities: [Components.Schemas.vulnerability]? = nil,
841867
cvss: Components.Schemas.global_hyphen_advisory.cvssPayload? = nil,
842868
cwes: Components.Schemas.global_hyphen_advisory.cwesPayload? = nil,
869+
epss: Components.Schemas.global_hyphen_advisory.epssPayload? = nil,
843870
credits: Components.Schemas.global_hyphen_advisory.creditsPayload? = nil
844871
) {
845872
self.ghsa_id = ghsa_id
@@ -862,6 +889,7 @@ public enum Components {
862889
self.vulnerabilities = vulnerabilities
863890
self.cvss = cvss
864891
self.cwes = cwes
892+
self.epss = epss
865893
self.credits = credits
866894
}
867895
public enum CodingKeys: String, CodingKey {
@@ -885,6 +913,7 @@ public enum Components {
885913
case vulnerabilities
886914
case cvss
887915
case cwes
916+
case epss
888917
case credits
889918
}
890919
public init(from decoder: any Decoder) throws {
@@ -969,6 +998,10 @@ public enum Components {
969998
Components.Schemas.global_hyphen_advisory.cwesPayload.self,
970999
forKey: .cwes
9711000
)
1001+
epss = try container.decodeIfPresent(
1002+
Components.Schemas.global_hyphen_advisory.epssPayload.self,
1003+
forKey: .epss
1004+
)
9721005
credits = try container.decodeIfPresent(
9731006
Components.Schemas.global_hyphen_advisory.creditsPayload.self,
9741007
forKey: .credits
@@ -994,6 +1027,7 @@ public enum Components {
9941027
"vulnerabilities",
9951028
"cvss",
9961029
"cwes",
1030+
"epss",
9971031
"credits"
9981032
])
9991033
}
@@ -6410,6 +6444,16 @@ public enum Operations {
64106444
///
64116445
/// - Remark: Generated from `#/paths/advisories/GET/query/modified`.
64126446
public var modified: Swift.String?
6447+
/// If specified, only return advisories that have an EPSS percentage score that matches the provided value.
6448+
/// The EPSS percentage represents the likelihood of a CVE being exploited.
6449+
///
6450+
/// - Remark: Generated from `#/paths/advisories/GET/query/epss_percentage`.
6451+
public var epss_percentage: Swift.String?
6452+
/// If specified, only return advisories that have an EPSS percentile score that matches the provided value.
6453+
/// The EPSS percentile represents the relative rank of the CVE's likelihood of being exploited compared to other CVEs.
6454+
///
6455+
/// - Remark: Generated from `#/paths/advisories/GET/query/epss_percentile`.
6456+
public var epss_percentile: Swift.String?
64136457
/// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
64146458
///
64156459
/// - Remark: Generated from `#/paths/advisories/GET/query/before`.
@@ -6435,6 +6479,8 @@ public enum Operations {
64356479
@frozen public enum sortPayload: String, Codable, Hashable, Sendable {
64366480
case updated = "updated"
64376481
case published = "published"
6482+
case epss_percentage = "epss_percentage"
6483+
case epss_percentile = "epss_percentile"
64386484
}
64396485
/// The property to sort the results by.
64406486
///
@@ -6454,6 +6500,8 @@ public enum Operations {
64546500
/// - published: If specified, only return advisories that were published on a date or date range.
64556501
/// - updated: If specified, only return advisories that were updated on a date or date range.
64566502
/// - modified: If specified, only show advisories that were updated or published on a date or date range.
6503+
/// - epss_percentage: If specified, only return advisories that have an EPSS percentage score that matches the provided value.
6504+
/// - epss_percentile: If specified, only return advisories that have an EPSS percentile score that matches the provided value.
64576505
/// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
64586506
/// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
64596507
/// - direction: The direction to sort the results by.
@@ -6471,6 +6519,8 @@ public enum Operations {
64716519
published: Swift.String? = nil,
64726520
updated: Swift.String? = nil,
64736521
modified: Swift.String? = nil,
6522+
epss_percentage: Swift.String? = nil,
6523+
epss_percentile: Swift.String? = nil,
64746524
before: Components.Parameters.pagination_hyphen_before? = nil,
64756525
after: Components.Parameters.pagination_hyphen_after? = nil,
64766526
direction: Components.Parameters.direction? = nil,
@@ -6488,6 +6538,8 @@ public enum Operations {
64886538
self.published = published
64896539
self.updated = updated
64906540
self.modified = modified
6541+
self.epss_percentage = epss_percentage
6542+
self.epss_percentile = epss_percentile
64916543
self.before = before
64926544
self.after = after
64936545
self.direction = direction

0 commit comments

Comments
 (0)