Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ builder:
- GitHubRestAPICampaigns
- GitHubRestAPIChecks
- GitHubRestAPIClassroom
- GitHubRestAPICode_Quality
- GitHubRestAPICode_Scanning
- GitHubRestAPICode_Security
- GitHubRestAPICodes_Of_Conduct
Expand Down
9 changes: 9 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ let package = Package(
.library(name: "GitHubRestAPICampaigns", targets: ["GitHubRestAPICampaigns"]),
.library(name: "GitHubRestAPIChecks", targets: ["GitHubRestAPIChecks"]),
.library(name: "GitHubRestAPIClassroom", targets: ["GitHubRestAPIClassroom"]),
.library(name: "GitHubRestAPICode_Quality", targets: ["GitHubRestAPICode_Quality"]),
.library(name: "GitHubRestAPICode_Scanning", targets: ["GitHubRestAPICode_Scanning"]),
.library(name: "GitHubRestAPICode_Security", targets: ["GitHubRestAPICode_Security"]),
.library(name: "GitHubRestAPICodes_Of_Conduct", targets: ["GitHubRestAPICodes_Of_Conduct"]),
Expand Down Expand Up @@ -128,6 +129,14 @@ let package = Package(
],
path: "Sources/classroom"
),
.target(
name: "GitHubRestAPICode_Quality",
dependencies: [
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
.product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"),
],
path: "Sources/code-quality"
),
.target(
name: "GitHubRestAPICode_Scanning",
dependencies: [
Expand Down
54 changes: 51 additions & 3 deletions Sources/actions/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10598,21 +10598,37 @@ public enum Components {
///
/// - Remark: Generated from `#/components/schemas/oidc-custom-sub-repo/include_claim_keys`.
public var includeClaimKeys: [Swift.String]?
/// Whether the repository has opted in to the immutable OIDC subject claim format. When `true`, OIDC tokens will use a stable, repository-ID-based `sub` claim. If not set at the repository level, falls back to the organization-level setting.
///
/// - Remark: Generated from `#/components/schemas/oidc-custom-sub-repo/use_immutable_subject`.
public var useImmutableSubject: Swift.Bool?
/// The current `sub` claim prefix for this repository.
///
/// - Remark: Generated from `#/components/schemas/oidc-custom-sub-repo/sub_claim_prefix`.
public var subClaimPrefix: Swift.String?
/// Creates a new `OidcCustomSubRepo`.
///
/// - Parameters:
/// - useDefault: Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored.
/// - includeClaimKeys: Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.
/// - useImmutableSubject: Whether the repository has opted in to the immutable OIDC subject claim format. When `true`, OIDC tokens will use a stable, repository-ID-based `sub` claim. If not set at the repository level, falls back to the organization-level setting.
/// - subClaimPrefix: The current `sub` claim prefix for this repository.
public init(
useDefault: Swift.Bool,
includeClaimKeys: [Swift.String]? = nil
includeClaimKeys: [Swift.String]? = nil,
useImmutableSubject: Swift.Bool? = nil,
subClaimPrefix: Swift.String? = nil
) {
self.useDefault = useDefault
self.includeClaimKeys = includeClaimKeys
self.useImmutableSubject = useImmutableSubject
self.subClaimPrefix = subClaimPrefix
}
public enum CodingKeys: String, CodingKey {
case useDefault = "use_default"
case includeClaimKeys = "include_claim_keys"
case useImmutableSubject = "use_immutable_subject"
case subClaimPrefix = "sub_claim_prefix"
}
}
/// Set secrets for GitHub Actions.
Expand Down Expand Up @@ -16917,6 +16933,18 @@ public enum Operations {
///
/// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/size`.
public var size: Swift.String?
/// The source type of the runner image to use. Must match the source of the image specified by `image_id`. Can be one of `github`, `partner`, or `custom`.
///
/// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/image_source`.
@frozen public enum ImageSourcePayload: String, Codable, Hashable, Sendable, CaseIterable {
case github = "github"
case partner = "partner"
case custom = "custom"
}
/// The source type of the runner image to use. Must match the source of the image specified by `image_id`. Can be one of `github`, `partner`, or `custom`.
///
/// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/image_source`.
public var imageSource: Operations.ActionsUpdateHostedRunnerForOrg.Input.Body.JsonPayload.ImageSourcePayload?
/// The unique identifier of the runner image. To list available images, use `GET /actions/hosted-runners/images/github-owned`, `GET /actions/hosted-runners/images/partner`, or `GET /actions/hosted-runners/images/custom`.
///
/// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/image_id`.
Expand All @@ -16925,6 +16953,10 @@ public enum Operations {
///
/// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/image_version`.
public var imageVersion: Swift.String?
/// Whether to enable image generation for this runner pool. When enabled, the runner pool is used to build and publish custom runner images.
///
/// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/image_gen`.
public var imageGen: Swift.Bool?
/// Creates a new `JsonPayload`.
///
/// - Parameters:
Expand All @@ -16933,33 +16965,41 @@ public enum Operations {
/// - maximumRunners: The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost.
/// - enableStaticIp: Whether this runner should be updated with a static public IP. Note limit on account. To list limits on account, use `GET actions/hosted-runners/limits`
/// - size: The machine size of the runner. To list available sizes, use `GET actions/hosted-runners/machine-sizes`
/// - imageSource: The source type of the runner image to use. Must match the source of the image specified by `image_id`. Can be one of `github`, `partner`, or `custom`.
/// - imageId: The unique identifier of the runner image. To list available images, use `GET /actions/hosted-runners/images/github-owned`, `GET /actions/hosted-runners/images/partner`, or `GET /actions/hosted-runners/images/custom`.
/// - imageVersion: The version of the runner image to deploy. This is relevant only for runners using custom images.
/// - imageGen: Whether to enable image generation for this runner pool. When enabled, the runner pool is used to build and publish custom runner images.
public init(
name: Swift.String? = nil,
runnerGroupId: Swift.Int? = nil,
maximumRunners: Swift.Int? = nil,
enableStaticIp: Swift.Bool? = nil,
size: Swift.String? = nil,
imageSource: Operations.ActionsUpdateHostedRunnerForOrg.Input.Body.JsonPayload.ImageSourcePayload? = nil,
imageId: Swift.String? = nil,
imageVersion: Swift.String? = nil
imageVersion: Swift.String? = nil,
imageGen: Swift.Bool? = nil
) {
self.name = name
self.runnerGroupId = runnerGroupId
self.maximumRunners = maximumRunners
self.enableStaticIp = enableStaticIp
self.size = size
self.imageSource = imageSource
self.imageId = imageId
self.imageVersion = imageVersion
self.imageGen = imageGen
}
public enum CodingKeys: String, CodingKey {
case name
case runnerGroupId = "runner_group_id"
case maximumRunners = "maximum_runners"
case enableStaticIp = "enable_static_ip"
case size
case imageSource = "image_source"
case imageId = "image_id"
case imageVersion = "image_version"
case imageGen = "image_gen"
}
}
/// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/content/application\/json`.
Expand Down Expand Up @@ -30462,21 +30502,29 @@ public enum Operations {
///
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json/include_claim_keys`.
public var includeClaimKeys: [Swift.String]?
/// Whether to opt in to the immutable OIDC subject claim format for this repository. When `true`, OIDC tokens will use a stable, repository-ID-based `sub` claim.
///
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json/use_immutable_subject`.
public var useImmutableSubject: Swift.Bool?
/// Creates a new `JsonPayload`.
///
/// - Parameters:
/// - useDefault: Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored.
/// - includeClaimKeys: Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.
/// - useImmutableSubject: Whether to opt in to the immutable OIDC subject claim format for this repository. When `true`, OIDC tokens will use a stable, repository-ID-based `sub` claim.
public init(
useDefault: Swift.Bool,
includeClaimKeys: [Swift.String]? = nil
includeClaimKeys: [Swift.String]? = nil,
useImmutableSubject: Swift.Bool? = nil
) {
self.useDefault = useDefault
self.includeClaimKeys = includeClaimKeys
self.useImmutableSubject = useImmutableSubject
}
public enum CodingKeys: String, CodingKey {
case useDefault = "use_default"
case includeClaimKeys = "include_claim_keys"
case useImmutableSubject = "use_immutable_subject"
}
}
/// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/content/application\/json`.
Expand Down
41 changes: 41 additions & 0 deletions Sources/code-quality/Client.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Generated by swift-openapi-generator, do not modify.
@_spi(Generated) import OpenAPIRuntime
#if os(Linux)
@preconcurrency import struct Foundation.URL
@preconcurrency import struct Foundation.Data
@preconcurrency import struct Foundation.Date
#else
import struct Foundation.URL
import struct Foundation.Data
import struct Foundation.Date
#endif
import HTTPTypes
/// GitHub's v3 REST API.
public struct Client: APIProtocol {
/// The underlying HTTP client.
private let client: UniversalClient
/// Creates a new client.
/// - Parameters:
/// - serverURL: The server URL that the client connects to. Any server
/// URLs defined in the OpenAPI document are available as static methods
/// on the ``Servers`` type.
/// - configuration: A set of configuration values for the client.
/// - transport: A transport that performs HTTP operations.
/// - middlewares: A list of middlewares to call before the transport.
public init(
serverURL: Foundation.URL,
configuration: Configuration = .init(),
transport: any ClientTransport,
middlewares: [any ClientMiddleware] = []
) {
self.client = .init(
serverURL: serverURL,
configuration: configuration,
transport: transport,
middlewares: middlewares
)
}
private var converter: Converter {
client.converter
}
}
53 changes: 53 additions & 0 deletions Sources/code-quality/Types.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Generated by swift-openapi-generator, do not modify.
@_spi(Generated) import OpenAPIRuntime
#if os(Linux)
@preconcurrency import struct Foundation.URL
@preconcurrency import struct Foundation.Data
@preconcurrency import struct Foundation.Date
#else
import struct Foundation.URL
import struct Foundation.Data
import struct Foundation.Date
#endif
/// A type that performs HTTP operations defined by the OpenAPI document.
public protocol APIProtocol: Sendable {}

/// Convenience overloads for operation inputs.
extension APIProtocol {
}

/// Server URLs defined in the OpenAPI document.
public enum Servers {
public enum Server1 {
public static func url() throws -> Foundation.URL {
try Foundation.URL(
validatingOpenAPIServerURL: "https://api.github.com",
variables: []
)
}
}
@available(*, deprecated, renamed: "Servers.Server1.url")
public static func server1() throws -> Foundation.URL {
try Foundation.URL(
validatingOpenAPIServerURL: "https://api.github.com",
variables: []
)
}
}

/// Types generated from the components section of the OpenAPI document.
public enum Components {
/// Types generated from the `#/components/schemas` section of the OpenAPI document.
public enum Schemas {}
/// Types generated from the `#/components/parameters` section of the OpenAPI document.
public enum Parameters {}
/// Types generated from the `#/components/requestBodies` section of the OpenAPI document.
public enum RequestBodies {}
/// Types generated from the `#/components/responses` section of the OpenAPI document.
public enum Responses {}
/// Types generated from the `#/components/headers` section of the OpenAPI document.
public enum Headers {}
}

/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document.
public enum Operations {}
6 changes: 3 additions & 3 deletions Sources/code-security/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6445,20 +6445,20 @@ public enum Operations {
/// An array of repository IDs to detach from configurations. Up to 250 IDs can be provided.
///
/// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/detach/DELETE/requestBody/json/selected_repository_ids`.
public var selectedRepositoryIds: [Swift.Int]?
public var selectedRepositoryIds: [Swift.Int]
/// Creates a new `JsonPayload`.
///
/// - Parameters:
/// - selectedRepositoryIds: An array of repository IDs to detach from configurations. Up to 250 IDs can be provided.
public init(selectedRepositoryIds: [Swift.Int]? = nil) {
public init(selectedRepositoryIds: [Swift.Int]) {
self.selectedRepositoryIds = selectedRepositoryIds
}
public enum CodingKeys: String, CodingKey {
case selectedRepositoryIds = "selected_repository_ids"
}
public init(from decoder: any Swift.Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.selectedRepositoryIds = try container.decodeIfPresent(
self.selectedRepositoryIds = try container.decode(
[Swift.Int].self,
forKey: .selectedRepositoryIds
)
Expand Down
Loading