Skip to content

Commit 6c5308e

Browse files
Commit via running: make Sources/dependabot
1 parent e6e9cd7 commit 6c5308e

File tree

2 files changed

+134
-15
lines changed

2 files changed

+134
-15
lines changed

Sources/dependabot/Client.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,13 @@ public struct Client: APIProtocol {
693693
name: "has",
694694
value: input.query.has
695695
)
696+
try converter.setQueryItemAsURI(
697+
in: &request,
698+
style: .form,
699+
explode: true,
700+
name: "runtime_risk",
701+
value: input.query.runtimeRisk
702+
)
696703
try converter.setQueryItemAsURI(
697704
in: &request,
698705
style: .form,

Sources/dependabot/Types.swift

Lines changed: 127 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4322,6 +4322,57 @@ public enum Components {
43224322
///
43234323
/// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-artifact-registry`.
43244324
public typealias DependabotAlertCommaSeparatedArtifactRegistry = Swift.String
4325+
/// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned.
4326+
/// Multiple `has` filters can be passed to filter for alerts that have all of the values.
4327+
///
4328+
/// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has`.
4329+
@frozen public enum DependabotAlertOrgScopeCommaSeparatedHas: Codable, Hashable, Sendable {
4330+
/// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case1`.
4331+
case case1(Swift.String)
4332+
/// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/Case2Payload`.
4333+
@frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable {
4334+
case patch = "patch"
4335+
case deployment = "deployment"
4336+
}
4337+
/// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`.
4338+
public typealias Case2Payload = [Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2PayloadPayload]
4339+
/// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`.
4340+
case case2(Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2Payload)
4341+
public init(from decoder: any Decoder) throws {
4342+
var errors: [any Error] = []
4343+
do {
4344+
self = .case1(try decoder.decodeFromSingleValueContainer())
4345+
return
4346+
} catch {
4347+
errors.append(error)
4348+
}
4349+
do {
4350+
self = .case2(try decoder.decodeFromSingleValueContainer())
4351+
return
4352+
} catch {
4353+
errors.append(error)
4354+
}
4355+
throw Swift.DecodingError.failedToDecodeOneOfSchema(
4356+
type: Self.self,
4357+
codingPath: decoder.codingPath,
4358+
errors: errors
4359+
)
4360+
}
4361+
public func encode(to encoder: any Encoder) throws {
4362+
switch self {
4363+
case let .case1(value):
4364+
try encoder.encodeToSingleValueContainer(value)
4365+
case let .case2(value):
4366+
try encoder.encodeToSingleValueContainer(value)
4367+
}
4368+
}
4369+
}
4370+
/// A comma-separated list of runtime risk strings. If specified, only alerts for repositories with deployment records matching these risks will be returned.
4371+
///
4372+
/// Can be: `critical-resource`, `internet-exposed`, `sensitive-data`, `lateral-movement`
4373+
///
4374+
/// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-runtime-risk`.
4375+
public typealias DependabotAlertCommaSeparatedRuntimeRisk = Swift.String
43254376
/// A comma-separated list of full manifest paths. If specified, only alerts for these manifests will be returned.
43264377
///
43274378
/// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-manifests`.
@@ -5631,18 +5682,19 @@ public enum Operations {
56315682
///
56325683
/// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/artifact_registry`.
56335684
public var artifactRegistry: Components.Parameters.DependabotAlertCommaSeparatedArtifactRegistry?
5634-
/// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`.
5635-
@frozen public enum DependabotAlertCommaSeparatedHas: Codable, Hashable, Sendable {
5636-
/// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`.
5685+
/// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has`.
5686+
@frozen public enum DependabotAlertOrgScopeCommaSeparatedHas: Codable, Hashable, Sendable {
5687+
/// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case1`.
56375688
case case1(Swift.String)
5638-
/// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/Case2Payload`.
5689+
/// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/Case2Payload`.
56395690
@frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable {
56405691
case patch = "patch"
5692+
case deployment = "deployment"
56415693
}
5642-
/// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`.
5643-
public typealias Case2Payload = [Components.Parameters.DependabotAlertCommaSeparatedHas.Case2PayloadPayload]
5644-
/// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`.
5645-
case case2(Components.Parameters.DependabotAlertCommaSeparatedHas.Case2Payload)
5694+
/// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`.
5695+
public typealias Case2Payload = [Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2PayloadPayload]
5696+
/// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`.
5697+
case case2(Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2Payload)
56465698
public init(from decoder: any Decoder) throws {
56475699
var errors: [any Error] = []
56485700
do {
@@ -5673,10 +5725,16 @@ public enum Operations {
56735725
}
56745726
}
56755727
/// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned.
5676-
/// Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported.
5728+
/// Multiple `has` filters can be passed to filter for alerts that have all of the values.
56775729
///
56785730
/// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/has`.
5679-
public var has: Components.Parameters.DependabotAlertCommaSeparatedHas?
5731+
public var has: Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas?
5732+
/// A comma-separated list of runtime risk strings. If specified, only alerts for repositories with deployment records matching these risks will be returned.
5733+
///
5734+
/// Can be: `critical-resource`, `internet-exposed`, `sensitive-data`, `lateral-movement`
5735+
///
5736+
/// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/runtime_risk`.
5737+
public var runtimeRisk: Components.Parameters.DependabotAlertCommaSeparatedRuntimeRisk?
56805738
/// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`.
56815739
@frozen public enum DependabotAlertScope: String, Codable, Hashable, Sendable, CaseIterable {
56825740
case development = "development"
@@ -5743,6 +5801,7 @@ public enum Operations {
57435801
/// - artifactRegistryUrl: A comma-separated list of artifact registry URLs. If specified, only alerts for repositories with storage records matching these URLs will be returned.
57445802
/// - artifactRegistry: A comma-separated list of Artifact Registry name strings. If specified, only alerts for repositories with storage records matching these registries will be returned.
57455803
/// - has: Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned.
5804+
/// - runtimeRisk: A comma-separated list of runtime risk strings. If specified, only alerts for repositories with deployment records matching these risks will be returned.
57465805
/// - scope: The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned.
57475806
/// - sort: The property by which to sort the results.
57485807
/// - direction: The direction to sort the results by.
@@ -5759,7 +5818,8 @@ public enum Operations {
57595818
epssPercentage: Components.Parameters.DependabotAlertCommaSeparatedEpss? = nil,
57605819
artifactRegistryUrl: Components.Parameters.DependabotAlertCommaSeparatedArtifactRegistryUrls? = nil,
57615820
artifactRegistry: Components.Parameters.DependabotAlertCommaSeparatedArtifactRegistry? = nil,
5762-
has: Components.Parameters.DependabotAlertCommaSeparatedHas? = nil,
5821+
has: Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas? = nil,
5822+
runtimeRisk: Components.Parameters.DependabotAlertCommaSeparatedRuntimeRisk? = nil,
57635823
scope: Components.Parameters.DependabotAlertScope? = nil,
57645824
sort: Components.Parameters.DependabotAlertSort? = nil,
57655825
direction: Components.Parameters.Direction? = nil,
@@ -5777,6 +5837,7 @@ public enum Operations {
57775837
self.artifactRegistryUrl = artifactRegistryUrl
57785838
self.artifactRegistry = artifactRegistry
57795839
self.has = has
5840+
self.runtimeRisk = runtimeRisk
57805841
self.scope = scope
57815842
self.sort = sort
57825843
self.direction = direction
@@ -6582,22 +6643,73 @@ public enum Operations {
65826643
///
65836644
/// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/visibility`.
65846645
public var visibility: Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.VisibilityPayload
6585-
/// An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints.
6646+
/// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/SelectedRepositoryIdsPayload`.
6647+
public struct SelectedRepositoryIdsPayloadPayload: Codable, Hashable, Sendable {
6648+
/// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/SelectedRepositoryIdsPayload/value1`.
6649+
public var value1: Swift.Int?
6650+
/// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/SelectedRepositoryIdsPayload/value2`.
6651+
public var value2: Swift.String?
6652+
/// Creates a new `SelectedRepositoryIdsPayloadPayload`.
6653+
///
6654+
/// - Parameters:
6655+
/// - value1:
6656+
/// - value2:
6657+
public init(
6658+
value1: Swift.Int? = nil,
6659+
value2: Swift.String? = nil
6660+
) {
6661+
self.value1 = value1
6662+
self.value2 = value2
6663+
}
6664+
public init(from decoder: any Decoder) throws {
6665+
var errors: [any Error] = []
6666+
do {
6667+
self.value1 = try decoder.decodeFromSingleValueContainer()
6668+
} catch {
6669+
errors.append(error)
6670+
}
6671+
do {
6672+
self.value2 = try decoder.decodeFromSingleValueContainer()
6673+
} catch {
6674+
errors.append(error)
6675+
}
6676+
try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil(
6677+
[
6678+
self.value1,
6679+
self.value2
6680+
],
6681+
type: Self.self,
6682+
codingPath: decoder.codingPath,
6683+
errors: errors
6684+
)
6685+
}
6686+
public func encode(to encoder: any Encoder) throws {
6687+
try encoder.encodeFirstNonNilValueToSingleValueContainer([
6688+
self.value1,
6689+
self.value2
6690+
])
6691+
}
6692+
}
6693+
/// An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. Use integers when possible, as strings are supported only to maintain backwards compatibility and may be removed in the future.
6694+
///
6695+
/// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/selected_repository_ids`.
6696+
public typealias SelectedRepositoryIdsPayload = [Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.SelectedRepositoryIdsPayloadPayload]
6697+
/// An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. Use integers when possible, as strings are supported only to maintain backwards compatibility and may be removed in the future.
65866698
///
65876699
/// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/selected_repository_ids`.
6588-
public var selectedRepositoryIds: [Swift.String]?
6700+
public var selectedRepositoryIds: Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.SelectedRepositoryIdsPayload?
65896701
/// Creates a new `JsonPayload`.
65906702
///
65916703
/// - Parameters:
65926704
/// - encryptedValue: Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key) endpoint.
65936705
/// - keyId: ID of the key you used to encrypt the secret.
65946706
/// - visibility: Which type of organization repositories have access to the organization secret. `selected` means only the repositories specified by `selected_repository_ids` can access the secret.
6595-
/// - selectedRepositoryIds: An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints.
6707+
/// - selectedRepositoryIds: An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. Use integers when possible, as strings are supported only to maintain backwards compatibility and may be removed in the future.
65966708
public init(
65976709
encryptedValue: Swift.String? = nil,
65986710
keyId: Swift.String? = nil,
65996711
visibility: Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.VisibilityPayload,
6600-
selectedRepositoryIds: [Swift.String]? = nil
6712+
selectedRepositoryIds: Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.SelectedRepositoryIdsPayload? = nil
66016713
) {
66026714
self.encryptedValue = encryptedValue
66036715
self.keyId = keyId

0 commit comments

Comments
 (0)