diff --git a/.github/workflows/actions/setup/action.yml b/.github/composites/setup/action.yml similarity index 87% rename from .github/workflows/actions/setup/action.yml rename to .github/composites/setup/action.yml index 284e9c0df27..fd87b1b9392 100644 --- a/.github/workflows/actions/setup/action.yml +++ b/.github/composites/setup/action.yml @@ -11,13 +11,19 @@ inputs: runs: using: 'composite' steps: - - uses: swift-actions/setup-swift@v2 + - uses: jdx/mise-action@v2 + env: + MISE_DATA_DIR: ${{ runner.temp }}/${{ github.action }}/mise with: - swift-version: ${{ inputs.swift }} + mise_toml: | + [tools] + swift = "${{ inputs.swift }}" + [settings] + experimental = true + - uses: irgaly/setup-mint@v1 with: mint-executable-directory: $HOME/.mint/bin - - uses: dcarbone/install-yq-action@v1.1.1 - name: "Xcode Cache" if: contains(inputs.os, 'macos') diff --git a/.github/dependabot-mintfile/MintfileBuilder.swift b/.github/dependabot-mintfile/MintfileBuilder.swift new file mode 100644 index 00000000000..233d17d9a98 --- /dev/null +++ b/.github/dependabot-mintfile/MintfileBuilder.swift @@ -0,0 +1,89 @@ +// +// MintfileBuilder.swift +// GitHubRestAPISwiftOpenAPI +// +// Created by zwc on 2025/5/11. +// + +import Foundation + +struct MintfileBuilder { + + struct Dependency { + let name: String + let baseURL: String + let path: String + let version: String + var urlString: String { "\(baseURL)/\(path)" } + } + + let dependencies = [ + Dependency( + name: "Mint", + baseURL: "https://github.com", + path: "yonaskolb/Mint", + version: "0.17.5" + ), + Dependency( + name: "swift-openapi-generator", + baseURL: "https://github.com", + path: "apple/swift-openapi-generator", + version: "1.7.2" + ) + ] + + func addVersionUpdatesManifests() { + for dependency in dependencies { + let manifestPath = ".github/dependabot-mintfile/manifest-\(dependency.name)" + shell("mkdir -p \(manifestPath); swift package --package-path \(manifestPath) init --type empty") + shell("mkdir -p \(manifestPath); swift package --package-path \(manifestPath) add-dependency \(dependency.urlString) --exact \(dependency.version)") + } + } + + /// provided from ChatGPT + func write(to path: String = "Mintfile") throws { + var lines: [String] = [] + + for dependency in dependencies { + let manifestPath = ".github/dependabot-mintfile/manifest-\(dependency.name)" + "/Package.swift" + let contents = try String(contentsOfFile: manifestPath, encoding: .utf8) + + let pattern = #"\.package\(url:\s*"(.*?)",\s*exact:\s*"(.*?)"\)"# + let regex = try NSRegularExpression(pattern: pattern) + + if let match = regex.firstMatch(in: contents, range: NSRange(contents.startIndex..., in: contents)), + let versionRange = Range(match.range(at: 2), in: contents), + let urlRange = Range(match.range(at: 1), in: contents) { + + let version = String(contents[versionRange]) + let path = URL(string: String(contents[urlRange]))? + .path + .split(separator: "/") + .joined(separator: "/") + + if let path { + lines.append("\(path)@\(version)") + } + } + } + let content = lines.joined(separator: "\n") + "\n" + try content.write(toFile: path, atomically: true, encoding: .utf8) + } + + @discardableResult + private func shell(_ command: String) -> Int32 { + let task = Process() + task.launchPath = "/bin/bash" + task.arguments = ["-c", command] + task.launch() + task.waitUntilExit() + return task.terminationStatus + } +} + +// MintfileBuilder().addVersionUpdatesManifests() +do { + try MintfileBuilder().write() +} catch { + print(error) +} diff --git a/.github/dependabot-mintfile/manifest-Mint/Package.swift b/.github/dependabot-mintfile/manifest-Mint/Package.swift new file mode 100644 index 00000000000..819d7dbc575 --- /dev/null +++ b/.github/dependabot-mintfile/manifest-Mint/Package.swift @@ -0,0 +1,11 @@ +// swift-tools-version: 6.1 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "manifest-Mint", + dependencies: [ + .package(url: "https://github.com/yonaskolb/Mint", exact: "0.18.0"), + ] +) diff --git a/.github/dependabot-mintfile/manifest-swift-openapi-generator/Package.swift b/.github/dependabot-mintfile/manifest-swift-openapi-generator/Package.swift new file mode 100644 index 00000000000..d4604c8551e --- /dev/null +++ b/.github/dependabot-mintfile/manifest-swift-openapi-generator/Package.swift @@ -0,0 +1,11 @@ +// swift-tools-version: 6.1 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "manifest-swift-openapi-generator", + dependencies: [ + .package(url: "https://github.com/apple/swift-openapi-generator", exact: "1.10.3"), + ] +) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index dc976043056..9527c3592c0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,3 +14,9 @@ updates: directory: "/" schedule: interval: "weekly" + + - package-ecosystem: "swift" + directories: + - "/.github/dependabot-mintfile/**/" + schedule: + interval: "weekly" \ No newline at end of file diff --git a/.github/workflows/CI-Dependabot.yml b/.github/workflows/DependabotPulls.yml similarity index 64% rename from .github/workflows/CI-Dependabot.yml rename to .github/workflows/DependabotPulls.yml index 01a52ae33cb..f4edbaf95e7 100644 --- a/.github/workflows/CI-Dependabot.yml +++ b/.github/workflows/DependabotPulls.yml @@ -4,6 +4,7 @@ on: pull_request: paths: - 'Submodule/**' + - '.github/dependabot-mintfile/**' permissions: contents: write @@ -18,26 +19,42 @@ jobs: - ubuntu-latest # - macos-latest #Fix: The macos-latest workflow label currently uses the macOS 12 runner image. # - macos-13 - swift: [5, 6] + swift: + - 5 + # - 6 runs-on: ${{ matrix.os }} - timeout-minutes: 60 + timeout-minutes: 100 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: submodules: true - - uses: ./.github/workflows/actions/setup + - uses: ./.github/composites/setup with: swift: ${{ matrix.swift }} os: ${{ matrix.os }} - - name: "Sync code base" + + - name: "gh pr checkout and git config" env: - PR_URL: ${{ github.event.pull_request.html_url }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh pr checkout ${{ github.event.pull_request.number }} git config user.name "${GITHUB_ACTOR}" git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" + + - name: "Update Mintfile" + run: | + swift .github/dependabot-mintfile/MintfileBuilder.swift + make commit file="Mintfile" + + - name: "Update Sources" + run: | make -j 3 install + + - name: "git push, gh pr auto merge" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | git push gh pr merge --auto --merge "$PR_URL" gh pr review --approve "$PR_URL" diff --git a/.github/workflows/Doc.yml b/.github/workflows/Doc.yml index fdb110f7c2b..ac0fb66893d 100644 --- a/.github/workflows/Doc.yml +++ b/.github/workflows/Doc.yml @@ -25,7 +25,7 @@ jobs: uses: sersoft-gmbh/oss-common-actions/.github/workflows/swift-generate-and-publish-docs.yml@main with: os: ubuntu - swift-version: '5.9' + swift-version: '6' organisation: ${{ github.repository_owner }} repository: ${{ github.event.repository.name }} pages-branch: gh-pages diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index f843ff7065c..1b99f01c5d7 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -9,39 +9,36 @@ concurrency: group: ${{ github.workflow }} cancel-in-progress: true +env: + RELEASE_BRANCH: release + jobs: create-git-branch-release: runs-on: ubuntu-latest permissions: contents: write - env: - RELEASE_BRANCH: release - outputs: - branch: ${{ env.RELEASE_BRANCH }} steps: - - uses: actions/checkout@v4 - - - name: Create release branch - run: git checkout -B $RELEASE_BRANCH - - - name: Remove submodule (if exists) - env: - SUBMODULE_PATH: Submodule/github/rest-api-description - run: | - if [ -d "$SUBMODULE_PATH" ]; then - git config user.name "${GITHUB_ACTOR}" - git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - git submodule deinit -f $SUBMODULE_PATH || true - git rm -f $SUBMODULE_PATH || true - rm -rf .git/modules/$SUBMODULE_PATH || true - git commit -m "Remove submodule" - else - echo "Submodule not found, skipping removal." - fi + - uses: actions/checkout@v5 - - name: Push release branch - run: git push --force --set-upstream origin $RELEASE_BRANCH + - name: Remove submodule to improve Swift Package experience + env: + SUBMODULE_PATH: Submodule/github/rest-api-description + run: | + if [ -d "$SUBMODULE_PATH" ]; then + # + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" + # + git checkout -B $RELEASE_BRANCH + # + git rm $SUBMODULE_PATH + git commit -m "Remove submodule to improve Swift Package experience" + git push --set-upstream origin $RELEASE_BRANCH + else + echo "::error ::Submodule not found, skipping removal." + exit 1 + fi create-github-release: needs: create-git-branch-release @@ -49,10 +46,40 @@ jobs: permissions: contents: write steps: - - uses: Wei18/GitHubSwiftActions/Actions/Release@1.0.7 - with: - owner: ${{ github.repository_owner }} - repo: ${{ github.event.repository.name }} - token: ${{ secrets.GITHUB_TOKEN }} - ref: ${{ needs.create-git-branch-release.outputs.branch }} - type: "patch" + - uses: Wei18/GitHubSwiftActions/Actions/Release@1.0.9 + with: + owner: ${{ github.repository_owner }} + repo: ${{ github.event.repository.name }} + token: ${{ github.token }} + ref: ${{ env.RELEASE_BRANCH }} + type: "patch" + + create-pull-request: + needs: create-github-release + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - uses: actions/checkout@v5 + with: + ref: ${{ env.RELEASE_BRANCH }} + fetch-depth: 2 + + - name: Revert previous commit + run: | + # + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" + # + git revert --no-edit HEAD + git push + + - name: Create pull request + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + PR_URL="$(gh pr create --head $RELEASE_BRANCH --title 'Bump patch version' --body 'Automated monthly release merge')" + gh pr merge --auto --merge "$PR_URL" + gh pr merge --merge --admin "$PR_URL" diff --git a/.github/workflows/CI.yml b/.github/workflows/Test.yml similarity index 88% rename from .github/workflows/CI.yml rename to .github/workflows/Test.yml index 04542e52f8a..0db2fad11b3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/Test.yml @@ -1,4 +1,4 @@ -name: CI +name: Test on: push: @@ -23,10 +23,10 @@ jobs: runs-on: ${{ matrix.os }} timeout-minutes: 30 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: submodules: true - - uses: ./.github/workflows/actions/setup + - uses: ./.github/composites/setup with: swift: ${{ matrix.swift }} os: ${{ matrix.os }} diff --git a/.spi.yml b/.spi.yml index 7ce45f7db18..85b1a64ceb3 100644 --- a/.spi.yml +++ b/.spi.yml @@ -14,10 +14,13 @@ builder: - GitHubRestAPICodes_Of_Conduct - GitHubRestAPICodespaces - GitHubRestAPICopilot + - GitHubRestAPICredentials - GitHubRestAPIDependabot - GitHubRestAPIDependency_Graph - GitHubRestAPIDesktop - GitHubRestAPIEmojis + - GitHubRestAPIEnterprise_Team_Memberships + - GitHubRestAPIEnterprise_Team_Organizations - GitHubRestAPIEnterprise_Teams - GitHubRestAPIGists - GitHubRestAPIGit @@ -35,6 +38,7 @@ builder: - GitHubRestAPIPackages - GitHubRestAPIPrivate_Registries - GitHubRestAPIProjects + - GitHubRestAPIProjects_Classic - GitHubRestAPIPulls - GitHubRestAPIRate_Limit - GitHubRestAPIReactions diff --git a/Makefile b/Makefile index 00ec777e20d..a09373fdf8b 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,8 @@ # Variables .DEFAULT_GOAL := install -OPENAPI_PATH := Submodule/github/rest-api-description/descriptions/api.github.com/api.github.com.yaml -FILTERED_NAMES := $(shell yq -r '.tags[].name' $(OPENAPI_PATH)) +OPENAPI_PATH := Submodule/github/rest-api-description/descriptions/api.github.com/api.github.com.json +FILTERED_NAMES := $(shell swift Scripts/PackageTargetsParser.swift $(OPENAPI_PATH)) SOURCE_DIRS := $(addprefix Sources/, $(FILTERED_NAMES)) PACKAGE_PATHS := Package.swift # Fix: https://github.com/irgaly/setup-mint/pull/25 @@ -16,7 +16,7 @@ MINT_BIN := $(HOME)/.mint/bin/mint .PHONY: commit commit: git add "$(file)" - git commit -m "Commit via running $make $(file)" >/dev/null \ + git commit -m "Commit via running: make $(file)" >/dev/null \ && echo "::notice:: git commit $(file)\n" \ || true; touch "$(file)"; diff --git a/Mintfile b/Mintfile index 9beb12ae401..99766dcea97 100644 --- a/Mintfile +++ b/Mintfile @@ -1,2 +1,2 @@ -yonaskolb/Mint@0.17.5 -apple/swift-openapi-generator@1.7.2 +yonaskolb/Mint@0.18.0 +apple/swift-openapi-generator@1.10.3 diff --git a/Package.resolved b/Package.resolved index 8c6bb3a0658..384faceaceb 100644 --- a/Package.resolved +++ b/Package.resolved @@ -23,8 +23,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-openapi-runtime", "state" : { - "revision" : "8f33cc5dfe81169fb167da73584b9c72c3e8bc23", - "version" : "1.8.2" + "revision" : "7722cf8eac05c1f1b5b05895b04cfcc29576d9be", + "version" : "1.8.3" } }, { @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-openapi-urlsession", "state" : { - "revision" : "6fac6f7c428d5feea2639b5f5c8b06ddfb79434b", - "version" : "1.1.0" + "revision" : "279aa6b77be6aa842a4bf3c45fa79fa15edf3e07", + "version" : "1.2.0" } } ], diff --git a/Package.swift b/Package.swift index 6306bada50c..47ab49678fb 100644 --- a/Package.swift +++ b/Package.swift @@ -23,10 +23,13 @@ let package = Package( .library(name: "GitHubRestAPICodes_Of_Conduct", targets: ["GitHubRestAPICodes_Of_Conduct"]), .library(name: "GitHubRestAPICodespaces", targets: ["GitHubRestAPICodespaces"]), .library(name: "GitHubRestAPICopilot", targets: ["GitHubRestAPICopilot"]), + .library(name: "GitHubRestAPICredentials", targets: ["GitHubRestAPICredentials"]), .library(name: "GitHubRestAPIDependabot", targets: ["GitHubRestAPIDependabot"]), .library(name: "GitHubRestAPIDependency_Graph", targets: ["GitHubRestAPIDependency_Graph"]), .library(name: "GitHubRestAPIDesktop", targets: ["GitHubRestAPIDesktop"]), .library(name: "GitHubRestAPIEmojis", targets: ["GitHubRestAPIEmojis"]), + .library(name: "GitHubRestAPIEnterprise_Team_Memberships", targets: ["GitHubRestAPIEnterprise_Team_Memberships"]), + .library(name: "GitHubRestAPIEnterprise_Team_Organizations", targets: ["GitHubRestAPIEnterprise_Team_Organizations"]), .library(name: "GitHubRestAPIEnterprise_Teams", targets: ["GitHubRestAPIEnterprise_Teams"]), .library(name: "GitHubRestAPIGists", targets: ["GitHubRestAPIGists"]), .library(name: "GitHubRestAPIGit", targets: ["GitHubRestAPIGit"]), @@ -44,6 +47,7 @@ let package = Package( .library(name: "GitHubRestAPIPackages", targets: ["GitHubRestAPIPackages"]), .library(name: "GitHubRestAPIPrivate_Registries", targets: ["GitHubRestAPIPrivate_Registries"]), .library(name: "GitHubRestAPIProjects", targets: ["GitHubRestAPIProjects"]), + .library(name: "GitHubRestAPIProjects_Classic", targets: ["GitHubRestAPIProjects_Classic"]), .library(name: "GitHubRestAPIPulls", targets: ["GitHubRestAPIPulls"]), .library(name: "GitHubRestAPIRate_Limit", targets: ["GitHubRestAPIRate_Limit"]), .library(name: "GitHubRestAPIReactions", targets: ["GitHubRestAPIReactions"]), @@ -155,6 +159,14 @@ let package = Package( ], path: "Sources/copilot" ), + .target( + name: "GitHubRestAPICredentials", + dependencies: [ + .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), + .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"), + ], + path: "Sources/credentials" + ), .target( name: "GitHubRestAPIDependabot", dependencies: [ @@ -187,6 +199,22 @@ let package = Package( ], path: "Sources/emojis" ), + .target( + name: "GitHubRestAPIEnterprise_Team_Memberships", + dependencies: [ + .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), + .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"), + ], + path: "Sources/enterprise-team-memberships" + ), + .target( + name: "GitHubRestAPIEnterprise_Team_Organizations", + dependencies: [ + .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), + .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"), + ], + path: "Sources/enterprise-team-organizations" + ), .target( name: "GitHubRestAPIEnterprise_Teams", dependencies: [ @@ -323,6 +351,14 @@ let package = Package( ], path: "Sources/projects" ), + .target( + name: "GitHubRestAPIProjects_Classic", + dependencies: [ + .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), + .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"), + ], + path: "Sources/projects-classic" + ), .target( name: "GitHubRestAPIPulls", dependencies: [ diff --git a/Scripts/PackageTargetsParser.swift b/Scripts/PackageTargetsParser.swift new file mode 100644 index 00000000000..8ac6c497f2c --- /dev/null +++ b/Scripts/PackageTargetsParser.swift @@ -0,0 +1,64 @@ +// +// PackageTargetsParser.swift +// GitHubRestAPISwiftOpenAPI +// +// Created by zwc on 2025/5/11. +// + +import Foundation + +struct ErrorMessage: LocalizedError { + var message: String + var errorDescription: String? { message } + init(message: String, line: Int = #line) { + self.message = "\(line): \(message)" + } +} + +/// A struct that parses a JSON file containing a "tags" array, extracting the "name" field from each element. +struct PackageTargetsParser { + + /// Parses the provided JSON file and extracts the "name" values from the "tags" array. + /// + /// - Parameter path: The path to the JSON file to be parsed. + /// - Returns: An array of strings representing the "name" values found in the "tags" array. + /// - Throws: An error if the file cannot be read or the JSON structure is invalid. + /// + /// Example: + /// + /// Given a JSON file: + /// ```json + /// { + /// "tags": [ + /// { "name": "user" }, + /// { "name": "admin" }, + /// { "name": "billing" } + /// ] + /// } + /// ``` + /// The function will return: + /// ```swift + /// ["user", "admin", "billing"] + /// ``` + func parse(from path: String) throws -> [String] { + let data = try Data(contentsOf: URL(fileURLWithPath: path)) + let json = try JSONSerialization.jsonObject(with: data, options: []) + if let dict = json as? [String: Any], let tags = dict["tags"] as? [[String: Any]] { + return tags.compactMap { $0["name"] as? String } + } else { + throw ErrorMessage(message: "Properties not found.") + } + } +} + +if let argPath = CommandLine.arguments[1] + .split(whereSeparator: \.isNewline) + .first { + let path = String(argPath) + let names = try PackageTargetsParser().parse(from: path) + print(names.joined(separator: "\n")) +} else { + throw ErrorMessage(message: "PackageTargetsParser.parse(from:) failure") +} + + diff --git a/Sources/actions/Client.swift b/Sources/actions/Client.swift index a4a792e8496..74bc1fc6aad 100644 --- a/Sources/actions/Client.swift +++ b/Sources/actions/Client.swift @@ -364,19 +364,21 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub-owned images for GitHub-hosted runners in an organization + /// List custom images for an organization /// - /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. + /// List custom images for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/github-owned`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)`. - public func actionsGetHostedRunnersGithubOwnedImagesForOrg(_ input: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output { + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/get(actions/list-custom-images-for-org)`. + public func actionsListCustomImagesForOrg(_ input: Operations.ActionsListCustomImagesForOrg.Input) async throws -> Operations.ActionsListCustomImagesForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.id, + forOperation: Operations.ActionsListCustomImagesForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/images/github-owned", + template: "/orgs/{}/actions/hosted-runners/images/custom", parameters: [ input.path.org ] @@ -396,7 +398,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body + let body: Operations.ActionsListCustomImagesForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -406,7 +408,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body.JsonPayload.self, + Operations.ActionsListCustomImagesForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -428,21 +430,24 @@ public struct Client: APIProtocol { } ) } - /// Get partner images for GitHub-hosted runners in an organization + /// Get a custom image definition for GitHub Actions Hosted Runners /// - /// Get the list of partner images available for GitHub-hosted runners for an organization. + /// Get a custom image definition for GitHub Actions Hosted Runners. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/partner`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/partner/get(actions/get-hosted-runners-partner-images-for-org)`. - public func actionsGetHostedRunnersPartnerImagesForOrg(_ input: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output { + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/get(actions/get-custom-image-for-org)`. + public func actionsGetCustomImageForOrg(_ input: Operations.ActionsGetCustomImageForOrg.Input) async throws -> Operations.ActionsGetCustomImageForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.id, + forOperation: Operations.ActionsGetCustomImageForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/images/partner", + template: "/orgs/{}/actions/hosted-runners/images/custom/{}", parameters: [ - input.path.org + input.path.org, + input.path.imageDefinitionId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -460,7 +465,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body + let body: Operations.ActionsGetCustomImageForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -470,7 +475,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsHostedRunnerCustomImage.self, from: responseBody, transforming: { value in .json(value) @@ -492,21 +497,67 @@ public struct Client: APIProtocol { } ) } - /// Get limits on GitHub-hosted runners for an organization + /// Delete a custom image from the organization /// - /// Get the GitHub-hosted runners limits for an organization. + /// Delete a custom image from the organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/limits`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)`. - public func actionsGetHostedRunnersLimitsForOrg(_ input: Operations.ActionsGetHostedRunnersLimitsForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersLimitsForOrg.Output { + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/delete(actions/delete-custom-image-from-org)`. + public func actionsDeleteCustomImageFromOrg(_ input: Operations.ActionsDeleteCustomImageFromOrg.Input) async throws -> Operations.ActionsDeleteCustomImageFromOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetHostedRunnersLimitsForOrg.id, + forOperation: Operations.ActionsDeleteCustomImageFromOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/limits", + template: "/orgs/{}/actions/hosted-runners/images/custom/{}", parameters: [ - input.path.org + input.path.org, + input.path.imageDefinitionId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List image versions of a custom image for an organization + /// + /// List image versions of a custom image for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/get(actions/list-custom-image-versions-for-org)`. + public func actionsListCustomImageVersionsForOrg(_ input: Operations.ActionsListCustomImageVersionsForOrg.Input) async throws -> Operations.ActionsListCustomImageVersionsForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListCustomImageVersionsForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners/images/custom/{}/versions", + parameters: [ + input.path.org, + input.path.imageDefinitionId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -524,7 +575,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body + let body: Operations.ActionsListCustomImageVersionsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -534,7 +585,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunnerLimits.self, + Operations.ActionsListCustomImageVersionsForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -556,21 +607,25 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub-hosted runners machine specs for an organization + /// Get an image version of a custom image for GitHub Actions Hosted Runners /// - /// Get the list of machine specs available for GitHub-hosted runners for an organization. + /// Get an image version of a custom image for GitHub Actions Hosted Runners. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/machine-sizes`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/machine-sizes/get(actions/get-hosted-runners-machine-specs-for-org)`. - public func actionsGetHostedRunnersMachineSpecsForOrg(_ input: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output { + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/get(actions/get-custom-image-version-for-org)`. + public func actionsGetCustomImageVersionForOrg(_ input: Operations.ActionsGetCustomImageVersionForOrg.Input) async throws -> Operations.ActionsGetCustomImageVersionForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.id, + forOperation: Operations.ActionsGetCustomImageVersionForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/machine-sizes", + template: "/orgs/{}/actions/hosted-runners/images/custom/{}/versions/{}", parameters: [ - input.path.org + input.path.org, + input.path.imageDefinitionId, + input.path.version ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -588,7 +643,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body + let body: Operations.ActionsGetCustomImageVersionForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -598,7 +653,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsHostedRunnerCustomImageVersion.self, from: responseBody, transforming: { value in .json(value) @@ -620,19 +675,63 @@ public struct Client: APIProtocol { } ) } - /// Get platforms for GitHub-hosted runners in an organization + /// Delete an image version of custom image from the organization /// - /// Get the list of platforms available for GitHub-hosted runners for an organization. + /// Delete an image version of custom image from the organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/platforms`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/platforms/get(actions/get-hosted-runners-platforms-for-org)`. - public func actionsGetHostedRunnersPlatformsForOrg(_ input: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersPlatformsForOrg.Output { + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/delete(actions/delete-custom-image-version-from-org)`. + public func actionsDeleteCustomImageVersionFromOrg(_ input: Operations.ActionsDeleteCustomImageVersionFromOrg.Input) async throws -> Operations.ActionsDeleteCustomImageVersionFromOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetHostedRunnersPlatformsForOrg.id, + forOperation: Operations.ActionsDeleteCustomImageVersionFromOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/platforms", + template: "/orgs/{}/actions/hosted-runners/images/custom/{}/versions/{}", + parameters: [ + input.path.org, + input.path.imageDefinitionId, + input.path.version + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get GitHub-owned images for GitHub-hosted runners in an organization + /// + /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/github-owned`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)`. + public func actionsGetHostedRunnersGithubOwnedImagesForOrg(_ input: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/hosted-runners/images/github-owned", parameters: [ input.path.org ] @@ -652,7 +751,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body + let body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -662,7 +761,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload.self, + Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -684,24 +783,21 @@ public struct Client: APIProtocol { } ) } - /// Get a GitHub-hosted runner for an organization - /// - /// Gets a GitHub-hosted runner configured in an organization. + /// Get partner images for GitHub-hosted runners in an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// Get the list of partner images available for GitHub-hosted runners for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-for-org)`. - public func actionsGetHostedRunnerForOrg(_ input: Operations.ActionsGetHostedRunnerForOrg.Input) async throws -> Operations.ActionsGetHostedRunnerForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/partner`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/partner/get(actions/get-hosted-runners-partner-images-for-org)`. + public func actionsGetHostedRunnersPartnerImagesForOrg(_ input: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetHostedRunnerForOrg.id, + forOperation: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/{}", + template: "/orgs/{}/actions/hosted-runners/images/partner", parameters: [ - input.path.org, - input.path.hostedRunnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -718,13 +814,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Body + let body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -734,7 +825,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunner.self, + Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -743,10 +834,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -759,50 +847,39 @@ public struct Client: APIProtocol { } ) } - /// Update a GitHub-hosted runner for an organization + /// Get limits on GitHub-hosted runners for an organization /// - /// Updates a GitHub-hosted runner for an organization. - /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// Get the GitHub-hosted runners limits for an organization. /// - /// - Remark: HTTP `PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)`. - public func actionsUpdateHostedRunnerForOrg(_ input: Operations.ActionsUpdateHostedRunnerForOrg.Input) async throws -> Operations.ActionsUpdateHostedRunnerForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/limits`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)`. + public func actionsGetHostedRunnersLimitsForOrg(_ input: Operations.ActionsGetHostedRunnersLimitsForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersLimitsForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsUpdateHostedRunnerForOrg.id, + forOperation: Operations.ActionsGetHostedRunnersLimitsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/{}", + template: "/orgs/{}/actions/hosted-runners/limits", parameters: [ - input.path.org, - input.path.hostedRunnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body + let body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -812,7 +889,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunner.self, + Components.Schemas.ActionsHostedRunnerLimits.self, from: responseBody, transforming: { value in .json(value) @@ -834,27 +911,26 @@ public struct Client: APIProtocol { } ) } - /// Delete a GitHub-hosted runner for an organization + /// Get GitHub-hosted runners machine specs for an organization /// - /// Deletes a GitHub-hosted runner for an organization. + /// Get the list of machine specs available for GitHub-hosted runners for an organization. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/delete(actions/delete-hosted-runner-for-org)`. - public func actionsDeleteHostedRunnerForOrg(_ input: Operations.ActionsDeleteHostedRunnerForOrg.Input) async throws -> Operations.ActionsDeleteHostedRunnerForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/machine-sizes`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/machine-sizes/get(actions/get-hosted-runners-machine-specs-for-org)`. + public func actionsGetHostedRunnersMachineSpecsForOrg(_ input: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsDeleteHostedRunnerForOrg.id, + forOperation: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/hosted-runners/{}", + template: "/orgs/{}/actions/hosted-runners/machine-sizes", parameters: [ - input.path.org, - input.path.hostedRunnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -865,9 +941,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 202: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted.Body + let body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -877,7 +953,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsHostedRunner.self, + Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -886,7 +962,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .accepted(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -899,21 +975,19 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub Actions permissions for an organization - /// - /// Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. + /// Get platforms for GitHub-hosted runners in an organization /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get the list of platforms available for GitHub-hosted runners for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/get(actions/get-github-actions-permissions-organization)`. - public func actionsGetGithubActionsPermissionsOrganization(_ input: Operations.ActionsGetGithubActionsPermissionsOrganization.Input) async throws -> Operations.ActionsGetGithubActionsPermissionsOrganization.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/platforms`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/platforms/get(actions/get-hosted-runners-platforms-for-org)`. + public func actionsGetHostedRunnersPlatformsForOrg(_ input: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input) async throws -> Operations.ActionsGetHostedRunnersPlatformsForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetGithubActionsPermissionsOrganization.id, + forOperation: Operations.ActionsGetHostedRunnersPlatformsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions", + template: "/orgs/{}/actions/hosted-runners/platforms", parameters: [ input.path.org ] @@ -933,7 +1007,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body + let body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -943,7 +1017,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsOrganizationPermissions.self, + Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -965,74 +1039,24 @@ public struct Client: APIProtocol { } ) } - /// Set GitHub Actions permissions for an organization + /// Get a GitHub-hosted runner for an organization /// - /// Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)`. - public func actionsSetGithubActionsPermissionsOrganization(_ input: Operations.ActionsSetGithubActionsPermissionsOrganization.Input) async throws -> Operations.ActionsSetGithubActionsPermissionsOrganization.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsSetGithubActionsPermissionsOrganization.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions", - parameters: [ - input.path.org - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .put - ) - suppressMutabilityWarning(&request) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List selected repositories enabled for GitHub Actions in an organization - /// - /// Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Gets a GitHub-hosted runner configured in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/get(actions/list-selected-repositories-enabled-github-actions-organization)`. - public func actionsListSelectedRepositoriesEnabledGithubActionsOrganization(_ input: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input) async throws -> Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-for-org)`. + public func actionsGetHostedRunnerForOrg(_ input: Operations.ActionsGetHostedRunnerForOrg.Input) async throws -> Operations.ActionsGetHostedRunnerForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.id, + forOperation: Operations.ActionsGetHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories", + template: "/orgs/{}/actions/hosted-runners/{}", parameters: [ - input.path.org + input.path.org, + input.path.hostedRunnerId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1040,20 +1064,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1063,8 +1073,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body + let body: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1074,7 +1089,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsHostedRunner.self, from: responseBody, transforming: { value in .json(value) @@ -1083,7 +1098,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) default: return .undocumented( statusCode: response.status.code, @@ -1096,31 +1114,34 @@ public struct Client: APIProtocol { } ) } - /// Set selected repositories enabled for GitHub Actions in an organization - /// - /// Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." - /// + /// Update a GitHub-hosted runner for an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Updates a GitHub-hosted runner for an organization. + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)`. - public func actionsSetSelectedRepositoriesEnabledGithubActionsOrganization(_ input: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input) async throws -> Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output { + /// - Remark: HTTP `PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)`. + public func actionsUpdateHostedRunnerForOrg(_ input: Operations.ActionsUpdateHostedRunnerForOrg.Input) async throws -> Operations.ActionsUpdateHostedRunnerForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.id, + forOperation: Operations.ActionsUpdateHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories", + template: "/orgs/{}/actions/hosted-runners/{}", parameters: [ - input.path.org + input.path.org, + input.path.hostedRunnerId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .patch ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) let body: OpenAPIRuntime.HTTPBody? switch input.body { case let .json(value): @@ -1134,51 +1155,28 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] ) - } - } - ) - } - /// Enable a selected repository for GitHub Actions in an organization - /// - /// Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." - /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)`. - public func actionsEnableSelectedRepositoryGithubActionsOrganization(_ input: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input) async throws -> Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories/{}", - parameters: [ - input.path.org, - input.path.repositoryId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .put - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ActionsHostedRunner.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1191,24 +1189,22 @@ public struct Client: APIProtocol { } ) } - /// Disable a selected repository for GitHub Actions in an organization - /// - /// Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Delete a GitHub-hosted runner for an organization /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Deletes a GitHub-hosted runner for an organization. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)`. - public func actionsDisableSelectedRepositoryGithubActionsOrganization(_ input: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input) async throws -> Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/delete(actions/delete-hosted-runner-for-org)`. + public func actionsDeleteHostedRunnerForOrg(_ input: Operations.ActionsDeleteHostedRunnerForOrg.Input) async throws -> Operations.ActionsDeleteHostedRunnerForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.id, + forOperation: Operations.ActionsDeleteHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/repositories/{}", + template: "/orgs/{}/actions/hosted-runners/{}", parameters: [ input.path.org, - input.path.repositoryId + input.path.hostedRunnerId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1216,12 +1212,36 @@ public struct Client: APIProtocol { method: .delete ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + case 202: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ActionsHostedRunner.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .accepted(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1234,21 +1254,21 @@ public struct Client: APIProtocol { } ) } - /// Get allowed actions and reusable workflows for an organization + /// Get GitHub Actions permissions for an organization /// - /// Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. /// /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/selected-actions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/get(actions/get-allowed-actions-organization)`. - public func actionsGetAllowedActionsOrganization(_ input: Operations.ActionsGetAllowedActionsOrganization.Input) async throws -> Operations.ActionsGetAllowedActionsOrganization.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/get(actions/get-github-actions-permissions-organization)`. + public func actionsGetGithubActionsPermissionsOrganization(_ input: Operations.ActionsGetGithubActionsPermissionsOrganization.Input) async throws -> Operations.ActionsGetGithubActionsPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetAllowedActionsOrganization.id, + forOperation: Operations.ActionsGetGithubActionsPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/selected-actions", + template: "/orgs/{}/actions/permissions", parameters: [ input.path.org ] @@ -1268,7 +1288,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetAllowedActionsOrganization.Output.Ok.Body + let body: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1278,7 +1298,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.SelectedActions.self, + Components.Schemas.ActionsOrganizationPermissions.self, from: responseBody, transforming: { value in .json(value) @@ -1300,21 +1320,21 @@ public struct Client: APIProtocol { } ) } - /// Set allowed actions and reusable workflows for an organization + /// Set GitHub Actions permissions for an organization /// - /// Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/selected-actions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)`. - public func actionsSetAllowedActionsOrganization(_ input: Operations.ActionsSetAllowedActionsOrganization.Input) async throws -> Operations.ActionsSetAllowedActionsOrganization.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)`. + public func actionsSetGithubActionsPermissionsOrganization(_ input: Operations.ActionsSetGithubActionsPermissionsOrganization.Input) async throws -> Operations.ActionsSetGithubActionsPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetAllowedActionsOrganization.id, + forOperation: Operations.ActionsSetGithubActionsPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/selected-actions", + template: "/orgs/{}/actions/permissions", parameters: [ input.path.org ] @@ -1326,10 +1346,8 @@ public struct Client: APIProtocol { suppressMutabilityWarning(&request) let body: OpenAPIRuntime.HTTPBody? switch input.body { - case .none: - body = nil case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( + body = try converter.setRequiredRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -1353,23 +1371,21 @@ public struct Client: APIProtocol { } ) } - /// Get default workflow permissions for an organization + /// Get artifact and log retention settings for an organization /// - /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, - /// as well as whether GitHub Actions can submit approving pull request reviews. For more information, see - /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." + /// Gets artifact and log retention settings for an organization. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/workflow`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-organization)`. - public func actionsGetGithubActionsDefaultWorkflowPermissionsOrganization(_ input: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input) async throws -> Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-organization)`. + public func actionsGetArtifactAndLogRetentionSettingsOrganization(_ input: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input) async throws -> Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.id, + forOperation: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/workflow", + template: "/orgs/{}/actions/permissions/artifact-and-log-retention", parameters: [ input.path.org ] @@ -1389,7 +1405,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok.Body + let body: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1399,7 +1415,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsGetDefaultWorkflowPermissions.self, + Components.Schemas.ActionsArtifactAndLogRetentionResponse.self, from: responseBody, transforming: { value in .json(value) @@ -1409,6 +1425,50 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1421,23 +1481,21 @@ public struct Client: APIProtocol { } ) } - /// Set default workflow permissions for an organization + /// Set artifact and log retention settings for an organization /// - /// Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actions - /// can submit approving pull request reviews. For more information, see - /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." + /// Sets artifact and log retention settings for an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/workflow`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)`. - public func actionsSetGithubActionsDefaultWorkflowPermissionsOrganization(_ input: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input) async throws -> Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)`. + public func actionsSetArtifactAndLogRetentionSettingsOrganization(_ input: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input) async throws -> Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.id, + forOperation: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/permissions/workflow", + template: "/orgs/{}/actions/permissions/artifact-and-log-retention", parameters: [ input.path.org ] @@ -1447,12 +1505,14 @@ public struct Client: APIProtocol { method: .put ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) let body: OpenAPIRuntime.HTTPBody? switch input.body { - case .none: - body = nil case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( + body = try converter.setRequiredRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -1464,6 +1524,94 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1476,21 +1624,21 @@ public struct Client: APIProtocol { } ) } - /// List self-hosted runner groups for an organization + /// Get fork PR contributor approval permissions for an organization /// - /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. + /// Gets the fork PR contributor approval policy for an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)`. - public func actionsListSelfHostedRunnerGroupsForOrg(_ input: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input) async throws -> Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-organization)`. + public func actionsGetForkPrContributorApprovalPermissionsOrganization(_ input: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input) async throws -> Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsListSelfHostedRunnerGroupsForOrg.id, + forOperation: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups", + template: "/orgs/{}/actions/permissions/fork-pr-contributor-approval", parameters: [ input.path.org ] @@ -1500,27 +1648,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "visible_to_repository", - value: input.query.visibleToRepository - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1531,7 +1658,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body + let body: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1541,7 +1668,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsForkPrContributorApproval.self, from: responseBody, transforming: { value in .json(value) @@ -1551,6 +1678,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1563,28 +1712,28 @@ public struct Client: APIProtocol { } ) } - /// Create a self-hosted runner group for an organization + /// Set fork PR contributor approval permissions for an organization /// - /// Creates a new self-hosted runner group for an organization. + /// Sets the fork PR contributor approval policy for an organization. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runner-groups`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)`. - public func actionsCreateSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)`. + public func actionsSetForkPrContributorApprovalPermissionsOrganization(_ input: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input) async throws -> Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.id, + forOperation: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups", + template: "/orgs/{}/actions/permissions/fork-pr-contributor-approval", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -1604,9 +1753,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 204: + return .noContent(.init()) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1616,7 +1767,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.RunnerGroupsOrg.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -1625,37 +1776,56 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } ) } - /// Get a self-hosted runner group for an organization + /// Get private repo fork PR workflow settings for an organization /// - /// Gets a specific self-hosted runner group for an organization. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Gets the settings for whether workflows from fork pull requests can run on private repositories in an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)`. - public func actionsGetSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-organization)`. + public func actionsGetPrivateRepoForkPrWorkflowsSettingsOrganization(_ input: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input) async throws -> Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetSelfHostedRunnerGroupForOrg.id, + forOperation: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}", + template: "/orgs/{}/actions/permissions/fork-pr-workflows-private-repos", parameters: [ - input.path.org, - input.path.runnerGroupId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1673,7 +1843,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok.Body + let body: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1683,7 +1853,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.RunnerGroupsOrg.self, + Components.Schemas.ActionsForkPrWorkflowsPrivateRepos.self, from: responseBody, transforming: { value in .json(value) @@ -1693,6 +1863,50 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1705,29 +1919,26 @@ public struct Client: APIProtocol { } ) } - /// Update a self-hosted runner group for an organization - /// - /// Updates the `name` and `visibility` of a self-hosted runner group in an organization. + /// Set private repo fork PR workflow settings for an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Sets the settings for whether workflows from fork pull requests can run on private repositories in an organization. /// - /// - Remark: HTTP `PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)`. - public func actionsUpdateSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)`. + public func actionsSetPrivateRepoForkPrWorkflowsSettingsOrganization(_ input: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input) async throws -> Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.id, + forOperation: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}", + template: "/orgs/{}/actions/permissions/fork-pr-workflows-private-repos", parameters: [ - input.path.org, - input.path.runnerGroupId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -1747,9 +1958,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 204: + return .noContent(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok.Body + let body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1759,7 +1972,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.RunnerGroupsOrg.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -1768,50 +1981,51 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] ) - } - } - ) - } - /// Delete a self-hosted runner group from an organization - /// - /// Deletes a self-hosted runner group for an organization. - /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)`. - public func actionsDeleteSelfHostedRunnerGroupFromOrg(_ input: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Input) async throws -> Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}", - parameters: [ - input.path.org, - input.path.runnerGroupId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1824,24 +2038,23 @@ public struct Client: APIProtocol { } ) } - /// List GitHub-hosted runners in a group for an organization + /// List selected repositories enabled for GitHub Actions in an organization /// - /// Lists the GitHub-hosted runners in an organization group. + /// Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/get(actions/list-github-hosted-runners-in-group-for-org)`. - public func actionsListGithubHostedRunnersInGroupForOrg(_ input: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input) async throws -> Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/get(actions/list-selected-repositories-enabled-github-actions-organization)`. + public func actionsListSelectedRepositoriesEnabledGithubActionsOrganization(_ input: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input) async throws -> Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsListGithubHostedRunnersInGroupForOrg.id, + forOperation: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/hosted-runners", + template: "/orgs/{}/actions/permissions/repositories", parameters: [ - input.path.org, - input.path.runnerGroupId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1872,13 +2085,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body + let body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1888,7 +2096,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload.self, + Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1897,10 +2105,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1913,110 +2118,29 @@ public struct Client: APIProtocol { } ) } - /// List repository access to a self-hosted runner group in an organization + /// Set selected repositories enabled for GitHub Actions in an organization + /// + /// Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// Lists the repositories with access to a self-hosted runner group configured in an organization. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)`. - public func actionsListRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)`. + public func actionsSetSelectedRepositoriesEnabledGithubActionsOrganization(_ input: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input) async throws -> Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.id, + forOperation: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/repositories", + template: "/orgs/{}/actions/permissions/repositories", parameters: [ - input.path.org, - input.path.runnerGroupId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Set repository access for a self-hosted runner group in an organization - /// - /// Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)`. - public func actionsSetRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/repositories", - parameters: [ - input.path.org, - input.path.runnerGroupId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .put + method: .put ) suppressMutabilityWarning(&request) let body: OpenAPIRuntime.HTTPBody? @@ -2046,24 +2170,23 @@ public struct Client: APIProtocol { } ) } - /// Add repository access to a self-hosted runner group in an organization + /// Enable a selected repository for GitHub Actions in an organization /// - /// Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)`. - public func actionsAddRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)`. + public func actionsEnableSelectedRepositoryGithubActionsOrganization(_ input: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input) async throws -> Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.id, + forOperation: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/repositories/{}", + template: "/orgs/{}/actions/permissions/repositories/{}", parameters: [ input.path.org, - input.path.runnerGroupId, input.path.repositoryId ] ) @@ -2090,24 +2213,23 @@ public struct Client: APIProtocol { } ) } - /// Remove repository access to a self-hosted runner group in an organization + /// Disable a selected repository for GitHub Actions in an organization /// - /// Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)`. - public func actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)`. + public func actionsDisableSelectedRepositoryGithubActionsOrganization(_ input: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input) async throws -> Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.id, + forOperation: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/repositories/{}", + template: "/orgs/{}/actions/permissions/repositories/{}", parameters: [ input.path.org, - input.path.runnerGroupId, input.path.repositoryId ] ) @@ -2134,24 +2256,23 @@ public struct Client: APIProtocol { } ) } - /// List self-hosted runners in a group for an organization + /// Get allowed actions and reusable workflows for an organization /// - /// Lists self-hosted runners that are in a specific organization group. + /// Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)`. - public func actionsListSelfHostedRunnersInGroupForOrg(_ input: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input) async throws -> Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/selected-actions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/get(actions/get-allowed-actions-organization)`. + public func actionsGetAllowedActionsOrganization(_ input: Operations.ActionsGetAllowedActionsOrganization.Input) async throws -> Operations.ActionsGetAllowedActionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsListSelfHostedRunnersInGroupForOrg.id, + forOperation: Operations.ActionsGetAllowedActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/runners", + template: "/orgs/{}/actions/permissions/selected-actions", parameters: [ - input.path.org, - input.path.runnerGroupId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -2159,20 +2280,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -2182,13 +2289,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body + let body: Operations.ActionsGetAllowedActionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2198,7 +2300,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload.self, + Components.Schemas.SelectedActions.self, from: responseBody, transforming: { value in .json(value) @@ -2207,10 +2309,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2223,24 +2322,23 @@ public struct Client: APIProtocol { } ) } - /// Set self-hosted runners in a group for an organization + /// Set allowed actions and reusable workflows for an organization /// - /// Replaces the list of self-hosted runners that are part of an organization runner group. + /// Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)`. - public func actionsSetSelfHostedRunnersInGroupForOrg(_ input: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input) async throws -> Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/selected-actions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)`. + public func actionsSetAllowedActionsOrganization(_ input: Operations.ActionsSetAllowedActionsOrganization.Input) async throws -> Operations.ActionsSetAllowedActionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.id, + forOperation: Operations.ActionsSetAllowedActionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/runners", + template: "/orgs/{}/actions/permissions/selected-actions", parameters: [ - input.path.org, - input.path.runnerGroupId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -2250,8 +2348,10 @@ public struct Client: APIProtocol { suppressMutabilityWarning(&request) let body: OpenAPIRuntime.HTTPBody? switch input.body { + case .none: + body = nil case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( + body = try converter.setOptionalRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -2275,38 +2375,104 @@ public struct Client: APIProtocol { } ) } - /// Add a self-hosted runner to a group for an organization + /// Get self-hosted runners settings for an organization /// - /// Adds a self-hosted runner to a runner group configured in an organization. + /// Gets the settings for self-hosted runners for an organization. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)`. - public func actionsAddSelfHostedRunnerToGroupForOrg(_ input: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Input) async throws -> Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)`. + public func actionsGetSelfHostedRunnersPermissionsOrganization(_ input: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input) async throws -> Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.id, + forOperation: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/runners/{}", + template: "/orgs/{}/actions/permissions/self-hosted-runners", parameters: [ - input.path.org, - input.path.runnerGroupId, - input.path.runnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .get ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.SelfHostedRunnersSettings.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2319,38 +2485,137 @@ public struct Client: APIProtocol { } ) } - /// Remove a self-hosted runner from a group for an organization + /// Set self-hosted runners settings for an organization /// - /// Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. + /// Sets the settings for self-hosted runners for an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)`. - public func actionsRemoveSelfHostedRunnerFromGroupForOrg(_ input: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Input) async throws -> Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)`. + public func actionsSetSelfHostedRunnersPermissionsOrganization(_ input: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input) async throws -> Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.id, + forOperation: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runner-groups/{}/runners/{}", + template: "/orgs/{}/actions/permissions/self-hosted-runners", parameters: [ - input.path.org, - input.path.runnerGroupId, - input.path.runnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .put ) suppressMutabilityWarning(&request) - return (request, nil) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 204: return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2363,23 +2628,21 @@ public struct Client: APIProtocol { } ) } - /// List self-hosted runners for an organization - /// - /// Lists all self-hosted runners configured in an organization. + /// List repositories allowed to use self-hosted runners in an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Lists repositories that are allowed to use self-hosted runners in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/get(actions/list-self-hosted-runners-for-org)`. - public func actionsListSelfHostedRunnersForOrg(_ input: Operations.ActionsListSelfHostedRunnersForOrg.Input) async throws -> Operations.ActionsListSelfHostedRunnersForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)`. + public func actionsListSelectedRepositoriesSelfHostedRunnersOrganization(_ input: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsListSelfHostedRunnersForOrg.id, + forOperation: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners", + template: "/orgs/{}/actions/permissions/self-hosted-runners/repositories", parameters: [ input.path.org ] @@ -2389,13 +2652,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "name", - value: input.query.name - ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -2419,13 +2675,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body + let body: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2435,7 +2686,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body.JsonPayload.self, + Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -2444,59 +2695,32 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + return .ok(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] ) - } - } - ) - } - /// List runner applications for an organization - /// - /// Lists binaries for the runner application that you can download and run. - /// - /// Authenticated users must have admin access to the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners/downloads`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/downloads/get(actions/list-runner-applications-for-org)`. - public func actionsListRunnerApplicationsForOrg(_ input: Operations.ActionsListRunnerApplicationsForOrg.Input) async throws -> Operations.ActionsListRunnerApplicationsForOrg.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsListRunnerApplicationsForOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/downloads", - parameters: [ - input.path.org - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListRunnerApplicationsForOrg.Output.Ok.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2506,7 +2730,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.RunnerApplication].self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -2515,7 +2739,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2528,30 +2752,28 @@ public struct Client: APIProtocol { } ) } - /// Create configuration for a just-in-time runner for an organization + /// Set repositories allowed to use self-hosted runners in an organization /// - /// Generates a configuration that can be passed to the runner application at startup. - /// - /// The authenticated user must have admin access to the organization. + /// Sets repositories that are allowed to use self-hosted runners in an organization. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/generate-jitconfig`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)`. - public func actionsGenerateRunnerJitconfigForOrg(_ input: Operations.ActionsGenerateRunnerJitconfigForOrg.Input) async throws -> Operations.ActionsGenerateRunnerJitconfigForOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)`. + public func actionsSetSelectedRepositoriesSelfHostedRunnersOrganization(_ input: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGenerateRunnerJitconfigForOrg.id, + forOperation: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/generate-jitconfig", + template: "/orgs/{}/actions/permissions/self-hosted-runners/repositories", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -2571,9 +2793,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 204: + return .noContent(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ActionsRunnerJitconfig.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2583,7 +2807,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Responses.ActionsRunnerJitconfig.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -2592,7 +2816,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .forbidden(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -2617,7 +2841,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2627,7 +2851,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, + Components.Schemas.ValidationError.self, from: responseBody, transforming: { value in .json(value) @@ -2637,70 +2861,41 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .unprocessableContent(.init(body: body)) - case 409: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Conflict.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .conflict(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) ) } } ) } - /// Create a registration token for an organization - /// - /// Returns a token that you can pass to the `config` script. The token expires after one hour. - /// - /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner: + /// Add a repository to the list of repositories allowed to use self-hosted runners in an organization /// - /// ``` - /// ./config.sh --url https://github.com/octo-org --token TOKEN - /// ``` - /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Adds a repository to the list of repositories that are allowed to use self-hosted runners in an organization. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/registration-token`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/registration-token/post(actions/create-registration-token-for-org)`. - public func actionsCreateRegistrationTokenForOrg(_ input: Operations.ActionsCreateRegistrationTokenForOrg.Input) async throws -> Operations.ActionsCreateRegistrationTokenForOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)`. + public func actionsEnableSelectedRepositorySelfHostedRunnersOrganization(_ input: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsCreateRegistrationTokenForOrg.id, + forOperation: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/registration-token", + template: "/orgs/{}/actions/permissions/self-hosted-runners/repositories/{}", parameters: [ - input.path.org + input.path.org, + input.path.repositoryId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -2711,9 +2906,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 204: + return .noContent(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsCreateRegistrationTokenForOrg.Output.Created.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2723,7 +2920,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.AuthenticationToken.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -2732,7 +2929,73 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2745,36 +3008,29 @@ public struct Client: APIProtocol { } ) } - /// Create a remove token for an organization - /// - /// Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. - /// - /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization: - /// - /// ``` - /// ./config.sh remove --token TOKEN - /// ``` + /// Remove a repository from the list of repositories allowed to use self-hosted runners in an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Removes a repository from the list of repositories that are allowed to use self-hosted runners in an organization. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/remove-token`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/remove-token/post(actions/create-remove-token-for-org)`. - public func actionsCreateRemoveTokenForOrg(_ input: Operations.ActionsCreateRemoveTokenForOrg.Input) async throws -> Operations.ActionsCreateRemoveTokenForOrg.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)`. + public func actionsDisableSelectedRepositorySelfHostedRunnersOrganization(_ input: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsCreateRemoveTokenForOrg.id, + forOperation: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/remove-token", + template: "/orgs/{}/actions/permissions/self-hosted-runners/repositories/{}", parameters: [ - input.path.org + input.path.org, + input.path.repositoryId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -2785,9 +3041,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 204: + return .noContent(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsCreateRemoveTokenForOrg.Output.Created.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2797,7 +3055,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.AuthenticationToken.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -2806,7 +3064,73 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2819,26 +3143,25 @@ public struct Client: APIProtocol { } ) } - /// Get a self-hosted runner for an organization - /// - /// Gets a specific self-hosted runner configured in an organization. + /// Get default workflow permissions for an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, + /// as well as whether GitHub Actions can submit approving pull request reviews. For more information, see + /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/get(actions/get-self-hosted-runner-for-org)`. - public func actionsGetSelfHostedRunnerForOrg(_ input: Operations.ActionsGetSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsGetSelfHostedRunnerForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/workflow`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-organization)`. + public func actionsGetGithubActionsDefaultWorkflowPermissionsOrganization(_ input: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input) async throws -> Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetSelfHostedRunnerForOrg.id, + forOperation: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/{}", + template: "/orgs/{}/actions/permissions/workflow", parameters: [ - input.path.org, - input.path.runnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -2856,7 +3179,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok.Body + let body: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2866,7 +3189,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Runner.self, + Components.Schemas.ActionsGetDefaultWorkflowPermissions.self, from: responseBody, transforming: { value in .json(value) @@ -2888,34 +3211,44 @@ public struct Client: APIProtocol { } ) } - /// Delete a self-hosted runner from an organization - /// - /// Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. + /// Set default workflow permissions for an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actions + /// can submit approving pull request reviews. For more information, see + /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)`. - public func actionsDeleteSelfHostedRunnerFromOrg(_ input: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input) async throws -> Operations.ActionsDeleteSelfHostedRunnerFromOrg.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/workflow`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)`. + public func actionsSetGithubActionsDefaultWorkflowPermissionsOrganization(_ input: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input) async throws -> Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Output { try await client.send( input: input, - forOperation: Operations.ActionsDeleteSelfHostedRunnerFromOrg.id, + forOperation: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/{}", + template: "/orgs/{}/actions/permissions/workflow", parameters: [ - input.path.org, - input.path.runnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .put ) suppressMutabilityWarning(&request) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case .none: + body = nil + case let .json(value): + body = try converter.setOptionalRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { @@ -2933,26 +3266,23 @@ public struct Client: APIProtocol { } ) } - /// List labels for a self-hosted runner for an organization - /// - /// Lists all labels for a self-hosted runner configured in an organization. + /// List self-hosted runner groups for an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)`. - public func actionsListLabelsForSelfHostedRunnerForOrg(_ input: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)`. + public func actionsListSelfHostedRunnerGroupsForOrg(_ input: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input) async throws -> Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.id, + forOperation: Operations.ActionsListSelfHostedRunnerGroupsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/{}/labels", + template: "/orgs/{}/actions/runner-groups", parameters: [ - input.path.org, - input.path.runnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -2960,6 +3290,27 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "visible_to_repository", + value: input.query.visibleToRepository + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -2970,7 +3321,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ActionsRunnerLabels.Body + let body: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2980,7 +3331,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Responses.ActionsRunnerLabels.Body.JsonPayload.self, + Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -2990,28 +3341,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3024,26 +3353,23 @@ public struct Client: APIProtocol { } ) } - /// Add custom labels to a self-hosted runner for an organization - /// - /// Adds custom labels to a self-hosted runner configured in an organization. + /// Create a self-hosted runner group for an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Creates a new self-hosted runner group for an organization. /// /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)`. - public func actionsAddCustomLabelsToSelfHostedRunnerForOrg(_ input: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Output { + /// - Remark: HTTP `POST /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)`. + public func actionsCreateSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.id, + forOperation: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/{}/labels", + template: "/orgs/{}/actions/runner-groups", parameters: [ - input.path.org, - input.path.runnerId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3068,9 +3394,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ActionsRunnerLabels.Body + let body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3080,7 +3406,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Responses.ActionsRunnerLabels.Body.JsonPayload.self, + Components.Schemas.RunnerGroupsOrg.self, from: responseBody, transforming: { value in .json(value) @@ -3089,32 +3415,55 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } + return .created(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 422: + ) + } + } + ) + } + /// Get a self-hosted runner group for an organization + /// + /// Gets a specific self-hosted runner group for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)`. + public func actionsGetSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetSelfHostedRunnerGroupForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/runner-groups/{}", + parameters: [ + input.path.org, + input.path.runnerGroupId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body + let body: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3124,7 +3473,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, + Components.Schemas.RunnerGroupsOrg.self, from: responseBody, transforming: { value in .json(value) @@ -3133,7 +3482,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3146,32 +3495,29 @@ public struct Client: APIProtocol { } ) } - /// Set custom labels for a self-hosted runner for an organization - /// - /// Remove all previous custom labels and set the new custom labels for a specific - /// self-hosted runner configured in an organization. + /// Update a self-hosted runner group for an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Updates the `name` and `visibility` of a self-hosted runner group in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)`. - public func actionsSetCustomLabelsForSelfHostedRunnerForOrg(_ input: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Output { + /// - Remark: HTTP `PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)`. + public func actionsUpdateSelfHostedRunnerGroupForOrg(_ input: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input) async throws -> Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.id, + forOperation: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/{}/labels", + template: "/orgs/{}/actions/runner-groups/{}", parameters: [ input.path.org, - input.path.runnerId + input.path.runnerGroupId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .patch ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -3193,7 +3539,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ActionsRunnerLabels.Body + let body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3203,7 +3549,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Responses.ActionsRunnerLabels.Body.JsonPayload.self, + Components.Schemas.RunnerGroupsOrg.self, from: responseBody, transforming: { value in .json(value) @@ -3213,83 +3559,36 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody ) ) } } ) } - /// Remove all custom labels from a self-hosted runner for an organization - /// - /// Remove all custom labels from a self-hosted runner configured in an - /// organization. Returns the remaining read-only labels from the runner. + /// Delete a self-hosted runner group from an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Deletes a self-hosted runner group for an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)`. - public func actionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg(_ input: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)`. + public func actionsDeleteSelfHostedRunnerGroupFromOrg(_ input: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Input) async throws -> Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.id, + forOperation: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/{}/labels", + template: "/orgs/{}/actions/runner-groups/{}", parameters: [ input.path.org, - input.path.runnerId + input.path.runnerGroupId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3297,58 +3596,12 @@ public struct Client: APIProtocol { method: .delete ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ActionsRunnerLabelsReadonly.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Responses.ActionsRunnerLabelsReadonly.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) + case 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -3361,38 +3614,45 @@ public struct Client: APIProtocol { } ) } - /// Remove a custom label from a self-hosted runner for an organization - /// - /// Remove a custom label from a self-hosted runner configured - /// in an organization. Returns the remaining labels from the runner. - /// - /// This endpoint returns a `404 Not Found` status if the custom label is not - /// present on the runner. + /// List GitHub-hosted runners in a group for an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Lists the GitHub-hosted runners in an organization group. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)`. - public func actionsRemoveCustomLabelFromSelfHostedRunnerForOrg(_ input: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/get(actions/list-github-hosted-runners-in-group-for-org)`. + public func actionsListGithubHostedRunnersInGroupForOrg(_ input: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input) async throws -> Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.id, + forOperation: Operations.ActionsListGithubHostedRunnersInGroupForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/runners/{}/labels/{}", + template: "/orgs/{}/actions/runner-groups/{}/hosted-runners", parameters: [ input.path.org, - input.path.runnerId, - input.path.name + input.path.runnerGroupId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -3402,52 +3662,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ActionsRunnerLabels.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Responses.ActionsRunnerLabels.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body + let body: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3457,7 +3678,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, + Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -3466,7 +3687,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) default: return .undocumented( statusCode: response.status.code, @@ -3479,26 +3703,24 @@ public struct Client: APIProtocol { } ) } - /// List organization secrets - /// - /// Lists all secrets available in an organization without revealing their - /// encrypted values. + /// List repository access to a self-hosted runner group in an organization /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Lists the repositories with access to a self-hosted runner group configured in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/get(actions/list-org-secrets)`. - public func actionsListOrgSecrets(_ input: Operations.ActionsListOrgSecrets.Input) async throws -> Operations.ActionsListOrgSecrets.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)`. + public func actionsListRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsListOrgSecrets.id, + forOperation: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets", + template: "/orgs/{}/actions/runner-groups/{}/repositories", parameters: [ - input.path.org + input.path.org, + input.path.runnerGroupId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3510,15 +3732,15 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "per_page", - value: input.query.perPage + name: "page", + value: input.query.page ) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "page", - value: input.query.page + name: "per_page", + value: input.query.perPage ) converter.setAcceptHeader( in: &request.headerFields, @@ -3529,13 +3751,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsListOrgSecrets.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListOrgSecrets.Output.Ok.Body + let body: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3545,7 +3762,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListOrgSecrets.Output.Ok.Body.JsonPayload.self, + Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -3554,10 +3771,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3570,132 +3784,46 @@ public struct Client: APIProtocol { } ) } - /// Get an organization public key - /// - /// Gets your public key, which you need to encrypt secrets. You need to - /// encrypt a secret before you can create or update secrets. + /// Set repository access for a self-hosted runner group in an organization /// - /// The authenticated user must have collaborator access to a repository to create, update, or read secrets. + /// Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/public-key`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/public-key/get(actions/get-org-public-key)`. - public func actionsGetOrgPublicKey(_ input: Operations.ActionsGetOrgPublicKey.Input) async throws -> Operations.ActionsGetOrgPublicKey.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)`. + public func actionsSetRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetOrgPublicKey.id, + forOperation: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/public-key", + template: "/orgs/{}/actions/runner-groups/{}/repositories", parameters: [ - input.path.org + input.path.org, + input.path.runnerGroupId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetOrgPublicKey.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsPublicKey.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" ) } - } - ) - } - /// Get an organization secret - /// - /// Gets a single organization secret without revealing its encrypted value. - /// - /// The authenticated user must have collaborator access to a repository to create, update, or read secrets - /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/get(actions/get-org-secret)`. - public func actionsGetOrgSecret(_ input: Operations.ActionsGetOrgSecret.Input) async throws -> Operations.ActionsGetOrgSecret.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsGetOrgSecret.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/{}", - parameters: [ - input.path.org, - input.path.secretName - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetOrgSecret.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.OrganizationActionsSecret.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) + case 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -3708,27 +3836,25 @@ public struct Client: APIProtocol { } ) } - /// Create or update an organization secret - /// - /// Creates or updates an organization secret with an encrypted value. Encrypt your secret using - /// [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// Add repository access to a self-hosted runner group in an organization /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)`. - public func actionsCreateOrUpdateOrgSecret(_ input: Operations.ActionsCreateOrUpdateOrgSecret.Input) async throws -> Operations.ActionsCreateOrUpdateOrgSecret.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)`. + public func actionsAddRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsCreateOrUpdateOrgSecret.id, + forOperation: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/{}", + template: "/orgs/{}/actions/runner-groups/{}/repositories/{}", parameters: [ input.path.org, - input.path.secretName + input.path.runnerGroupId, + input.path.repositoryId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3736,45 +3862,10 @@ public struct Client: APIProtocol { method: .put ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsCreateOrUpdateOrgSecret.Output.Created.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.EmptyObject.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) case 204: return .noContent(.init()) default: @@ -3789,26 +3880,25 @@ public struct Client: APIProtocol { } ) } - /// Delete an organization secret - /// - /// Deletes a secret in an organization using the secret name. + /// Remove repository access to a self-hosted runner group in an organization /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)`. - public func actionsDeleteOrgSecret(_ input: Operations.ActionsDeleteOrgSecret.Input) async throws -> Operations.ActionsDeleteOrgSecret.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)`. + public func actionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg(_ input: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Input) async throws -> Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsDeleteOrgSecret.id, + forOperation: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/{}", + template: "/orgs/{}/actions/runner-groups/{}/repositories/{}", parameters: [ input.path.org, - input.path.secretName + input.path.runnerGroupId, + input.path.repositoryId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3834,27 +3924,24 @@ public struct Client: APIProtocol { } ) } - /// List selected repositories for an organization secret - /// - /// Lists all repositories that have been selected when the `visibility` - /// for repository access to a secret is set to `selected`. + /// List self-hosted runners in a group for an organization /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Lists self-hosted runners that are in a specific organization group. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/get(actions/list-selected-repos-for-org-secret)`. - public func actionsListSelectedReposForOrgSecret(_ input: Operations.ActionsListSelectedReposForOrgSecret.Input) async throws -> Operations.ActionsListSelectedReposForOrgSecret.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)`. + public func actionsListSelfHostedRunnersInGroupForOrg(_ input: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input) async throws -> Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsListSelectedReposForOrgSecret.id, + forOperation: Operations.ActionsListSelfHostedRunnersInGroupForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/{}/repositories", + template: "/orgs/{}/actions/runner-groups/{}/runners", parameters: [ input.path.org, - input.path.secretName + input.path.runnerGroupId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3866,15 +3953,15 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "page", - value: input.query.page + name: "per_page", + value: input.query.perPage ) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "per_page", - value: input.query.perPage + name: "page", + value: input.query.page ) converter.setAcceptHeader( in: &request.headerFields, @@ -3885,8 +3972,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body + let body: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3896,7 +3988,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body.JsonPayload.self, + Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -3905,7 +3997,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) default: return .undocumented( statusCode: response.status.code, @@ -3918,28 +4013,24 @@ public struct Client: APIProtocol { } ) } - /// Set selected repositories for an organization secret - /// - /// Replaces all repositories for an organization secret when the `visibility` - /// for repository access is set to `selected`. The visibility is set when you [Create - /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// Set self-hosted runners in a group for an organization /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Replaces the list of self-hosted runners that are part of an organization runner group. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)`. - public func actionsSetSelectedReposForOrgSecret(_ input: Operations.ActionsSetSelectedReposForOrgSecret.Input) async throws -> Operations.ActionsSetSelectedReposForOrgSecret.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)`. + public func actionsSetSelfHostedRunnersInGroupForOrg(_ input: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input) async throws -> Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetSelectedReposForOrgSecret.id, + forOperation: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/{}/repositories", + template: "/orgs/{}/actions/runner-groups/{}/runners", parameters: [ input.path.org, - input.path.secretName + input.path.runnerGroupId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3974,29 +4065,25 @@ public struct Client: APIProtocol { } ) } - /// Add selected repository to an organization secret - /// - /// Adds a repository to an organization secret when the `visibility` for - /// repository access is set to `selected`. For more information about setting the visibility, see [Create or - /// update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// Add a self-hosted runner to a group for an organization /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Adds a self-hosted runner to a runner group configured in an organization. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)`. - public func actionsAddSelectedRepoToOrgSecret(_ input: Operations.ActionsAddSelectedRepoToOrgSecret.Input) async throws -> Operations.ActionsAddSelectedRepoToOrgSecret.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)`. + public func actionsAddSelfHostedRunnerToGroupForOrg(_ input: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Input) async throws -> Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsAddSelectedRepoToOrgSecret.id, + forOperation: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/{}/repositories/{}", + template: "/orgs/{}/actions/runner-groups/{}/runners/{}", parameters: [ input.path.org, - input.path.secretName, - input.path.repositoryId + input.path.runnerGroupId, + input.path.runnerId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4010,8 +4097,6 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) - case 409: - return .conflict(.init()) default: return .undocumented( statusCode: response.status.code, @@ -4024,29 +4109,25 @@ public struct Client: APIProtocol { } ) } - /// Remove selected repository from an organization secret - /// - /// Removes a repository from an organization secret when the `visibility` - /// for repository access is set to `selected`. The visibility is set when you [Create - /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// Remove a self-hosted runner from a group for an organization /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)`. - public func actionsRemoveSelectedRepoFromOrgSecret(_ input: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Input) async throws -> Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)`. + public func actionsRemoveSelfHostedRunnerFromGroupForOrg(_ input: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Input) async throws -> Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsRemoveSelectedRepoFromOrgSecret.id, + forOperation: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/secrets/{}/repositories/{}", + template: "/orgs/{}/actions/runner-groups/{}/runners/{}", parameters: [ input.path.org, - input.path.secretName, - input.path.repositoryId + input.path.runnerGroupId, + input.path.runnerId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4060,8 +4141,6 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) - case 409: - return .conflict(.init()) default: return .undocumented( statusCode: response.status.code, @@ -4074,23 +4153,23 @@ public struct Client: APIProtocol { } ) } - /// List organization variables + /// List self-hosted runners for an organization /// - /// Lists all organization variables. + /// Lists all self-hosted runners configured in an organization. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Authenticated users must have admin access to the organization to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/variables`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/get(actions/list-org-variables)`. - public func actionsListOrgVariables(_ input: Operations.ActionsListOrgVariables.Input) async throws -> Operations.ActionsListOrgVariables.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/get(actions/list-self-hosted-runners-for-org)`. + public func actionsListSelfHostedRunnersForOrg(_ input: Operations.ActionsListSelfHostedRunnersForOrg.Input) async throws -> Operations.ActionsListSelfHostedRunnersForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsListOrgVariables.id, + forOperation: Operations.ActionsListSelfHostedRunnersForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables", + template: "/orgs/{}/actions/runners", parameters: [ input.path.org ] @@ -4100,6 +4179,13 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "name", + value: input.query.name + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -4123,13 +4209,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsListOrgVariables.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, name: "Link", as: Components.Headers.Link.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListOrgVariables.Output.Ok.Body + let body: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4139,7 +4225,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListOrgVariables.Output.Ok.Body.JsonPayload.self, + Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -4164,52 +4250,43 @@ public struct Client: APIProtocol { } ) } - /// Create an organization variable + /// List runner applications for an organization /// - /// Creates an organization variable that you can reference in a GitHub Actions workflow. + /// Lists binaries for the runner application that you can download and run. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Authenticated users must have admin access to the organization to use this endpoint. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/variables`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/post(actions/create-org-variable)`. - public func actionsCreateOrgVariable(_ input: Operations.ActionsCreateOrgVariable.Input) async throws -> Operations.ActionsCreateOrgVariable.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/runners/downloads`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/downloads/get(actions/list-runner-applications-for-org)`. + public func actionsListRunnerApplicationsForOrg(_ input: Operations.ActionsListRunnerApplicationsForOrg.Input) async throws -> Operations.ActionsListRunnerApplicationsForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsCreateOrgVariable.id, + forOperation: Operations.ActionsListRunnerApplicationsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables", + template: "/orgs/{}/actions/runners/downloads", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsCreateOrgVariable.Output.Created.Body + let body: Operations.ActionsListRunnerApplicationsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4219,7 +4296,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.EmptyObject.self, + [Components.Schemas.RunnerApplication].self, from: responseBody, transforming: { value in .json(value) @@ -4228,7 +4305,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4241,44 +4318,52 @@ public struct Client: APIProtocol { } ) } - /// Get an organization variable + /// Create configuration for a just-in-time runner for an organization /// - /// Gets a specific variable in an organization. + /// Generates a configuration that can be passed to the runner application at startup. /// - /// The authenticated user must have collaborator access to a repository to create, update, or read variables. + /// The authenticated user must have admin access to the organization. /// /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/get(actions/get-org-variable)`. - public func actionsGetOrgVariable(_ input: Operations.ActionsGetOrgVariable.Input) async throws -> Operations.ActionsGetOrgVariable.Output { + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/generate-jitconfig`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)`. + public func actionsGenerateRunnerJitconfigForOrg(_ input: Operations.ActionsGenerateRunnerJitconfigForOrg.Input) async throws -> Operations.ActionsGenerateRunnerJitconfigForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetOrgVariable.id, + forOperation: Operations.ActionsGenerateRunnerJitconfigForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}", + template: "/orgs/{}/actions/runners/generate-jitconfig", parameters: [ - input.path.org, - input.path.name + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetOrgVariable.Output.Ok.Body + let body: Components.Responses.ActionsRunnerJitconfig.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4288,7 +4373,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.OrganizationActionsVariable.self, + Components.Responses.ActionsRunnerJitconfig.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -4297,7 +4382,73 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .created(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4310,48 +4461,68 @@ public struct Client: APIProtocol { } ) } - /// Update an organization variable + /// Create a registration token for an organization /// - /// Updates an organization variable that you can reference in a GitHub Actions workflow. + /// Returns a token that you can pass to the `config` script. The token expires after one hour. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner: /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// ``` + /// ./config.sh --url https://github.com/octo-org --token TOKEN + /// ``` /// - /// - Remark: HTTP `PATCH /orgs/{org}/actions/variables/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)`. - public func actionsUpdateOrgVariable(_ input: Operations.ActionsUpdateOrgVariable.Input) async throws -> Operations.ActionsUpdateOrgVariable.Output { + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/registration-token`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/registration-token/post(actions/create-registration-token-for-org)`. + public func actionsCreateRegistrationTokenForOrg(_ input: Operations.ActionsCreateRegistrationTokenForOrg.Input) async throws -> Operations.ActionsCreateRegistrationTokenForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsUpdateOrgVariable.id, + forOperation: Operations.ActionsCreateRegistrationTokenForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}", + template: "/orgs/{}/actions/runners/registration-token", parameters: [ - input.path.org, - input.path.name + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .post ) suppressMutabilityWarning(&request) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsCreateRegistrationTokenForOrg.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.AuthenticationToken.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4364,39 +4535,68 @@ public struct Client: APIProtocol { } ) } - /// Delete an organization variable + /// Create a remove token for an organization /// - /// Deletes an organization variable using the variable name. + /// Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization: + /// + /// ``` + /// ./config.sh remove --token TOKEN + /// ``` + /// + /// Authenticated users must have admin access to the organization to use this endpoint. /// /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)`. - public func actionsDeleteOrgVariable(_ input: Operations.ActionsDeleteOrgVariable.Input) async throws -> Operations.ActionsDeleteOrgVariable.Output { + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/remove-token`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/remove-token/post(actions/create-remove-token-for-org)`. + public func actionsCreateRemoveTokenForOrg(_ input: Operations.ActionsCreateRemoveTokenForOrg.Input) async throws -> Operations.ActionsCreateRemoveTokenForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsDeleteOrgVariable.id, + forOperation: Operations.ActionsCreateRemoveTokenForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}", + template: "/orgs/{}/actions/runners/remove-token", parameters: [ - input.path.org, - input.path.name + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .post ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsCreateRemoveTokenForOrg.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.AuthenticationToken.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4409,27 +4609,26 @@ public struct Client: APIProtocol { } ) } - /// List selected repositories for an organization variable + /// Get a self-hosted runner for an organization /// - /// Lists all repositories that can access an organization variable - /// that is available to selected repositories. + /// Gets a specific self-hosted runner configured in an organization. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Authenticated users must have admin access to the organization to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)`. - public func actionsListSelectedReposForOrgVariable(_ input: Operations.ActionsListSelectedReposForOrgVariable.Input) async throws -> Operations.ActionsListSelectedReposForOrgVariable.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/get(actions/get-self-hosted-runner-for-org)`. + public func actionsGetSelfHostedRunnerForOrg(_ input: Operations.ActionsGetSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsGetSelfHostedRunnerForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsListSelectedReposForOrgVariable.id, + forOperation: Operations.ActionsGetSelfHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}/repositories", + template: "/orgs/{}/actions/runners/{}", parameters: [ input.path.org, - input.path.name + input.path.runnerId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4437,20 +4636,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -4461,7 +4646,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body + let body: Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4471,7 +4656,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body.JsonPayload.self, + Components.Schemas.Runner.self, from: responseBody, transforming: { value in .json(value) @@ -4481,8 +4666,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - case 409: - return .conflict(.init()) default: return .undocumented( statusCode: response.status.code, @@ -4495,52 +4678,65 @@ public struct Client: APIProtocol { } ) } - /// Set selected repositories for an organization variable + /// Delete a self-hosted runner from an organization /// - /// Replaces all repositories for an organization variable that is available - /// to selected repositories. Organization variables that are available to selected - /// repositories have their `visibility` field set to `selected`. + /// Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Authenticated users must have admin access to the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)`. - public func actionsSetSelectedReposForOrgVariable(_ input: Operations.ActionsSetSelectedReposForOrgVariable.Input) async throws -> Operations.ActionsSetSelectedReposForOrgVariable.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)`. + public func actionsDeleteSelfHostedRunnerFromOrg(_ input: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input) async throws -> Operations.ActionsDeleteSelfHostedRunnerFromOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetSelectedReposForOrgVariable.id, + forOperation: Operations.ActionsDeleteSelfHostedRunnerFromOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}/repositories", + template: "/orgs/{}/actions/runners/{}", parameters: [ input.path.org, - input.path.name + input.path.runnerId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .delete ) suppressMutabilityWarning(&request) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 204: return .noContent(.init()) - case 409: - return .conflict(.init()) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4553,93 +4749,85 @@ public struct Client: APIProtocol { } ) } - /// Add selected repository to an organization variable + /// List labels for a self-hosted runner for an organization /// - /// Adds a repository to an organization variable that is available to selected repositories. - /// Organization variables that are available to selected repositories have their `visibility` field set to `selected`. + /// Lists all labels for a self-hosted runner configured in an organization. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Authenticated users must have admin access to the organization to use this endpoint. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)`. - public func actionsAddSelectedRepoToOrgVariable(_ input: Operations.ActionsAddSelectedRepoToOrgVariable.Input) async throws -> Operations.ActionsAddSelectedRepoToOrgVariable.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)`. + public func actionsListLabelsForSelfHostedRunnerForOrg(_ input: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsAddSelectedRepoToOrgVariable.id, + forOperation: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}/repositories/{}", + template: "/orgs/{}/actions/runners/{}/labels", parameters: [ input.path.org, - input.path.name, - input.path.repositoryId + input.path.runnerId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .get ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 409: - return .conflict(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ActionsRunnerLabels.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ActionsRunnerLabels.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] ) - } - } - ) - } - /// Remove selected repository from an organization variable - /// - /// Removes a repository from an organization variable that is - /// available to selected repositories. Organization variables that are available to - /// selected repositories have their `visibility` field set to `selected`. - /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)`. - public func actionsRemoveSelectedRepoFromOrgVariable(_ input: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Input) async throws -> Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsRemoveSelectedRepoFromOrgVariable.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/actions/variables/{}/repositories/{}", - parameters: [ - input.path.org, - input.path.name, - input.path.repositoryId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - case 409: - return .conflict(.init()) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4652,70 +4840,53 @@ public struct Client: APIProtocol { } ) } - /// List artifacts for a repository + /// Add custom labels to a self-hosted runner for an organization /// - /// Lists all artifacts for a repository. + /// Adds custom labels to a self-hosted runner configured in an organization. /// - /// Anyone with read access to the repository can use this endpoint. + /// Authenticated users must have admin access to the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/get(actions/list-artifacts-for-repo)`. - public func actionsListArtifactsForRepo(_ input: Operations.ActionsListArtifactsForRepo.Input) async throws -> Operations.ActionsListArtifactsForRepo.Output { + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)`. + public func actionsAddCustomLabelsToSelfHostedRunnerForOrg(_ input: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsListArtifactsForRepo.id, + forOperation: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/artifacts", + template: "/orgs/{}/actions/runners/{}/labels", parameters: [ - input.path.owner, - input.path.repo + input.path.org, + input.path.runnerId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "name", - value: input.query.name - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsListArtifactsForRepo.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListArtifactsForRepo.Output.Ok.Body + let body: Components.Responses.ActionsRunnerLabels.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4725,7 +4896,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListArtifactsForRepo.Output.Ok.Body.JsonPayload.self, + Components.Responses.ActionsRunnerLabels.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -4734,10 +4905,51 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4750,45 +4962,54 @@ public struct Client: APIProtocol { } ) } - /// Get an artifact + /// Set custom labels for a self-hosted runner for an organization /// - /// Gets a specific artifact for a workflow run. + /// Remove all previous custom labels and set the new custom labels for a specific + /// self-hosted runner configured in an organization. /// - /// Anyone with read access to the repository can use this endpoint. + /// Authenticated users must have admin access to the organization to use this endpoint. /// - /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/get(actions/get-artifact)`. - public func actionsGetArtifact(_ input: Operations.ActionsGetArtifact.Input) async throws -> Operations.ActionsGetArtifact.Output { + /// - Remark: HTTP `PUT /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)`. + public func actionsSetCustomLabelsForSelfHostedRunnerForOrg(_ input: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetArtifact.id, + forOperation: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/artifacts/{}", + template: "/orgs/{}/actions/runners/{}/labels", parameters: [ - input.path.owner, - input.path.repo, - input.path.artifactId + input.path.org, + input.path.runnerId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetArtifact.Output.Ok.Body + let body: Components.Responses.ActionsRunnerLabels.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4798,7 +5019,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Artifact.self, + Components.Responses.ActionsRunnerLabels.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -4808,6 +5029,50 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4820,75 +5085,32 @@ public struct Client: APIProtocol { } ) } - /// Delete an artifact + /// Remove all custom labels from a self-hosted runner for an organization /// - /// Deletes an artifact for a workflow run. - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)`. - public func actionsDeleteArtifact(_ input: Operations.ActionsDeleteArtifact.Input) async throws -> Operations.ActionsDeleteArtifact.Output { - try await client.send( - input: input, - forOperation: Operations.ActionsDeleteArtifact.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/artifacts/{}", - parameters: [ - input.path.owner, - input.path.repo, - input.path.artifactId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Download an artifact + /// Remove all custom labels from a self-hosted runner configured in an + /// organization. Returns the remaining read-only labels from the runner. /// - /// Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in - /// the response header to find the URL for the download. The `:archive_format` must be `zip`. + /// Authenticated users must have admin access to the organization to use this endpoint. /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)`. - public func actionsDownloadArtifact(_ input: Operations.ActionsDownloadArtifact.Input) async throws -> Operations.ActionsDownloadArtifact.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)`. + public func actionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg(_ input: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsDownloadArtifact.id, + forOperation: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/artifacts/{}/{}", + template: "/orgs/{}/actions/runners/{}/labels", parameters: [ - input.path.owner, - input.path.repo, - input.path.artifactId, - input.path.archiveFormat + input.path.org, + input.path.runnerId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -4899,16 +5121,31 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 302: - let headers: Operations.ActionsDownloadArtifact.Output.Found.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Location", - as: Components.Headers.Location.self - )) - return .found(.init(headers: headers)) - case 410: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body + let body: Components.Responses.ActionsRunnerLabelsReadonly.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ActionsRunnerLabelsReadonly.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4927,7 +5164,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4940,32 +5177,36 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub Actions cache usage for a repository + /// Remove a custom label from a self-hosted runner for an organization /// - /// Gets GitHub Actions cache usage for a repository. - /// The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. + /// Remove a custom label from a self-hosted runner configured + /// in an organization. Returns the remaining labels from the runner. /// - /// Anyone with read access to the repository can use this endpoint. + /// This endpoint returns a `404 Not Found` status if the custom label is not + /// present on the runner. /// - /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// Authenticated users must have admin access to the organization to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/usage`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/usage/get(actions/get-actions-cache-usage)`. - public func actionsGetActionsCacheUsage(_ input: Operations.ActionsGetActionsCacheUsage.Input) async throws -> Operations.ActionsGetActionsCacheUsage.Output { + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)`. + public func actionsRemoveCustomLabelFromSelfHostedRunnerForOrg(_ input: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input) async throws -> Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetActionsCacheUsage.id, + forOperation: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/cache/usage", + template: "/orgs/{}/actions/runners/{}/labels/{}", parameters: [ - input.path.owner, - input.path.repo + input.path.org, + input.path.runnerId, + input.path.name ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -4978,7 +5219,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetActionsCacheUsage.Output.Ok.Body + let body: Components.Responses.ActionsRunnerLabels.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4988,7 +5229,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsCacheUsageByRepository.self, + Components.Responses.ActionsRunnerLabels.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -4998,6 +5239,50 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5010,24 +5295,26 @@ public struct Client: APIProtocol { } ) } - /// List GitHub Actions caches for a repository + /// List organization secrets /// - /// Lists the GitHub Actions caches for a repository. + /// Lists all secrets available in an organization without revealing their + /// encrypted values. /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/caches`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/get(actions/get-actions-cache-list)`. - public func actionsGetActionsCacheList(_ input: Operations.ActionsGetActionsCacheList.Input) async throws -> Operations.ActionsGetActionsCacheList.Output { + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/get(actions/list-org-secrets)`. + public func actionsListOrgSecrets(_ input: Operations.ActionsListOrgSecrets.Input) async throws -> Operations.ActionsListOrgSecrets.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetActionsCacheList.id, + forOperation: Operations.ActionsListOrgSecrets.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/caches", + template: "/orgs/{}/actions/secrets", parameters: [ - input.path.owner, - input.path.repo + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -5049,34 +5336,6 @@ public struct Client: APIProtocol { name: "page", value: input.query.page ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "ref", - value: input.query.ref - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "key", - value: input.query.key - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "sort", - value: input.query.sort - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "direction", - value: input.query.direction - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -5086,13 +5345,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsGetActionsCacheList.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.ActionsListOrgSecrets.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, name: "Link", as: Components.Headers.Link.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetActionsCacheList.Output.Ok.Body + let body: Operations.ActionsListOrgSecrets.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5102,7 +5361,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsCacheList.self, + Operations.ActionsListOrgSecrets.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -5127,45 +5386,102 @@ public struct Client: APIProtocol { } ) } - /// Delete GitHub Actions caches for a repository (using a cache key) + /// Get an organization public key /// - /// Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref. + /// Gets your public key, which you need to encrypt secrets. You need to + /// encrypt a secret before you can create or update secrets. /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// The authenticated user must have collaborator access to a repository to create, update, or read secrets. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/delete(actions/delete-actions-cache-by-key)`. - public func actionsDeleteActionsCacheByKey(_ input: Operations.ActionsDeleteActionsCacheByKey.Input) async throws -> Operations.ActionsDeleteActionsCacheByKey.Output { + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/public-key`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/public-key/get(actions/get-org-public-key)`. + public func actionsGetOrgPublicKey(_ input: Operations.ActionsGetOrgPublicKey.Input) async throws -> Operations.ActionsGetOrgPublicKey.Output { try await client.send( input: input, - forOperation: Operations.ActionsDeleteActionsCacheByKey.id, + forOperation: Operations.ActionsGetOrgPublicKey.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/caches", + template: "/orgs/{}/actions/secrets/public-key", parameters: [ - input.path.owner, - input.path.repo + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "key", - value: input.query.key + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "ref", - value: input.query.ref + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetOrgPublicKey.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ActionsPublicKey.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get an organization secret + /// + /// Gets a single organization secret without revealing its encrypted value. + /// + /// The authenticated user must have collaborator access to a repository to create, update, or read secrets + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/get(actions/get-org-secret)`. + public func actionsGetOrgSecret(_ input: Operations.ActionsGetOrgSecret.Input) async throws -> Operations.ActionsGetOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/secrets/{}", + parameters: [ + input.path.org, + input.path.secretName + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get ) + suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -5176,7 +5492,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsDeleteActionsCacheByKey.Output.Ok.Body + let body: Operations.ActionsGetOrgSecret.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5186,7 +5502,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsCacheList.self, + Components.Schemas.OrganizationActionsSecret.self, from: responseBody, transforming: { value in .json(value) @@ -5208,25 +5524,107 @@ public struct Client: APIProtocol { } ) } - /// Delete a GitHub Actions cache for a repository (using a cache ID) + /// Create or update an organization secret /// - /// Deletes a GitHub Actions cache for a repository, using a cache ID. + /// Creates or updates an organization secret with an encrypted value. Encrypt your secret using + /// [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)`. - public func actionsDeleteActionsCacheById(_ input: Operations.ActionsDeleteActionsCacheById.Input) async throws -> Operations.ActionsDeleteActionsCacheById.Output { + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)`. + public func actionsCreateOrUpdateOrgSecret(_ input: Operations.ActionsCreateOrUpdateOrgSecret.Input) async throws -> Operations.ActionsCreateOrUpdateOrgSecret.Output { try await client.send( input: input, - forOperation: Operations.ActionsDeleteActionsCacheById.id, + forOperation: Operations.ActionsCreateOrUpdateOrgSecret.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/caches/{}", + template: "/orgs/{}/actions/secrets/{}", parameters: [ - input.path.owner, - input.path.repo, - input.path.cacheId + input.path.org, + input.path.secretName + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsCreateOrUpdateOrgSecret.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.EmptyObject.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete an organization secret + /// + /// Deletes a secret in an organization using the secret name. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)`. + public func actionsDeleteOrgSecret(_ input: Operations.ActionsDeleteOrgSecret.Input) async throws -> Operations.ActionsDeleteOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsDeleteOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/secrets/{}", + parameters: [ + input.path.org, + input.path.secretName ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -5252,34 +5650,1960 @@ public struct Client: APIProtocol { } ) } - /// Get a job for a workflow run + /// List selected repositories for an organization secret /// - /// Gets a specific job in a workflow run. + /// Lists all repositories that have been selected when the `visibility` + /// for repository access to a secret is set to `selected`. /// - /// Anyone with read access to the repository can use this endpoint. + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// - /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/get(actions/get-job-for-workflow-run)`. - public func actionsGetJobForWorkflowRun(_ input: Operations.ActionsGetJobForWorkflowRun.Input) async throws -> Operations.ActionsGetJobForWorkflowRun.Output { + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/get(actions/list-selected-repos-for-org-secret)`. + public func actionsListSelectedReposForOrgSecret(_ input: Operations.ActionsListSelectedReposForOrgSecret.Input) async throws -> Operations.ActionsListSelectedReposForOrgSecret.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetJobForWorkflowRun.id, + forOperation: Operations.ActionsListSelectedReposForOrgSecret.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/jobs/{}", + template: "/orgs/{}/actions/secrets/{}/repositories", parameters: [ - input.path.owner, - input.path.repo, - input.path.jobId + input.path.org, + input.path.secretName ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, method: .get ) - suppressMutabilityWarning(&request) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set selected repositories for an organization secret + /// + /// Replaces all repositories for an organization secret when the `visibility` + /// for repository access is set to `selected`. The visibility is set when you [Create + /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)`. + public func actionsSetSelectedReposForOrgSecret(_ input: Operations.ActionsSetSelectedReposForOrgSecret.Input) async throws -> Operations.ActionsSetSelectedReposForOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsSetSelectedReposForOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/secrets/{}/repositories", + parameters: [ + input.path.org, + input.path.secretName + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add selected repository to an organization secret + /// + /// Adds a repository to an organization secret when the `visibility` for + /// repository access is set to `selected`. For more information about setting the visibility, see [Create or + /// update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)`. + public func actionsAddSelectedRepoToOrgSecret(_ input: Operations.ActionsAddSelectedRepoToOrgSecret.Input) async throws -> Operations.ActionsAddSelectedRepoToOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsAddSelectedRepoToOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/secrets/{}/repositories/{}", + parameters: [ + input.path.org, + input.path.secretName, + input.path.repositoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 409: + return .conflict(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove selected repository from an organization secret + /// + /// Removes a repository from an organization secret when the `visibility` + /// for repository access is set to `selected`. The visibility is set when you [Create + /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)`. + public func actionsRemoveSelectedRepoFromOrgSecret(_ input: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Input) async throws -> Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsRemoveSelectedRepoFromOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/secrets/{}/repositories/{}", + parameters: [ + input.path.org, + input.path.secretName, + input.path.repositoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 409: + return .conflict(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List organization variables + /// + /// Lists all organization variables. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/get(actions/list-org-variables)`. + public func actionsListOrgVariables(_ input: Operations.ActionsListOrgVariables.Input) async throws -> Operations.ActionsListOrgVariables.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListOrgVariables.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/variables", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ActionsListOrgVariables.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsListOrgVariables.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ActionsListOrgVariables.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create an organization variable + /// + /// Creates an organization variable that you can reference in a GitHub Actions workflow. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/post(actions/create-org-variable)`. + public func actionsCreateOrgVariable(_ input: Operations.ActionsCreateOrgVariable.Input) async throws -> Operations.ActionsCreateOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsCreateOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/variables", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsCreateOrgVariable.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.EmptyObject.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get an organization variable + /// + /// Gets a specific variable in an organization. + /// + /// The authenticated user must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/get(actions/get-org-variable)`. + public func actionsGetOrgVariable(_ input: Operations.ActionsGetOrgVariable.Input) async throws -> Operations.ActionsGetOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/variables/{}", + parameters: [ + input.path.org, + input.path.name + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetOrgVariable.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.OrganizationActionsVariable.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update an organization variable + /// + /// Updates an organization variable that you can reference in a GitHub Actions workflow. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/actions/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)`. + public func actionsUpdateOrgVariable(_ input: Operations.ActionsUpdateOrgVariable.Input) async throws -> Operations.ActionsUpdateOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsUpdateOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/variables/{}", + parameters: [ + input.path.org, + input.path.name + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete an organization variable + /// + /// Deletes an organization variable using the variable name. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)`. + public func actionsDeleteOrgVariable(_ input: Operations.ActionsDeleteOrgVariable.Input) async throws -> Operations.ActionsDeleteOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsDeleteOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/variables/{}", + parameters: [ + input.path.org, + input.path.name + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List selected repositories for an organization variable + /// + /// Lists all repositories that can access an organization variable + /// that is available to selected repositories. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)`. + public func actionsListSelectedReposForOrgVariable(_ input: Operations.ActionsListSelectedReposForOrgVariable.Input) async throws -> Operations.ActionsListSelectedReposForOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListSelectedReposForOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/variables/{}/repositories", + parameters: [ + input.path.org, + input.path.name + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 409: + return .conflict(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set selected repositories for an organization variable + /// + /// Replaces all repositories for an organization variable that is available + /// to selected repositories. Organization variables that are available to selected + /// repositories have their `visibility` field set to `selected`. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)`. + public func actionsSetSelectedReposForOrgVariable(_ input: Operations.ActionsSetSelectedReposForOrgVariable.Input) async throws -> Operations.ActionsSetSelectedReposForOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsSetSelectedReposForOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/variables/{}/repositories", + parameters: [ + input.path.org, + input.path.name + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 409: + return .conflict(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add selected repository to an organization variable + /// + /// Adds a repository to an organization variable that is available to selected repositories. + /// Organization variables that are available to selected repositories have their `visibility` field set to `selected`. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)`. + public func actionsAddSelectedRepoToOrgVariable(_ input: Operations.ActionsAddSelectedRepoToOrgVariable.Input) async throws -> Operations.ActionsAddSelectedRepoToOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsAddSelectedRepoToOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/variables/{}/repositories/{}", + parameters: [ + input.path.org, + input.path.name, + input.path.repositoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 409: + return .conflict(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove selected repository from an organization variable + /// + /// Removes a repository from an organization variable that is + /// available to selected repositories. Organization variables that are available to + /// selected repositories have their `visibility` field set to `selected`. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)`. + public func actionsRemoveSelectedRepoFromOrgVariable(_ input: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Input) async throws -> Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsRemoveSelectedRepoFromOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/actions/variables/{}/repositories/{}", + parameters: [ + input.path.org, + input.path.name, + input.path.repositoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 409: + return .conflict(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List artifacts for a repository + /// + /// Lists all artifacts for a repository. + /// + /// Anyone with read access to the repository can use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/get(actions/list-artifacts-for-repo)`. + public func actionsListArtifactsForRepo(_ input: Operations.ActionsListArtifactsForRepo.Input) async throws -> Operations.ActionsListArtifactsForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListArtifactsForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/artifacts", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "name", + value: input.query.name + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ActionsListArtifactsForRepo.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsListArtifactsForRepo.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ActionsListArtifactsForRepo.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get an artifact + /// + /// Gets a specific artifact for a workflow run. + /// + /// Anyone with read access to the repository can use this endpoint. + /// + /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/get(actions/get-artifact)`. + public func actionsGetArtifact(_ input: Operations.ActionsGetArtifact.Input) async throws -> Operations.ActionsGetArtifact.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetArtifact.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/artifacts/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.artifactId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetArtifact.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Artifact.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete an artifact + /// + /// Deletes an artifact for a workflow run. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)`. + public func actionsDeleteArtifact(_ input: Operations.ActionsDeleteArtifact.Input) async throws -> Operations.ActionsDeleteArtifact.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsDeleteArtifact.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/artifacts/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.artifactId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Download an artifact + /// + /// Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in + /// the response header to find the URL for the download. The `:archive_format` must be `zip`. + /// + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)`. + public func actionsDownloadArtifact(_ input: Operations.ActionsDownloadArtifact.Input) async throws -> Operations.ActionsDownloadArtifact.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsDownloadArtifact.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/artifacts/{}/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.artifactId, + input.path.archiveFormat + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 302: + let headers: Operations.ActionsDownloadArtifact.Output.Found.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Location", + as: Components.Headers.Location.self + )) + return .found(.init(headers: headers)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get GitHub Actions cache usage for a repository + /// + /// Gets GitHub Actions cache usage for a repository. + /// The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. + /// + /// Anyone with read access to the repository can use this endpoint. + /// + /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/usage`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/usage/get(actions/get-actions-cache-usage)`. + public func actionsGetActionsCacheUsage(_ input: Operations.ActionsGetActionsCacheUsage.Input) async throws -> Operations.ActionsGetActionsCacheUsage.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetActionsCacheUsage.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/cache/usage", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetActionsCacheUsage.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ActionsCacheUsageByRepository.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List GitHub Actions caches for a repository + /// + /// Lists the GitHub Actions caches for a repository. + /// + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/caches`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/get(actions/get-actions-cache-list)`. + public func actionsGetActionsCacheList(_ input: Operations.ActionsGetActionsCacheList.Input) async throws -> Operations.ActionsGetActionsCacheList.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetActionsCacheList.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/caches", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "ref", + value: input.query.ref + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "key", + value: input.query.key + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sort", + value: input.query.sort + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "direction", + value: input.query.direction + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ActionsGetActionsCacheList.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetActionsCacheList.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ActionsCacheList.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete GitHub Actions caches for a repository (using a cache key) + /// + /// Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref. + /// + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/delete(actions/delete-actions-cache-by-key)`. + public func actionsDeleteActionsCacheByKey(_ input: Operations.ActionsDeleteActionsCacheByKey.Input) async throws -> Operations.ActionsDeleteActionsCacheByKey.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsDeleteActionsCacheByKey.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/caches", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "key", + value: input.query.key + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "ref", + value: input.query.ref + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsDeleteActionsCacheByKey.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ActionsCacheList.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete a GitHub Actions cache for a repository (using a cache ID) + /// + /// Deletes a GitHub Actions cache for a repository, using a cache ID. + /// + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)`. + public func actionsDeleteActionsCacheById(_ input: Operations.ActionsDeleteActionsCacheById.Input) async throws -> Operations.ActionsDeleteActionsCacheById.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsDeleteActionsCacheById.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/caches/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.cacheId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a job for a workflow run + /// + /// Gets a specific job in a workflow run. + /// + /// Anyone with read access to the repository can use this endpoint. + /// + /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/get(actions/get-job-for-workflow-run)`. + public func actionsGetJobForWorkflowRun(_ input: Operations.ActionsGetJobForWorkflowRun.Input) async throws -> Operations.ActionsGetJobForWorkflowRun.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetJobForWorkflowRun.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/jobs/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.jobId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetJobForWorkflowRun.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Job.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Download job logs for a workflow run + /// + /// Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look + /// for `Location:` in the response header to find the URL for the download. + /// + /// Anyone with read access to the repository can use this endpoint. + /// + /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/logs/get(actions/download-job-logs-for-workflow-run)`. + public func actionsDownloadJobLogsForWorkflowRun(_ input: Operations.ActionsDownloadJobLogsForWorkflowRun.Input) async throws -> Operations.ActionsDownloadJobLogsForWorkflowRun.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsDownloadJobLogsForWorkflowRun.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/jobs/{}/logs", + parameters: [ + input.path.owner, + input.path.repo, + input.path.jobId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 302: + let headers: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Location", + as: Swift.String.self + )) + return .found(.init(headers: headers)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Re-run a job from a workflow run + /// + /// Re-run a job and its dependent jobs in a workflow run. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)`. + public func actionsReRunJobForWorkflowRun(_ input: Operations.ActionsReRunJobForWorkflowRun.Input) async throws -> Operations.ActionsReRunJobForWorkflowRun.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsReRunJobForWorkflowRun.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/jobs/{}/rerun", + parameters: [ + input.path.owner, + input.path.repo, + input.path.jobId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case .none: + body = nil + case let .json(value): + body = try converter.setOptionalRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsReRunJobForWorkflowRun.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.EmptyObject.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get the customization template for an OIDC subject claim for a repository + /// + /// Gets the customization template for an OpenID Connect (OIDC) subject claim. + /// + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/oidc/customization/sub`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)`. + public func actionsGetCustomOidcSubClaimForRepo(_ input: Operations.ActionsGetCustomOidcSubClaimForRepo.Input) async throws -> Operations.ActionsGetCustomOidcSubClaimForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetCustomOidcSubClaimForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/oidc/customization/sub", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.OidcCustomSubRepo.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set the customization template for an OIDC subject claim for a repository + /// + /// Sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/oidc/customization/sub`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)`. + public func actionsSetCustomOidcSubClaimForRepo(_ input: Operations.ActionsSetCustomOidcSubClaimForRepo.Input) async throws -> Operations.ActionsSetCustomOidcSubClaimForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsSetCustomOidcSubClaimForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/oidc/customization/sub", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.EmptyObject.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List repository organization secrets + /// + /// Lists all organization secrets shared with a repository without revealing their encrypted + /// values. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-secrets`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-secrets/get(actions/list-repo-organization-secrets)`. + public func actionsListRepoOrganizationSecrets(_ input: Operations.ActionsListRepoOrganizationSecrets.Input) async throws -> Operations.ActionsListRepoOrganizationSecrets.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListRepoOrganizationSecrets.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/organization-secrets", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -5289,8 +7613,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetJobForWorkflowRun.Output.Ok.Body + let body: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5300,7 +7629,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Job.self, + Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -5309,7 +7638,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) default: return .undocumented( statusCode: response.status.code, @@ -5322,28 +7654,26 @@ public struct Client: APIProtocol { } ) } - /// Download job logs for a workflow run + /// List repository organization variables /// - /// Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look - /// for `Location:` in the response header to find the URL for the download. + /// Lists all organization variables shared with a repository. /// - /// Anyone with read access to the repository can use this endpoint. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// - /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/logs/get(actions/download-job-logs-for-workflow-run)`. - public func actionsDownloadJobLogsForWorkflowRun(_ input: Operations.ActionsDownloadJobLogsForWorkflowRun.Input) async throws -> Operations.ActionsDownloadJobLogsForWorkflowRun.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-variables/get(actions/list-repo-organization-variables)`. + public func actionsListRepoOrganizationVariables(_ input: Operations.ActionsListRepoOrganizationVariables.Input) async throws -> Operations.ActionsListRepoOrganizationVariables.Output { try await client.send( input: input, - forOperation: Operations.ActionsDownloadJobLogsForWorkflowRun.id, + forOperation: Operations.ActionsListRepoOrganizationVariables.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/jobs/{}/logs", + template: "/repos/{}/{}/actions/organization-variables", parameters: [ input.path.owner, - input.path.repo, - input.path.jobId + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -5351,17 +7681,58 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 302: - let headers: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + case 200: + let headers: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, - name: "Location", - as: Swift.String.self + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body )) - return .found(.init(headers: headers)) default: return .undocumented( statusCode: response.status.code, @@ -5374,76 +7745,42 @@ public struct Client: APIProtocol { } ) } - /// Re-run a job from a workflow run + /// Get GitHub Actions permissions for a repository /// - /// Re-run a job and its dependent jobs in a workflow run. + /// Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)`. - public func actionsReRunJobForWorkflowRun(_ input: Operations.ActionsReRunJobForWorkflowRun.Input) async throws -> Operations.ActionsReRunJobForWorkflowRun.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/get(actions/get-github-actions-permissions-repository)`. + public func actionsGetGithubActionsPermissionsRepository(_ input: Operations.ActionsGetGithubActionsPermissionsRepository.Input) async throws -> Operations.ActionsGetGithubActionsPermissionsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsReRunJobForWorkflowRun.id, + forOperation: Operations.ActionsGetGithubActionsPermissionsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/jobs/{}/rerun", + template: "/repos/{}/{}/actions/permissions", parameters: [ input.path.owner, - input.path.repo, - input.path.jobId + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case .none: - body = nil - case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsReRunJobForWorkflowRun.Output.Created.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.EmptyObject.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) - case 403: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5453,7 +7790,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ActionsRepositoryPermissions.self, from: responseBody, transforming: { value in .json(value) @@ -5462,7 +7799,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5475,21 +7812,21 @@ public struct Client: APIProtocol { } ) } - /// Get the customization template for an OIDC subject claim for a repository + /// Set GitHub Actions permissions for a repository /// - /// Gets the customization template for an OpenID Connect (OIDC) subject claim. + /// Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository. /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/oidc/customization/sub`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)`. - public func actionsGetCustomOidcSubClaimForRepo(_ input: Operations.ActionsGetCustomOidcSubClaimForRepo.Input) async throws -> Operations.ActionsGetCustomOidcSubClaimForRepo.Output { + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)`. + public func actionsSetGithubActionsPermissionsRepository(_ input: Operations.ActionsSetGithubActionsPermissionsRepository.Input) async throws -> Operations.ActionsSetGithubActionsPermissionsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetCustomOidcSubClaimForRepo.id, + forOperation: Operations.ActionsSetGithubActionsPermissionsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/oidc/customization/sub", + template: "/repos/{}/{}/actions/permissions", parameters: [ input.path.owner, input.path.repo @@ -5497,73 +7834,74 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.OidcCustomSubRepo.self, - from: responseBody, - transforming: { value in - .json(value) - } + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 400: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.BadRequest.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/scim+json" - ] ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/scim+json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ScimError.self, - from: responseBody, - transforming: { value in - .applicationScimJson(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .badRequest(.init(body: body)) - case 404: + } + } + ) + } + /// Get the level of access for workflows outside of the repository + /// + /// Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. + /// This endpoint only applies to private repositories. + /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/access`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/get(actions/get-workflow-access-to-repository)`. + public func actionsGetWorkflowAccessToRepository(_ input: Operations.ActionsGetWorkflowAccessToRepository.Input) async throws -> Operations.ActionsGetWorkflowAccessToRepository.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetWorkflowAccessToRepository.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/permissions/access", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.ActionsGetWorkflowAccessToRepository.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5573,7 +7911,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ActionsWorkflowAccessToRepository.self, from: responseBody, transforming: { value in .json(value) @@ -5582,7 +7920,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5595,21 +7933,23 @@ public struct Client: APIProtocol { } ) } - /// Set the customization template for an OIDC subject claim for a repository + /// Set the level of access for workflows outside of the repository /// - /// Sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository. + /// Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. + /// This endpoint only applies to private repositories. + /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)". /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/oidc/customization/sub`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)`. - public func actionsSetCustomOidcSubClaimForRepo(_ input: Operations.ActionsSetCustomOidcSubClaimForRepo.Input) async throws -> Operations.ActionsSetCustomOidcSubClaimForRepo.Output { + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/access`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)`. + public func actionsSetWorkflowAccessToRepository(_ input: Operations.ActionsSetWorkflowAccessToRepository.Input) async throws -> Operations.ActionsSetWorkflowAccessToRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetCustomOidcSubClaimForRepo.id, + forOperation: Operations.ActionsSetWorkflowAccessToRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/oidc/customization/sub", + template: "/repos/{}/{}/actions/permissions/access", parameters: [ input.path.owner, input.path.repo @@ -5620,10 +7960,6 @@ public struct Client: APIProtocol { method: .put ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) let body: OpenAPIRuntime.HTTPBody? switch input.body { case let .json(value): @@ -5637,103 +7973,8 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.EmptyObject.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 400: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.BadRequest.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/scim+json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - case "application/scim+json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ScimError.self, - from: responseBody, - transforming: { value in - .applicationScimJson(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .badRequest(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) + case 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -5746,24 +7987,21 @@ public struct Client: APIProtocol { } ) } - /// List repository organization secrets - /// - /// Lists all organization secrets shared with a repository without revealing their encrypted - /// values. + /// Get artifact and log retention settings for a repository /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Gets artifact and log retention settings for a repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-secrets`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-secrets/get(actions/list-repo-organization-secrets)`. - public func actionsListRepoOrganizationSecrets(_ input: Operations.ActionsListRepoOrganizationSecrets.Input) async throws -> Operations.ActionsListRepoOrganizationSecrets.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-repository)`. + public func actionsGetArtifactAndLogRetentionSettingsRepository(_ input: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input) async throws -> Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsListRepoOrganizationSecrets.id, + forOperation: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/organization-secrets", + template: "/repos/{}/{}/actions/permissions/artifact-and-log-retention", parameters: [ input.path.owner, input.path.repo @@ -5774,20 +8012,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -5797,13 +8021,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body + let body: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5813,7 +8032,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ActionsArtifactAndLogRetentionResponse.self, from: responseBody, transforming: { value in .json(value) @@ -5822,10 +8041,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5838,23 +8076,21 @@ public struct Client: APIProtocol { } ) } - /// List repository organization variables - /// - /// Lists all organization variables shared with a repository. + /// Set artifact and log retention settings for a repository /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Sets artifact and log retention settings for a repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-variables`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-variables/get(actions/list-repo-organization-variables)`. - public func actionsListRepoOrganizationVariables(_ input: Operations.ActionsListRepoOrganizationVariables.Input) async throws -> Operations.ActionsListRepoOrganizationVariables.Output { + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)`. + public func actionsSetArtifactAndLogRetentionSettingsRepository(_ input: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input) async throws -> Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsListRepoOrganizationVariables.id, + forOperation: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/organization-variables", + template: "/repos/{}/{}/actions/permissions/artifact-and-log-retention", parameters: [ input.path.owner, input.path.repo @@ -5862,39 +8098,31 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5904,7 +8132,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -5913,10 +8141,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5929,21 +8176,21 @@ public struct Client: APIProtocol { } ) } - /// Get GitHub Actions permissions for a repository + /// Get fork PR contributor approval permissions for a repository /// - /// Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository. + /// Gets the fork PR contributor approval policy for a repository. /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/get(actions/get-github-actions-permissions-repository)`. - public func actionsGetGithubActionsPermissionsRepository(_ input: Operations.ActionsGetGithubActionsPermissionsRepository.Input) async throws -> Operations.ActionsGetGithubActionsPermissionsRepository.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-repository)`. + public func actionsGetForkPrContributorApprovalPermissionsRepository(_ input: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input) async throws -> Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetGithubActionsPermissionsRepository.id, + forOperation: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/permissions", + template: "/repos/{}/{}/actions/permissions/fork-pr-contributor-approval", parameters: [ input.path.owner, input.path.repo @@ -5964,7 +8211,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok.Body + let body: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5974,7 +8221,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsRepositoryPermissions.self, + Components.Schemas.ActionsForkPrContributorApproval.self, from: responseBody, transforming: { value in .json(value) @@ -5984,6 +8231,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5996,21 +8265,21 @@ public struct Client: APIProtocol { } ) } - /// Set GitHub Actions permissions for a repository + /// Set fork PR contributor approval permissions for a repository /// - /// Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository. + /// Sets the fork PR contributor approval policy for a repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)`. - public func actionsSetGithubActionsPermissionsRepository(_ input: Operations.ActionsSetGithubActionsPermissionsRepository.Input) async throws -> Operations.ActionsSetGithubActionsPermissionsRepository.Output { + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)`. + public func actionsSetForkPrContributorApprovalPermissionsRepository(_ input: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input) async throws -> Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetGithubActionsPermissionsRepository.id, + forOperation: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/permissions", + template: "/repos/{}/{}/actions/permissions/fork-pr-contributor-approval", parameters: [ input.path.owner, input.path.repo @@ -6021,6 +8290,10 @@ public struct Client: APIProtocol { method: .put ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) let body: OpenAPIRuntime.HTTPBody? switch input.body { case let .json(value): @@ -6036,6 +8309,50 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -6048,23 +8365,21 @@ public struct Client: APIProtocol { } ) } - /// Get the level of access for workflows outside of the repository + /// Get private repo fork PR workflow settings for a repository /// - /// Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. - /// This endpoint only applies to private repositories. - /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)." + /// Gets the settings for whether workflows from fork pull requests can run on a private repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/access`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/get(actions/get-workflow-access-to-repository)`. - public func actionsGetWorkflowAccessToRepository(_ input: Operations.ActionsGetWorkflowAccessToRepository.Input) async throws -> Operations.ActionsGetWorkflowAccessToRepository.Output { + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-repository)`. + public func actionsGetPrivateRepoForkPrWorkflowsSettingsRepository(_ input: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input) async throws -> Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsGetWorkflowAccessToRepository.id, + forOperation: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/permissions/access", + template: "/repos/{}/{}/actions/permissions/fork-pr-workflows-private-repos", parameters: [ input.path.owner, input.path.repo @@ -6085,7 +8400,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ActionsGetWorkflowAccessToRepository.Output.Ok.Body + let body: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6095,7 +8410,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ActionsWorkflowAccessToRepository.self, + Components.Schemas.ActionsForkPrWorkflowsPrivateRepos.self, from: responseBody, transforming: { value in .json(value) @@ -6105,6 +8420,50 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -6117,23 +8476,21 @@ public struct Client: APIProtocol { } ) } - /// Set the level of access for workflows outside of the repository + /// Set private repo fork PR workflow settings for a repository /// - /// Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. - /// This endpoint only applies to private repositories. - /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)". + /// Sets the settings for whether workflows from fork pull requests can run on a private repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/access`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)`. - public func actionsSetWorkflowAccessToRepository(_ input: Operations.ActionsSetWorkflowAccessToRepository.Input) async throws -> Operations.ActionsSetWorkflowAccessToRepository.Output { + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)`. + public func actionsSetPrivateRepoForkPrWorkflowsSettingsRepository(_ input: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input) async throws -> Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Output { try await client.send( input: input, - forOperation: Operations.ActionsSetWorkflowAccessToRepository.id, + forOperation: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/actions/permissions/access", + template: "/repos/{}/{}/actions/permissions/fork-pr-workflows-private-repos", parameters: [ input.path.owner, input.path.repo @@ -6144,6 +8501,10 @@ public struct Client: APIProtocol { method: .put ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) let body: OpenAPIRuntime.HTTPBody? switch input.body { case let .json(value): @@ -6159,6 +8520,50 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -6976,12 +9381,38 @@ public struct Client: APIProtocol { method: .delete ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 204: return .noContent(.init()) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/actions/Types.swift b/Sources/actions/Types.swift index 19d18b4693c..6323cc65d38 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -48,6 +48,60 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `POST /orgs/{org}/actions/hosted-runners`. /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/post(actions/create-hosted-runner-for-org)`. func actionsCreateHostedRunnerForOrg(_ input: Operations.ActionsCreateHostedRunnerForOrg.Input) async throws -> Operations.ActionsCreateHostedRunnerForOrg.Output + /// List custom images for an organization + /// + /// List custom images for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/get(actions/list-custom-images-for-org)`. + func actionsListCustomImagesForOrg(_ input: Operations.ActionsListCustomImagesForOrg.Input) async throws -> Operations.ActionsListCustomImagesForOrg.Output + /// Get a custom image definition for GitHub Actions Hosted Runners + /// + /// Get a custom image definition for GitHub Actions Hosted Runners. + /// + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/get(actions/get-custom-image-for-org)`. + func actionsGetCustomImageForOrg(_ input: Operations.ActionsGetCustomImageForOrg.Input) async throws -> Operations.ActionsGetCustomImageForOrg.Output + /// Delete a custom image from the organization + /// + /// Delete a custom image from the organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/delete(actions/delete-custom-image-from-org)`. + func actionsDeleteCustomImageFromOrg(_ input: Operations.ActionsDeleteCustomImageFromOrg.Input) async throws -> Operations.ActionsDeleteCustomImageFromOrg.Output + /// List image versions of a custom image for an organization + /// + /// List image versions of a custom image for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/get(actions/list-custom-image-versions-for-org)`. + func actionsListCustomImageVersionsForOrg(_ input: Operations.ActionsListCustomImageVersionsForOrg.Input) async throws -> Operations.ActionsListCustomImageVersionsForOrg.Output + /// Get an image version of a custom image for GitHub Actions Hosted Runners + /// + /// Get an image version of a custom image for GitHub Actions Hosted Runners. + /// + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/get(actions/get-custom-image-version-for-org)`. + func actionsGetCustomImageVersionForOrg(_ input: Operations.ActionsGetCustomImageVersionForOrg.Input) async throws -> Operations.ActionsGetCustomImageVersionForOrg.Output + /// Delete an image version of custom image from the organization + /// + /// Delete an image version of custom image from the organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/delete(actions/delete-custom-image-version-from-org)`. + func actionsDeleteCustomImageVersionFromOrg(_ input: Operations.ActionsDeleteCustomImageVersionFromOrg.Input) async throws -> Operations.ActionsDeleteCustomImageVersionFromOrg.Output /// Get GitHub-owned images for GitHub-hosted runners in an organization /// /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. @@ -125,6 +179,56 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions`. /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)`. func actionsSetGithubActionsPermissionsOrganization(_ input: Operations.ActionsSetGithubActionsPermissionsOrganization.Input) async throws -> Operations.ActionsSetGithubActionsPermissionsOrganization.Output + /// Get artifact and log retention settings for an organization + /// + /// Gets artifact and log retention settings for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-organization)`. + func actionsGetArtifactAndLogRetentionSettingsOrganization(_ input: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input) async throws -> Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output + /// Set artifact and log retention settings for an organization + /// + /// Sets artifact and log retention settings for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)`. + func actionsSetArtifactAndLogRetentionSettingsOrganization(_ input: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input) async throws -> Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Output + /// Get fork PR contributor approval permissions for an organization + /// + /// Gets the fork PR contributor approval policy for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-organization)`. + func actionsGetForkPrContributorApprovalPermissionsOrganization(_ input: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input) async throws -> Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output + /// Set fork PR contributor approval permissions for an organization + /// + /// Sets the fork PR contributor approval policy for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)`. + func actionsSetForkPrContributorApprovalPermissionsOrganization(_ input: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input) async throws -> Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Output + /// Get private repo fork PR workflow settings for an organization + /// + /// Gets the settings for whether workflows from fork pull requests can run on private repositories in an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-organization)`. + func actionsGetPrivateRepoForkPrWorkflowsSettingsOrganization(_ input: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input) async throws -> Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output + /// Set private repo fork PR workflow settings for an organization + /// + /// Sets the settings for whether workflows from fork pull requests can run on private repositories in an organization. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)`. + func actionsSetPrivateRepoForkPrWorkflowsSettingsOrganization(_ input: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input) async throws -> Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output /// List selected repositories enabled for GitHub Actions in an organization /// /// Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." @@ -180,6 +284,60 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/selected-actions`. /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)`. func actionsSetAllowedActionsOrganization(_ input: Operations.ActionsSetAllowedActionsOrganization.Input) async throws -> Operations.ActionsSetAllowedActionsOrganization.Output + /// Get self-hosted runners settings for an organization + /// + /// Gets the settings for self-hosted runners for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)`. + func actionsGetSelfHostedRunnersPermissionsOrganization(_ input: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input) async throws -> Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output + /// Set self-hosted runners settings for an organization + /// + /// Sets the settings for self-hosted runners for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)`. + func actionsSetSelfHostedRunnersPermissionsOrganization(_ input: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input) async throws -> Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Output + /// List repositories allowed to use self-hosted runners in an organization + /// + /// Lists repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)`. + func actionsListSelectedRepositoriesSelfHostedRunnersOrganization(_ input: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output + /// Set repositories allowed to use self-hosted runners in an organization + /// + /// Sets repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)`. + func actionsSetSelectedRepositoriesSelfHostedRunnersOrganization(_ input: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Output + /// Add a repository to the list of repositories allowed to use self-hosted runners in an organization + /// + /// Adds a repository to the list of repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)`. + func actionsEnableSelectedRepositorySelfHostedRunnersOrganization(_ input: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Output + /// Remove a repository from the list of repositories allowed to use self-hosted runners in an organization + /// + /// Removes a repository from the list of repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)`. + func actionsDisableSelectedRepositorySelfHostedRunnersOrganization(_ input: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input) async throws -> Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Output /// Get default workflow permissions for an organization /// /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, @@ -884,6 +1042,60 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/access`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)`. func actionsSetWorkflowAccessToRepository(_ input: Operations.ActionsSetWorkflowAccessToRepository.Input) async throws -> Operations.ActionsSetWorkflowAccessToRepository.Output + /// Get artifact and log retention settings for a repository + /// + /// Gets artifact and log retention settings for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-repository)`. + func actionsGetArtifactAndLogRetentionSettingsRepository(_ input: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input) async throws -> Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Output + /// Set artifact and log retention settings for a repository + /// + /// Sets artifact and log retention settings for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)`. + func actionsSetArtifactAndLogRetentionSettingsRepository(_ input: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input) async throws -> Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Output + /// Get fork PR contributor approval permissions for a repository + /// + /// Gets the fork PR contributor approval policy for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-repository)`. + func actionsGetForkPrContributorApprovalPermissionsRepository(_ input: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input) async throws -> Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Output + /// Set fork PR contributor approval permissions for a repository + /// + /// Sets the fork PR contributor approval policy for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)`. + func actionsSetForkPrContributorApprovalPermissionsRepository(_ input: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input) async throws -> Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Output + /// Get private repo fork PR workflow settings for a repository + /// + /// Gets the settings for whether workflows from fork pull requests can run on a private repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-repository)`. + func actionsGetPrivateRepoForkPrWorkflowsSettingsRepository(_ input: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input) async throws -> Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Output + /// Set private repo fork PR workflow settings for a repository + /// + /// Sets the settings for whether workflows from fork pull requests can run on a private repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)`. + func actionsSetPrivateRepoForkPrWorkflowsSettingsRepository(_ input: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input) async throws -> Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Output /// Get allowed actions and reusable workflows for a repository /// /// Gets the settings for selected actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." @@ -1677,6 +1889,96 @@ extension APIProtocol { body: body )) } + /// List custom images for an organization + /// + /// List custom images for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/get(actions/list-custom-images-for-org)`. + public func actionsListCustomImagesForOrg( + path: Operations.ActionsListCustomImagesForOrg.Input.Path, + headers: Operations.ActionsListCustomImagesForOrg.Input.Headers = .init() + ) async throws -> Operations.ActionsListCustomImagesForOrg.Output { + try await actionsListCustomImagesForOrg(Operations.ActionsListCustomImagesForOrg.Input( + path: path, + headers: headers + )) + } + /// Get a custom image definition for GitHub Actions Hosted Runners + /// + /// Get a custom image definition for GitHub Actions Hosted Runners. + /// + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/get(actions/get-custom-image-for-org)`. + public func actionsGetCustomImageForOrg( + path: Operations.ActionsGetCustomImageForOrg.Input.Path, + headers: Operations.ActionsGetCustomImageForOrg.Input.Headers = .init() + ) async throws -> Operations.ActionsGetCustomImageForOrg.Output { + try await actionsGetCustomImageForOrg(Operations.ActionsGetCustomImageForOrg.Input( + path: path, + headers: headers + )) + } + /// Delete a custom image from the organization + /// + /// Delete a custom image from the organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/delete(actions/delete-custom-image-from-org)`. + public func actionsDeleteCustomImageFromOrg(path: Operations.ActionsDeleteCustomImageFromOrg.Input.Path) async throws -> Operations.ActionsDeleteCustomImageFromOrg.Output { + try await actionsDeleteCustomImageFromOrg(Operations.ActionsDeleteCustomImageFromOrg.Input(path: path)) + } + /// List image versions of a custom image for an organization + /// + /// List image versions of a custom image for an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/get(actions/list-custom-image-versions-for-org)`. + public func actionsListCustomImageVersionsForOrg( + path: Operations.ActionsListCustomImageVersionsForOrg.Input.Path, + headers: Operations.ActionsListCustomImageVersionsForOrg.Input.Headers = .init() + ) async throws -> Operations.ActionsListCustomImageVersionsForOrg.Output { + try await actionsListCustomImageVersionsForOrg(Operations.ActionsListCustomImageVersionsForOrg.Input( + path: path, + headers: headers + )) + } + /// Get an image version of a custom image for GitHub Actions Hosted Runners + /// + /// Get an image version of a custom image for GitHub Actions Hosted Runners. + /// + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/get(actions/get-custom-image-version-for-org)`. + public func actionsGetCustomImageVersionForOrg( + path: Operations.ActionsGetCustomImageVersionForOrg.Input.Path, + headers: Operations.ActionsGetCustomImageVersionForOrg.Input.Headers = .init() + ) async throws -> Operations.ActionsGetCustomImageVersionForOrg.Output { + try await actionsGetCustomImageVersionForOrg(Operations.ActionsGetCustomImageVersionForOrg.Input( + path: path, + headers: headers + )) + } + /// Delete an image version of custom image from the organization + /// + /// Delete an image version of custom image from the organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/delete(actions/delete-custom-image-version-from-org)`. + public func actionsDeleteCustomImageVersionFromOrg(path: Operations.ActionsDeleteCustomImageVersionFromOrg.Input.Path) async throws -> Operations.ActionsDeleteCustomImageVersionFromOrg.Output { + try await actionsDeleteCustomImageVersionFromOrg(Operations.ActionsDeleteCustomImageVersionFromOrg.Input(path: path)) + } /// Get GitHub-owned images for GitHub-hosted runners in an organization /// /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. @@ -1836,6 +2138,110 @@ extension APIProtocol { body: body )) } + /// Get artifact and log retention settings for an organization + /// + /// Gets artifact and log retention settings for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-organization)`. + public func actionsGetArtifactAndLogRetentionSettingsOrganization( + path: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Path, + headers: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output { + try await actionsGetArtifactAndLogRetentionSettingsOrganization(Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input( + path: path, + headers: headers + )) + } + /// Set artifact and log retention settings for an organization + /// + /// Sets artifact and log retention settings for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)`. + public func actionsSetArtifactAndLogRetentionSettingsOrganization( + path: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Path, + headers: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Body + ) async throws -> Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Output { + try await actionsSetArtifactAndLogRetentionSettingsOrganization(Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get fork PR contributor approval permissions for an organization + /// + /// Gets the fork PR contributor approval policy for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-organization)`. + public func actionsGetForkPrContributorApprovalPermissionsOrganization( + path: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Path, + headers: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output { + try await actionsGetForkPrContributorApprovalPermissionsOrganization(Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input( + path: path, + headers: headers + )) + } + /// Set fork PR contributor approval permissions for an organization + /// + /// Sets the fork PR contributor approval policy for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)`. + public func actionsSetForkPrContributorApprovalPermissionsOrganization( + path: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Path, + headers: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Body + ) async throws -> Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Output { + try await actionsSetForkPrContributorApprovalPermissionsOrganization(Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get private repo fork PR workflow settings for an organization + /// + /// Gets the settings for whether workflows from fork pull requests can run on private repositories in an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-organization)`. + public func actionsGetPrivateRepoForkPrWorkflowsSettingsOrganization( + path: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path, + headers: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output { + try await actionsGetPrivateRepoForkPrWorkflowsSettingsOrganization(Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input( + path: path, + headers: headers + )) + } + /// Set private repo fork PR workflow settings for an organization + /// + /// Sets the settings for whether workflows from fork pull requests can run on private repositories in an organization. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)`. + public func actionsSetPrivateRepoForkPrWorkflowsSettingsOrganization( + path: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path, + headers: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Body + ) async throws -> Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output { + try await actionsSetPrivateRepoForkPrWorkflowsSettingsOrganization(Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input( + path: path, + headers: headers, + body: body + )) + } /// List selected repositories enabled for GitHub Actions in an organization /// /// Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." @@ -1929,6 +2335,114 @@ extension APIProtocol { body: body )) } + /// Get self-hosted runners settings for an organization + /// + /// Gets the settings for self-hosted runners for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)`. + public func actionsGetSelfHostedRunnersPermissionsOrganization( + path: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Path, + headers: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output { + try await actionsGetSelfHostedRunnersPermissionsOrganization(Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input( + path: path, + headers: headers + )) + } + /// Set self-hosted runners settings for an organization + /// + /// Sets the settings for self-hosted runners for an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)`. + public func actionsSetSelfHostedRunnersPermissionsOrganization( + path: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Path, + headers: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Body + ) async throws -> Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Output { + try await actionsSetSelfHostedRunnersPermissionsOrganization(Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input( + path: path, + headers: headers, + body: body + )) + } + /// List repositories allowed to use self-hosted runners in an organization + /// + /// Lists repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)`. + public func actionsListSelectedRepositoriesSelfHostedRunnersOrganization( + path: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path, + query: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Query = .init(), + headers: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output { + try await actionsListSelectedRepositoriesSelfHostedRunnersOrganization(Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input( + path: path, + query: query, + headers: headers + )) + } + /// Set repositories allowed to use self-hosted runners in an organization + /// + /// Sets repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)`. + public func actionsSetSelectedRepositoriesSelfHostedRunnersOrganization( + path: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path, + headers: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers = .init(), + body: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Body + ) async throws -> Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Output { + try await actionsSetSelectedRepositoriesSelfHostedRunnersOrganization(Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input( + path: path, + headers: headers, + body: body + )) + } + /// Add a repository to the list of repositories allowed to use self-hosted runners in an organization + /// + /// Adds a repository to the list of repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)`. + public func actionsEnableSelectedRepositorySelfHostedRunnersOrganization( + path: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Path, + headers: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Output { + try await actionsEnableSelectedRepositorySelfHostedRunnersOrganization(Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input( + path: path, + headers: headers + )) + } + /// Remove a repository from the list of repositories allowed to use self-hosted runners in an organization + /// + /// Removes a repository from the list of repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)`. + public func actionsDisableSelectedRepositorySelfHostedRunnersOrganization( + path: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Path, + headers: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers = .init() + ) async throws -> Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Output { + try await actionsDisableSelectedRepositorySelfHostedRunnersOrganization(Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input( + path: path, + headers: headers + )) + } /// Get default workflow permissions for an organization /// /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, @@ -2327,8 +2841,14 @@ extension APIProtocol { /// /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)`. - public func actionsDeleteSelfHostedRunnerFromOrg(path: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input.Path) async throws -> Operations.ActionsDeleteSelfHostedRunnerFromOrg.Output { - try await actionsDeleteSelfHostedRunnerFromOrg(Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input(path: path)) + public func actionsDeleteSelfHostedRunnerFromOrg( + path: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input.Path, + headers: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input.Headers = .init() + ) async throws -> Operations.ActionsDeleteSelfHostedRunnerFromOrg.Output { + try await actionsDeleteSelfHostedRunnerFromOrg(Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input( + path: path, + headers: headers + )) } /// List labels for a self-hosted runner for an organization /// @@ -3109,68 +3629,176 @@ extension APIProtocol { body: body )) } - /// Get allowed actions and reusable workflows for a repository + /// Get artifact and log retention settings for a repository /// - /// Gets the settings for selected actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." + /// Gets artifact and log retention settings for a repository. /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/selected-actions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/selected-actions/get(actions/get-allowed-actions-repository)`. - public func actionsGetAllowedActionsRepository( - path: Operations.ActionsGetAllowedActionsRepository.Input.Path, - headers: Operations.ActionsGetAllowedActionsRepository.Input.Headers = .init() - ) async throws -> Operations.ActionsGetAllowedActionsRepository.Output { - try await actionsGetAllowedActionsRepository(Operations.ActionsGetAllowedActionsRepository.Input( + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-repository)`. + public func actionsGetArtifactAndLogRetentionSettingsRepository( + path: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input.Path, + headers: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input.Headers = .init() + ) async throws -> Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Output { + try await actionsGetArtifactAndLogRetentionSettingsRepository(Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input( path: path, headers: headers )) } - /// Set allowed actions and reusable workflows for a repository + /// Set artifact and log retention settings for a repository /// - /// Sets the actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." + /// Sets artifact and log retention settings for a repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/selected-actions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/selected-actions/put(actions/set-allowed-actions-repository)`. - public func actionsSetAllowedActionsRepository( - path: Operations.ActionsSetAllowedActionsRepository.Input.Path, - body: Operations.ActionsSetAllowedActionsRepository.Input.Body? = nil - ) async throws -> Operations.ActionsSetAllowedActionsRepository.Output { - try await actionsSetAllowedActionsRepository(Operations.ActionsSetAllowedActionsRepository.Input( + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)`. + public func actionsSetArtifactAndLogRetentionSettingsRepository( + path: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Path, + headers: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Headers = .init(), + body: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Body + ) async throws -> Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Output { + try await actionsSetArtifactAndLogRetentionSettingsRepository(Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input( path: path, + headers: headers, body: body )) } - /// Get default workflow permissions for a repository + /// Get fork PR contributor approval permissions for a repository /// - /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository, - /// as well as if GitHub Actions can submit approving pull request reviews. - /// For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)." + /// Gets the fork PR contributor approval policy for a repository. /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/workflow`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-repository)`. - public func actionsGetGithubActionsDefaultWorkflowPermissionsRepository( - path: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsRepository.Input.Path, - headers: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsRepository.Input.Headers = .init() - ) async throws -> Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsRepository.Output { - try await actionsGetGithubActionsDefaultWorkflowPermissionsRepository(Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsRepository.Input( + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-repository)`. + public func actionsGetForkPrContributorApprovalPermissionsRepository( + path: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input.Path, + headers: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input.Headers = .init() + ) async throws -> Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Output { + try await actionsGetForkPrContributorApprovalPermissionsRepository(Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input( path: path, headers: headers )) } - /// Set default workflow permissions for a repository + /// Set fork PR contributor approval permissions for a repository /// - /// Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository, and sets if GitHub Actions - /// can submit approving pull request reviews. - /// For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)." + /// Sets the fork PR contributor approval policy for a repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/workflow`. + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)`. + public func actionsSetForkPrContributorApprovalPermissionsRepository( + path: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Path, + headers: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Headers = .init(), + body: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Body + ) async throws -> Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Output { + try await actionsSetForkPrContributorApprovalPermissionsRepository(Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get private repo fork PR workflow settings for a repository + /// + /// Gets the settings for whether workflows from fork pull requests can run on a private repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-repository)`. + public func actionsGetPrivateRepoForkPrWorkflowsSettingsRepository( + path: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Path, + headers: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Headers = .init() + ) async throws -> Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Output { + try await actionsGetPrivateRepoForkPrWorkflowsSettingsRepository(Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input( + path: path, + headers: headers + )) + } + /// Set private repo fork PR workflow settings for a repository + /// + /// Sets the settings for whether workflows from fork pull requests can run on a private repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)`. + public func actionsSetPrivateRepoForkPrWorkflowsSettingsRepository( + path: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Path, + headers: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Headers = .init(), + body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Body + ) async throws -> Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Output { + try await actionsSetPrivateRepoForkPrWorkflowsSettingsRepository(Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get allowed actions and reusable workflows for a repository + /// + /// Gets the settings for selected actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." + /// + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/selected-actions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/selected-actions/get(actions/get-allowed-actions-repository)`. + public func actionsGetAllowedActionsRepository( + path: Operations.ActionsGetAllowedActionsRepository.Input.Path, + headers: Operations.ActionsGetAllowedActionsRepository.Input.Headers = .init() + ) async throws -> Operations.ActionsGetAllowedActionsRepository.Output { + try await actionsGetAllowedActionsRepository(Operations.ActionsGetAllowedActionsRepository.Input( + path: path, + headers: headers + )) + } + /// Set allowed actions and reusable workflows for a repository + /// + /// Sets the actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/selected-actions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/selected-actions/put(actions/set-allowed-actions-repository)`. + public func actionsSetAllowedActionsRepository( + path: Operations.ActionsSetAllowedActionsRepository.Input.Path, + body: Operations.ActionsSetAllowedActionsRepository.Input.Body? = nil + ) async throws -> Operations.ActionsSetAllowedActionsRepository.Output { + try await actionsSetAllowedActionsRepository(Operations.ActionsSetAllowedActionsRepository.Input( + path: path, + body: body + )) + } + /// Get default workflow permissions for a repository + /// + /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository, + /// as well as if GitHub Actions can submit approving pull request reviews. + /// For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)." + /// + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/workflow`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-repository)`. + public func actionsGetGithubActionsDefaultWorkflowPermissionsRepository( + path: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsRepository.Input.Path, + headers: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsRepository.Input.Headers = .init() + ) async throws -> Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsRepository.Output { + try await actionsGetGithubActionsDefaultWorkflowPermissionsRepository(Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsRepository.Input( + path: path, + headers: headers + )) + } + /// Set default workflow permissions for a repository + /// + /// Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository, and sets if GitHub Actions + /// can submit approving pull request reviews. + /// For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/workflow`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-repository)`. public func actionsSetGithubActionsDefaultWorkflowPermissionsRepository( path: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsRepository.Input.Path, @@ -3321,8 +3949,14 @@ extension APIProtocol { /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-repo)`. - public func actionsDeleteSelfHostedRunnerFromRepo(path: Operations.ActionsDeleteSelfHostedRunnerFromRepo.Input.Path) async throws -> Operations.ActionsDeleteSelfHostedRunnerFromRepo.Output { - try await actionsDeleteSelfHostedRunnerFromRepo(Operations.ActionsDeleteSelfHostedRunnerFromRepo.Input(path: path)) + public func actionsDeleteSelfHostedRunnerFromRepo( + path: Operations.ActionsDeleteSelfHostedRunnerFromRepo.Input.Path, + headers: Operations.ActionsDeleteSelfHostedRunnerFromRepo.Input.Headers = .init() + ) async throws -> Operations.ActionsDeleteSelfHostedRunnerFromRepo.Output { + try await actionsDeleteSelfHostedRunnerFromRepo(Operations.ActionsDeleteSelfHostedRunnerFromRepo.Input( + path: path, + headers: headers + )) } /// List labels for a self-hosted runner for a repository /// @@ -4683,6 +5317,131 @@ public enum Components { case schemas } } + /// Validation Error + /// + /// - Remark: Generated from `#/components/schemas/validation-error`. + public struct ValidationError: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. + public var documentationUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/field`. + public var field: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/code`. + public var code: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/index`. + public var index: Swift.Int? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case1`. + case case1(Swift.String?) + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case2`. + case case2(Swift.Int?) + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. + case case3([Swift.String]?) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value`. + public var value: Components.Schemas.ValidationError.ErrorsPayloadPayload.ValuePayload? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - resource: + /// - field: + /// - message: + /// - code: + /// - index: + /// - value: + public init( + resource: Swift.String? = nil, + field: Swift.String? = nil, + message: Swift.String? = nil, + code: Swift.String, + index: Swift.Int? = nil, + value: Components.Schemas.ValidationError.ErrorsPayloadPayload.ValuePayload? = nil + ) { + self.resource = resource + self.field = field + self.message = message + self.code = code + self.index = index + self.value = value + } + public enum CodingKeys: String, CodingKey { + case resource + case field + case message + case code + case index + case value + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public typealias ErrorsPayload = [Components.Schemas.ValidationError.ErrorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public var errors: Components.Schemas.ValidationError.ErrorsPayload? + /// Creates a new `ValidationError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String, + documentationUrl: Swift.String, + errors: Components.Schemas.ValidationError.ErrorsPayload? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. @@ -5228,6 +5987,35 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/anonymous_access_enabled`. public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? /// Creates a new `Repository`. /// /// - Parameters: @@ -5326,6 +6114,7 @@ public enum Components { /// - masterBranch: /// - starredAt: /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository public init( id: Swift.Int64, nodeId: Swift.String, @@ -5421,7 +6210,8 @@ public enum Components { watchers: Swift.Int, masterBranch: Swift.String? = nil, starredAt: Swift.String? = nil, - anonymousAccessEnabled: Swift.Bool? = nil + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -5518,6 +6308,7 @@ public enum Components { self.masterBranch = masterBranch self.starredAt = starredAt self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus } public enum CodingKeys: String, CodingKey { case id @@ -5615,6 +6406,7 @@ public enum Components { case masterBranch = "master_branch" case starredAt = "starred_at" case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" } } /// Code Of Conduct @@ -5833,20 +6625,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. public var permissions: Components.Schemas.NullableIntegration.PermissionsPayload - /// The list of events for the GitHub app + /// The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. /// /// - Remark: Generated from `#/components/schemas/nullable-integration/events`. public var events: [Swift.String] - /// The number of installations associated with the GitHub app + /// The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. /// /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. public var installationsCount: Swift.Int? - /// - Remark: Generated from `#/components/schemas/nullable-integration/client_secret`. - public var clientSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/webhook_secret`. - public var webhookSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/pem`. - public var pem: Swift.String? /// Creates a new `NullableIntegration`. /// /// - Parameters: @@ -5862,11 +6648,8 @@ public enum Components { /// - createdAt: /// - updatedAt: /// - permissions: The set of permissions for the GitHub app - /// - events: The list of events for the GitHub app - /// - installationsCount: The number of installations associated with the GitHub app - /// - clientSecret: - /// - webhookSecret: - /// - pem: + /// - events: The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. + /// - installationsCount: The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. public init( id: Swift.Int, slug: Swift.String? = nil, @@ -5881,10 +6664,7 @@ public enum Components { updatedAt: Foundation.Date, permissions: Components.Schemas.NullableIntegration.PermissionsPayload, events: [Swift.String], - installationsCount: Swift.Int? = nil, - clientSecret: Swift.String? = nil, - webhookSecret: Swift.String? = nil, - pem: Swift.String? = nil + installationsCount: Swift.Int? = nil ) { self.id = id self.slug = slug @@ -5900,9 +6680,6 @@ public enum Components { self.permissions = permissions self.events = events self.installationsCount = installationsCount - self.clientSecret = clientSecret - self.webhookSecret = webhookSecret - self.pem = pem } public enum CodingKeys: String, CodingKey { case id @@ -5919,13 +6696,15 @@ public enum Components { case permissions case events case installationsCount = "installations_count" - case clientSecret = "client_secret" - case webhookSecret = "webhook_secret" - case pem } } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -5946,6 +6725,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -6091,7 +6875,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: @@ -6387,6 +7171,30 @@ public enum Components { public var webCommitSignoffRequired: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/security_and_analysis`. public var securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public struct CustomPropertiesPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CustomPropertiesPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public var customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? /// Creates a new `MinimalRepository`. /// /// - Parameters: @@ -6477,6 +7285,7 @@ public enum Components { /// - allowForking: /// - webCommitSignoffRequired: /// - securityAndAnalysis: + /// - customProperties: The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. public init( id: Swift.Int64, nodeId: Swift.String, @@ -6564,7 +7373,8 @@ public enum Components { watchers: Swift.Int? = nil, allowForking: Swift.Bool? = nil, webCommitSignoffRequired: Swift.Bool? = nil, - securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil + securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil, + customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -6653,6 +7463,7 @@ public enum Components { self.allowForking = allowForking self.webCommitSignoffRequired = webCommitSignoffRequired self.securityAndAnalysis = securityAndAnalysis + self.customProperties = customProperties } public enum CodingKeys: String, CodingKey { case id @@ -6742,6 +7553,7 @@ public enum Components { case allowForking = "allow_forking" case webCommitSignoffRequired = "web_commit_signoff_required" case securityAndAnalysis = "security_and_analysis" + case customProperties = "custom_properties" } } /// - Remark: Generated from `#/components/schemas/actions-cache-usage-org-enterprise`. @@ -6836,6 +7648,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-actions-hosted-runner-pool-image/source`. public var source: Components.Schemas.NullableActionsHostedRunnerPoolImage.SourcePayload + /// The image version of the hosted runner pool. + /// + /// - Remark: Generated from `#/components/schemas/nullable-actions-hosted-runner-pool-image/version`. + public var version: Swift.String? /// Creates a new `NullableActionsHostedRunnerPoolImage`. /// /// - Parameters: @@ -6843,22 +7659,26 @@ public enum Components { /// - sizeGb: Image size in GB. /// - displayName: Display name for this image. /// - source: The image provider. + /// - version: The image version of the hosted runner pool. public init( id: Swift.String, sizeGb: Swift.Int, displayName: Swift.String, - source: Components.Schemas.NullableActionsHostedRunnerPoolImage.SourcePayload + source: Components.Schemas.NullableActionsHostedRunnerPoolImage.SourcePayload, + version: Swift.String? = nil ) { self.id = id self.sizeGb = sizeGb self.displayName = displayName self.source = source + self.version = version } public enum CodingKeys: String, CodingKey { case id case sizeGb = "size_gb" case displayName = "display_name" case source + case version } } /// Provides details of a particular machine spec. @@ -6997,6 +7817,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/actions-hosted-runner/last_active_on`. public var lastActiveOn: Foundation.Date? + /// Whether custom image generation is enabled for the hosted runners. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner/image_gen`. + public var imageGen: Swift.Bool? /// Creates a new `ActionsHostedRunner`. /// /// - Parameters: @@ -7011,6 +7835,7 @@ public enum Components { /// - publicIpEnabled: Whether public IP is enabled for the hosted runners. /// - publicIps: The public IP ranges when public IP is enabled for the hosted runners. /// - lastActiveOn: The time at which the runner was last used, in ISO 8601 format. + /// - imageGen: Whether custom image generation is enabled for the hosted runners. public init( id: Swift.Int, name: Swift.String, @@ -7022,7 +7847,8 @@ public enum Components { maximumRunners: Swift.Int? = nil, publicIpEnabled: Swift.Bool, publicIps: [Components.Schemas.PublicIp]? = nil, - lastActiveOn: Foundation.Date? = nil + lastActiveOn: Foundation.Date? = nil, + imageGen: Swift.Bool? = nil ) { self.id = id self.name = name @@ -7035,6 +7861,7 @@ public enum Components { self.publicIpEnabled = publicIpEnabled self.publicIps = publicIps self.lastActiveOn = lastActiveOn + self.imageGen = imageGen } public enum CodingKeys: String, CodingKey { case id @@ -7048,31 +7875,162 @@ public enum Components { case publicIpEnabled = "public_ip_enabled" case publicIps = "public_ips" case lastActiveOn = "last_active_on" + case imageGen = "image_gen" + } + } + /// Provides details of a custom runner image + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-custom-image`. + public struct ActionsHostedRunnerCustomImage: Codable, Hashable, Sendable { + /// The ID of the image. Use this ID for the `image` parameter when creating a new larger runner. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-custom-image/id`. + public var id: Swift.Int + /// The operating system of the image. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-custom-image/platform`. + public var platform: Swift.String + /// Total size of all the image versions in GB. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-custom-image/total_versions_size`. + public var totalVersionsSize: Swift.Int + /// Display name for this image. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-custom-image/name`. + public var name: Swift.String + /// The image provider. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-custom-image/source`. + public var source: Swift.String + /// The number of image versions associated with the image. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-custom-image/versions_count`. + public var versionsCount: Swift.Int + /// The latest image version associated with the image. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-custom-image/latest_version`. + public var latestVersion: Swift.String + /// The number of image versions associated with the image. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-custom-image/state`. + public var state: Swift.String + /// Creates a new `ActionsHostedRunnerCustomImage`. + /// + /// - Parameters: + /// - id: The ID of the image. Use this ID for the `image` parameter when creating a new larger runner. + /// - platform: The operating system of the image. + /// - totalVersionsSize: Total size of all the image versions in GB. + /// - name: Display name for this image. + /// - source: The image provider. + /// - versionsCount: The number of image versions associated with the image. + /// - latestVersion: The latest image version associated with the image. + /// - state: The number of image versions associated with the image. + public init( + id: Swift.Int, + platform: Swift.String, + totalVersionsSize: Swift.Int, + name: Swift.String, + source: Swift.String, + versionsCount: Swift.Int, + latestVersion: Swift.String, + state: Swift.String + ) { + self.id = id + self.platform = platform + self.totalVersionsSize = totalVersionsSize + self.name = name + self.source = source + self.versionsCount = versionsCount + self.latestVersion = latestVersion + self.state = state + } + public enum CodingKeys: String, CodingKey { + case id + case platform + case totalVersionsSize = "total_versions_size" + case name + case source + case versionsCount = "versions_count" + case latestVersion = "latest_version" + case state + } + } + /// Provides details of a hosted runner custom image version + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-custom-image-version`. + public struct ActionsHostedRunnerCustomImageVersion: Codable, Hashable, Sendable { + /// The version of image. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-custom-image-version/version`. + public var version: Swift.String + /// The state of image version. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-custom-image-version/state`. + public var state: Swift.String + /// Image version size in GB. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-custom-image-version/size_gb`. + public var sizeGb: Swift.Int + /// The creation date time of the image version. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-custom-image-version/created_on`. + public var createdOn: Swift.String + /// The image version status details. + /// + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-custom-image-version/state_details`. + public var stateDetails: Swift.String + /// Creates a new `ActionsHostedRunnerCustomImageVersion`. + /// + /// - Parameters: + /// - version: The version of image. + /// - state: The state of image version. + /// - sizeGb: Image version size in GB. + /// - createdOn: The creation date time of the image version. + /// - stateDetails: The image version status details. + public init( + version: Swift.String, + state: Swift.String, + sizeGb: Swift.Int, + createdOn: Swift.String, + stateDetails: Swift.String + ) { + self.version = version + self.state = state + self.sizeGb = sizeGb + self.createdOn = createdOn + self.stateDetails = stateDetails + } + public enum CodingKeys: String, CodingKey { + case version + case state + case sizeGb = "size_gb" + case createdOn = "created_on" + case stateDetails = "state_details" } } /// Provides details of a hosted runner image /// - /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-image`. - public struct ActionsHostedRunnerImage: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-curated-image`. + public struct ActionsHostedRunnerCuratedImage: Codable, Hashable, Sendable { /// The ID of the image. Use this ID for the `image` parameter when creating a new larger runner. /// - /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-image/id`. + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-curated-image/id`. public var id: Swift.String /// The operating system of the image. /// - /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-image/platform`. + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-curated-image/platform`. public var platform: Swift.String /// Image size in GB. /// - /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-image/size_gb`. + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-curated-image/size_gb`. public var sizeGb: Swift.Int /// Display name for this image. /// - /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-image/display_name`. + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-curated-image/display_name`. public var displayName: Swift.String /// The image provider. /// - /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-image/source`. + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-curated-image/source`. @frozen public enum SourcePayload: String, Codable, Hashable, Sendable, CaseIterable { case github = "github" case partner = "partner" @@ -7080,9 +8038,9 @@ public enum Components { } /// The image provider. /// - /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-image/source`. - public var source: Components.Schemas.ActionsHostedRunnerImage.SourcePayload - /// Creates a new `ActionsHostedRunnerImage`. + /// - Remark: Generated from `#/components/schemas/actions-hosted-runner-curated-image/source`. + public var source: Components.Schemas.ActionsHostedRunnerCuratedImage.SourcePayload + /// Creates a new `ActionsHostedRunnerCuratedImage`. /// /// - Parameters: /// - id: The ID of the image. Use this ID for the `image` parameter when creating a new larger runner. @@ -7095,7 +8053,7 @@ public enum Components { platform: Swift.String, sizeGb: Swift.Int, displayName: Swift.String, - source: Components.Schemas.ActionsHostedRunnerImage.SourcePayload + source: Components.Schemas.ActionsHostedRunnerCuratedImage.SourcePayload ) { self.id = id self.platform = platform @@ -7187,6 +8145,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/selected-actions-url`. public typealias SelectedActionsUrl = Swift.String + /// Whether actions must be pinned to a full-length commit SHA. + /// + /// - Remark: Generated from `#/components/schemas/sha-pinning-required`. + public typealias ShaPinningRequired = Swift.Bool /// - Remark: Generated from `#/components/schemas/actions-organization-permissions`. public struct ActionsOrganizationPermissions: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/actions-organization-permissions/enabled_repositories`. @@ -7199,6 +8161,8 @@ public enum Components { public var allowedActions: Components.Schemas.AllowedActions? /// - Remark: Generated from `#/components/schemas/actions-organization-permissions/selected_actions_url`. public var selectedActionsUrl: Components.Schemas.SelectedActionsUrl? + /// - Remark: Generated from `#/components/schemas/actions-organization-permissions/sha_pinning_required`. + public var shaPinningRequired: Components.Schemas.ShaPinningRequired? /// Creates a new `ActionsOrganizationPermissions`. /// /// - Parameters: @@ -7206,38 +8170,197 @@ public enum Components { /// - selectedRepositoriesUrl: The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`. /// - allowedActions: /// - selectedActionsUrl: + /// - shaPinningRequired: public init( enabledRepositories: Components.Schemas.EnabledRepositories, selectedRepositoriesUrl: Swift.String? = nil, allowedActions: Components.Schemas.AllowedActions? = nil, - selectedActionsUrl: Components.Schemas.SelectedActionsUrl? = nil + selectedActionsUrl: Components.Schemas.SelectedActionsUrl? = nil, + shaPinningRequired: Components.Schemas.ShaPinningRequired? = nil ) { self.enabledRepositories = enabledRepositories self.selectedRepositoriesUrl = selectedRepositoriesUrl self.allowedActions = allowedActions self.selectedActionsUrl = selectedActionsUrl + self.shaPinningRequired = shaPinningRequired } public enum CodingKeys: String, CodingKey { case enabledRepositories = "enabled_repositories" case selectedRepositoriesUrl = "selected_repositories_url" case allowedActions = "allowed_actions" case selectedActionsUrl = "selected_actions_url" + case shaPinningRequired = "sha_pinning_required" } } - /// - Remark: Generated from `#/components/schemas/selected-actions`. - public struct SelectedActions: Codable, Hashable, Sendable { - /// Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. + /// - Remark: Generated from `#/components/schemas/actions-artifact-and-log-retention-response`. + public struct ActionsArtifactAndLogRetentionResponse: Codable, Hashable, Sendable { + /// The number of days artifacts and logs are retained /// - /// - Remark: Generated from `#/components/schemas/selected-actions/github_owned_allowed`. - public var githubOwnedAllowed: Swift.Bool? - /// Whether actions from GitHub Marketplace verified creators are allowed. Set to `true` to allow all actions by GitHub Marketplace verified creators. + /// - Remark: Generated from `#/components/schemas/actions-artifact-and-log-retention-response/days`. + public var days: Swift.Int + /// The maximum number of days that can be configured /// - /// - Remark: Generated from `#/components/schemas/selected-actions/verified_allowed`. - public var verifiedAllowed: Swift.Bool? - /// Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`. + /// - Remark: Generated from `#/components/schemas/actions-artifact-and-log-retention-response/maximum_allowed_days`. + public var maximumAllowedDays: Swift.Int + /// Creates a new `ActionsArtifactAndLogRetentionResponse`. /// - /// > [!NOTE] - /// > The `patterns_allowed` setting only applies to public repositories. + /// - Parameters: + /// - days: The number of days artifacts and logs are retained + /// - maximumAllowedDays: The maximum number of days that can be configured + public init( + days: Swift.Int, + maximumAllowedDays: Swift.Int + ) { + self.days = days + self.maximumAllowedDays = maximumAllowedDays + } + public enum CodingKeys: String, CodingKey { + case days + case maximumAllowedDays = "maximum_allowed_days" + } + } + /// - Remark: Generated from `#/components/schemas/actions-artifact-and-log-retention`. + public struct ActionsArtifactAndLogRetention: Codable, Hashable, Sendable { + /// The number of days to retain artifacts and logs + /// + /// - Remark: Generated from `#/components/schemas/actions-artifact-and-log-retention/days`. + public var days: Swift.Int + /// Creates a new `ActionsArtifactAndLogRetention`. + /// + /// - Parameters: + /// - days: The number of days to retain artifacts and logs + public init(days: Swift.Int) { + self.days = days + } + public enum CodingKeys: String, CodingKey { + case days + } + } + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-contributor-approval`. + public struct ActionsForkPrContributorApproval: Codable, Hashable, Sendable { + /// The policy that controls when fork PR workflows require approval from a maintainer. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-contributor-approval/approval_policy`. + @frozen public enum ApprovalPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case firstTimeContributorsNewToGithub = "first_time_contributors_new_to_github" + case firstTimeContributors = "first_time_contributors" + case allExternalContributors = "all_external_contributors" + } + /// The policy that controls when fork PR workflows require approval from a maintainer. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-contributor-approval/approval_policy`. + public var approvalPolicy: Components.Schemas.ActionsForkPrContributorApproval.ApprovalPolicyPayload + /// Creates a new `ActionsForkPrContributorApproval`. + /// + /// - Parameters: + /// - approvalPolicy: The policy that controls when fork PR workflows require approval from a maintainer. + public init(approvalPolicy: Components.Schemas.ActionsForkPrContributorApproval.ApprovalPolicyPayload) { + self.approvalPolicy = approvalPolicy + } + public enum CodingKeys: String, CodingKey { + case approvalPolicy = "approval_policy" + } + } + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos`. + public struct ActionsForkPrWorkflowsPrivateRepos: Codable, Hashable, Sendable { + /// Whether workflows triggered by pull requests from forks are allowed to run on private repositories. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos/run_workflows_from_fork_pull_requests`. + public var runWorkflowsFromForkPullRequests: Swift.Bool + /// Whether GitHub Actions can create pull requests or submit approving pull request reviews from a workflow triggered by a fork pull request. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos/send_write_tokens_to_workflows`. + public var sendWriteTokensToWorkflows: Swift.Bool + /// Whether to make secrets and variables available to workflows triggered by pull requests from forks. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos/send_secrets_and_variables`. + public var sendSecretsAndVariables: Swift.Bool + /// Whether workflows triggered by pull requests from forks require approval from a repository administrator to run. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos/require_approval_for_fork_pr_workflows`. + public var requireApprovalForForkPrWorkflows: Swift.Bool + /// Creates a new `ActionsForkPrWorkflowsPrivateRepos`. + /// + /// - Parameters: + /// - runWorkflowsFromForkPullRequests: Whether workflows triggered by pull requests from forks are allowed to run on private repositories. + /// - sendWriteTokensToWorkflows: Whether GitHub Actions can create pull requests or submit approving pull request reviews from a workflow triggered by a fork pull request. + /// - sendSecretsAndVariables: Whether to make secrets and variables available to workflows triggered by pull requests from forks. + /// - requireApprovalForForkPrWorkflows: Whether workflows triggered by pull requests from forks require approval from a repository administrator to run. + public init( + runWorkflowsFromForkPullRequests: Swift.Bool, + sendWriteTokensToWorkflows: Swift.Bool, + sendSecretsAndVariables: Swift.Bool, + requireApprovalForForkPrWorkflows: Swift.Bool + ) { + self.runWorkflowsFromForkPullRequests = runWorkflowsFromForkPullRequests + self.sendWriteTokensToWorkflows = sendWriteTokensToWorkflows + self.sendSecretsAndVariables = sendSecretsAndVariables + self.requireApprovalForForkPrWorkflows = requireApprovalForForkPrWorkflows + } + public enum CodingKeys: String, CodingKey { + case runWorkflowsFromForkPullRequests = "run_workflows_from_fork_pull_requests" + case sendWriteTokensToWorkflows = "send_write_tokens_to_workflows" + case sendSecretsAndVariables = "send_secrets_and_variables" + case requireApprovalForForkPrWorkflows = "require_approval_for_fork_pr_workflows" + } + } + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos-request`. + public struct ActionsForkPrWorkflowsPrivateReposRequest: Codable, Hashable, Sendable { + /// Whether workflows triggered by pull requests from forks are allowed to run on private repositories. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos-request/run_workflows_from_fork_pull_requests`. + public var runWorkflowsFromForkPullRequests: Swift.Bool + /// Whether GitHub Actions can create pull requests or submit approving pull request reviews from a workflow triggered by a fork pull request. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos-request/send_write_tokens_to_workflows`. + public var sendWriteTokensToWorkflows: Swift.Bool? + /// Whether to make secrets and variables available to workflows triggered by pull requests from forks. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos-request/send_secrets_and_variables`. + public var sendSecretsAndVariables: Swift.Bool? + /// Whether workflows triggered by pull requests from forks require approval from a repository administrator to run. + /// + /// - Remark: Generated from `#/components/schemas/actions-fork-pr-workflows-private-repos-request/require_approval_for_fork_pr_workflows`. + public var requireApprovalForForkPrWorkflows: Swift.Bool? + /// Creates a new `ActionsForkPrWorkflowsPrivateReposRequest`. + /// + /// - Parameters: + /// - runWorkflowsFromForkPullRequests: Whether workflows triggered by pull requests from forks are allowed to run on private repositories. + /// - sendWriteTokensToWorkflows: Whether GitHub Actions can create pull requests or submit approving pull request reviews from a workflow triggered by a fork pull request. + /// - sendSecretsAndVariables: Whether to make secrets and variables available to workflows triggered by pull requests from forks. + /// - requireApprovalForForkPrWorkflows: Whether workflows triggered by pull requests from forks require approval from a repository administrator to run. + public init( + runWorkflowsFromForkPullRequests: Swift.Bool, + sendWriteTokensToWorkflows: Swift.Bool? = nil, + sendSecretsAndVariables: Swift.Bool? = nil, + requireApprovalForForkPrWorkflows: Swift.Bool? = nil + ) { + self.runWorkflowsFromForkPullRequests = runWorkflowsFromForkPullRequests + self.sendWriteTokensToWorkflows = sendWriteTokensToWorkflows + self.sendSecretsAndVariables = sendSecretsAndVariables + self.requireApprovalForForkPrWorkflows = requireApprovalForForkPrWorkflows + } + public enum CodingKeys: String, CodingKey { + case runWorkflowsFromForkPullRequests = "run_workflows_from_fork_pull_requests" + case sendWriteTokensToWorkflows = "send_write_tokens_to_workflows" + case sendSecretsAndVariables = "send_secrets_and_variables" + case requireApprovalForForkPrWorkflows = "require_approval_for_fork_pr_workflows" + } + } + /// - Remark: Generated from `#/components/schemas/selected-actions`. + public struct SelectedActions: Codable, Hashable, Sendable { + /// Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. + /// + /// - Remark: Generated from `#/components/schemas/selected-actions/github_owned_allowed`. + public var githubOwnedAllowed: Swift.Bool? + /// Whether actions from GitHub Marketplace verified creators are allowed. Set to `true` to allow all actions by GitHub Marketplace verified creators. + /// + /// - Remark: Generated from `#/components/schemas/selected-actions/verified_allowed`. + public var verifiedAllowed: Swift.Bool? + /// Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`. + /// + /// > [!NOTE] + /// > The `patterns_allowed` setting only applies to public repositories. /// /// - Remark: Generated from `#/components/schemas/selected-actions/patterns_allowed`. public var patternsAllowed: [Swift.String]? @@ -7262,6 +8385,41 @@ public enum Components { case patternsAllowed = "patterns_allowed" } } + /// - Remark: Generated from `#/components/schemas/self-hosted-runners-settings`. + public struct SelfHostedRunnersSettings: Codable, Hashable, Sendable { + /// The policy that controls whether self-hosted runners can be used by repositories in the organization + /// + /// - Remark: Generated from `#/components/schemas/self-hosted-runners-settings/enabled_repositories`. + @frozen public enum EnabledRepositoriesPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case selected = "selected" + case none = "none" + } + /// The policy that controls whether self-hosted runners can be used by repositories in the organization + /// + /// - Remark: Generated from `#/components/schemas/self-hosted-runners-settings/enabled_repositories`. + public var enabledRepositories: Components.Schemas.SelfHostedRunnersSettings.EnabledRepositoriesPayload + /// The URL to the endpoint for managing selected repositories for self-hosted runners in the organization + /// + /// - Remark: Generated from `#/components/schemas/self-hosted-runners-settings/selected_repositories_url`. + public var selectedRepositoriesUrl: Swift.String? + /// Creates a new `SelfHostedRunnersSettings`. + /// + /// - Parameters: + /// - enabledRepositories: The policy that controls whether self-hosted runners can be used by repositories in the organization + /// - selectedRepositoriesUrl: The URL to the endpoint for managing selected repositories for self-hosted runners in the organization + public init( + enabledRepositories: Components.Schemas.SelfHostedRunnersSettings.EnabledRepositoriesPayload, + selectedRepositoriesUrl: Swift.String? = nil + ) { + self.enabledRepositories = enabledRepositories + self.selectedRepositoriesUrl = selectedRepositoriesUrl + } + public enum CodingKeys: String, CodingKey { + case enabledRepositories = "enabled_repositories" + case selectedRepositoriesUrl = "selected_repositories_url" + } + } /// The default workflow permissions granted to the GITHUB_TOKEN when running workflows. /// /// - Remark: Generated from `#/components/schemas/actions-default-workflow-permissions`. @@ -7875,6 +9033,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -7891,6 +9068,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -7904,7 +9084,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -7919,6 +9102,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -7934,6 +9120,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -8007,6 +9196,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -8025,6 +9233,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -8040,6 +9251,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -8055,6 +9269,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -8071,6 +9288,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -8690,25 +9910,31 @@ public enum Components { public var allowedActions: Components.Schemas.AllowedActions? /// - Remark: Generated from `#/components/schemas/actions-repository-permissions/selected_actions_url`. public var selectedActionsUrl: Components.Schemas.SelectedActionsUrl? + /// - Remark: Generated from `#/components/schemas/actions-repository-permissions/sha_pinning_required`. + public var shaPinningRequired: Components.Schemas.ShaPinningRequired? /// Creates a new `ActionsRepositoryPermissions`. /// /// - Parameters: /// - enabled: /// - allowedActions: /// - selectedActionsUrl: + /// - shaPinningRequired: public init( enabled: Components.Schemas.ActionsEnabled, allowedActions: Components.Schemas.AllowedActions? = nil, - selectedActionsUrl: Components.Schemas.SelectedActionsUrl? = nil + selectedActionsUrl: Components.Schemas.SelectedActionsUrl? = nil, + shaPinningRequired: Components.Schemas.ShaPinningRequired? = nil ) { self.enabled = enabled self.allowedActions = allowedActions self.selectedActionsUrl = selectedActionsUrl + self.shaPinningRequired = shaPinningRequired } public enum CodingKeys: String, CodingKey { case enabled case allowedActions = "allowed_actions" case selectedActionsUrl = "selected_actions_url" + case shaPinningRequired = "sha_pinning_required" } } /// - Remark: Generated from `#/components/schemas/actions-workflow-access-to-repository`. @@ -10278,6 +11504,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -10286,10 +11516,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repo`. public typealias Repo = Swift.String - /// The organization name. The name is not case sensitive. + /// Image definition ID of custom image /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String + /// - Remark: Generated from `#/components/parameters/actions-custom-image-definition-id`. + public typealias ActionsCustomImageDefinitionId = Swift.Int + /// Version of a custom image + /// + /// - Remark: Generated from `#/components/parameters/actions-custom-image-version`. + public typealias ActionsCustomImageVersion = Swift.String /// Unique identifier of the GitHub-hosted runner. /// /// - Remark: Generated from `#/components/parameters/hosted-runner-id`. @@ -10571,6 +11805,34 @@ public enum Components { self.body = body } } + public struct ValidationFailed: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content/application\/json`. + case json(Components.Schemas.ValidationError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailed.Body + /// Creates a new `ValidationFailed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailed.Body) { + self.body = body + } + } public struct Forbidden: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/forbidden/content`. @frozen public enum Body: Sendable, Hashable { @@ -11476,21 +12738,29 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/json/image/source`. public var source: Operations.ActionsCreateHostedRunnerForOrg.Input.Body.JsonPayload.ImagePayload.SourcePayload? + /// The version of the runner image to deploy. This is relevant only for runners using custom images. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/json/image/version`. + public var version: Swift.String? /// Creates a new `ImagePayload`. /// /// - Parameters: /// - id: The unique identifier of the runner image. /// - source: The source of the runner image. + /// - version: The version of the runner image to deploy. This is relevant only for runners using custom images. public init( id: Swift.String? = nil, - source: Operations.ActionsCreateHostedRunnerForOrg.Input.Body.JsonPayload.ImagePayload.SourcePayload? = nil + source: Operations.ActionsCreateHostedRunnerForOrg.Input.Body.JsonPayload.ImagePayload.SourcePayload? = nil, + version: Swift.String? = nil ) { self.id = id self.source = source + self.version = version } public enum CodingKeys: String, CodingKey { case id case source + case version } } /// The image of runner. To list all available images, use `GET /actions/hosted-runners/images/github-owned` or `GET /actions/hosted-runners/images/partner`. @@ -11513,6 +12783,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/json/enable_static_ip`. public var enableStaticIp: Swift.Bool? + /// Whether this runner should be used to generate custom images. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/json/image_gen`. + public var imageGen: Swift.Bool? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -11522,13 +12796,15 @@ public enum Operations { /// - runnerGroupId: The existing runner group to add this runner to. /// - 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 created with a static public IP. Note limit on account. To list limits on account, use `GET actions/hosted-runners/limits` + /// - imageGen: Whether this runner should be used to generate custom images. public init( name: Swift.String, image: Operations.ActionsCreateHostedRunnerForOrg.Input.Body.JsonPayload.ImagePayload, size: Swift.String, runnerGroupId: Swift.Int, maximumRunners: Swift.Int? = nil, - enableStaticIp: Swift.Bool? = nil + enableStaticIp: Swift.Bool? = nil, + imageGen: Swift.Bool? = nil ) { self.name = name self.image = image @@ -11536,6 +12812,7 @@ public enum Operations { self.runnerGroupId = runnerGroupId self.maximumRunners = maximumRunners self.enableStaticIp = enableStaticIp + self.imageGen = imageGen } public enum CodingKeys: String, CodingKey { case name @@ -11544,6 +12821,7 @@ public enum Operations { case runnerGroupId = "runner_group_id" case maximumRunners = "maximum_runners" case enableStaticIp = "enable_static_ip" + case imageGen = "image_gen" } } /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/POST/requestBody/content/application\/json`. @@ -11649,20 +12927,22 @@ public enum Operations { } } } - /// Get GitHub-owned images for GitHub-hosted runners in an organization + /// List custom images for an organization /// - /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. + /// List custom images for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/github-owned`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)`. - public enum ActionsGetHostedRunnersGithubOwnedImagesForOrg { - public static let id: Swift.String = "actions/get-hosted-runners-github-owned-images-for-org" + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/get(actions/list-custom-images-for-org)`. + public enum ActionsListCustomImagesForOrg { + public static let id: Swift.String = "actions/list-custom-images-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -11672,27 +12952,27 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/header`. + public var path: Operations.ActionsListCustomImagesForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Headers + public var headers: Operations.ActionsListCustomImagesForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Headers = .init() + path: Operations.ActionsListCustomImagesForOrg.Input.Path, + headers: Operations.ActionsListCustomImagesForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -11700,14 +12980,14 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/responses/200/content/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/GET/responses/200/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/responses/200/content/json/total_count`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/GET/responses/200/content/json/total_count`. public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/responses/200/content/json/images`. - public var images: [Components.Schemas.ActionsHostedRunnerImage] + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/GET/responses/200/content/json/images`. + public var images: [Components.Schemas.ActionsHostedRunnerCustomImage] /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -11715,7 +12995,7 @@ public enum Operations { /// - images: public init( totalCount: Swift.Int, - images: [Components.Schemas.ActionsHostedRunnerImage] + images: [Components.Schemas.ActionsHostedRunnerCustomImage] ) { self.totalCount = totalCount self.images = images @@ -11725,13 +13005,13 @@ public enum Operations { case images } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/responses/200/content/application\/json`. - case json(Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListCustomImagesForOrg.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body.JsonPayload { + public var json: Operations.ActionsListCustomImagesForOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -11741,26 +13021,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body + public var body: Operations.ActionsListCustomImagesForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsListCustomImagesForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/get(actions/list-custom-images-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok) + case ok(Operations.ActionsListCustomImagesForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok { + public var ok: Operations.ActionsListCustomImagesForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -11804,50 +13084,61 @@ public enum Operations { } } } - /// Get partner images for GitHub-hosted runners in an organization + /// Get a custom image definition for GitHub Actions Hosted Runners /// - /// Get the list of partner images available for GitHub-hosted runners for an organization. + /// Get a custom image definition for GitHub Actions Hosted Runners. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/partner`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/partner/get(actions/get-hosted-runners-partner-images-for-org)`. - public enum ActionsGetHostedRunnersPartnerImagesForOrg { - public static let id: Swift.String = "actions/get-hosted-runners-partner-images-for-org" + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/get(actions/get-custom-image-for-org)`. + public enum ActionsGetCustomImageForOrg { + public static let id: Swift.String = "actions/get-custom-image-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/GET/path/org`. public var org: Components.Parameters.Org + /// Image definition ID of custom image + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/GET/path/image_definition_id`. + public var imageDefinitionId: Components.Parameters.ActionsCustomImageDefinitionId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - imageDefinitionId: Image definition ID of custom image + public init( + org: Components.Parameters.Org, + imageDefinitionId: Components.Parameters.ActionsCustomImageDefinitionId + ) { self.org = org + self.imageDefinitionId = imageDefinitionId } } - public var path: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/header`. + public var path: Operations.ActionsGetCustomImageForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Headers + public var headers: Operations.ActionsGetCustomImageForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Headers = .init() + path: Operations.ActionsGetCustomImageForOrg.Input.Path, + headers: Operations.ActionsGetCustomImageForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -11855,38 +13146,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/json/images`. - public var images: [Components.Schemas.ActionsHostedRunnerImage] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - images: - public init( - totalCount: Swift.Int, - images: [Components.Schemas.ActionsHostedRunnerImage] - ) { - self.totalCount = totalCount - self.images = images - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case images - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/application\/json`. - case json(Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsHostedRunnerCustomImage) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.ActionsHostedRunnerCustomImage { get throws { switch self { case let .json(body): @@ -11896,26 +13164,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body + public var body: Operations.ActionsGetCustomImageForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsGetCustomImageForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/partner/get(actions/get-hosted-runners-partner-images-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/get(actions/get-custom-image-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok) + case ok(Operations.ActionsGetCustomImageForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok { + public var ok: Operations.ActionsGetCustomImageForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -11959,102 +13227,80 @@ public enum Operations { } } } - /// Get limits on GitHub-hosted runners for an organization + /// Delete a custom image from the organization /// - /// Get the GitHub-hosted runners limits for an organization. + /// Delete a custom image from the organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/limits`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)`. - public enum ActionsGetHostedRunnersLimitsForOrg { - public static let id: Swift.String = "actions/get-hosted-runners-limits-for-org" + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/delete(actions/delete-custom-image-from-org)`. + public enum ActionsDeleteCustomImageFromOrg { + public static let id: Swift.String = "actions/delete-custom-image-from-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/DELETE/path/org`. public var org: Components.Parameters.Org + /// Image definition ID of custom image + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/DELETE/path/image_definition_id`. + public var imageDefinitionId: Components.Parameters.ActionsCustomImageDefinitionId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - imageDefinitionId: Image definition ID of custom image + public init( + org: Components.Parameters.Org, + imageDefinitionId: Components.Parameters.ActionsCustomImageDefinitionId + ) { self.org = org + self.imageDefinitionId = imageDefinitionId } } - public var path: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Headers + public var path: Operations.ActionsDeleteCustomImageFromOrg.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: - public init( - path: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Headers = .init() - ) { + public init(path: Operations.ActionsDeleteCustomImageFromOrg.Input.Path) { self.path = path - self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsHostedRunnerLimits) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActionsHostedRunnerLimits { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/delete(actions/delete-custom-image-from-org)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsDeleteCustomImageFromOrg.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/delete(actions/delete-custom-image-from-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsDeleteCustomImageFromOrg.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } @@ -12065,76 +13311,62 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } } - /// Get GitHub-hosted runners machine specs for an organization + /// List image versions of a custom image for an organization /// - /// Get the list of machine specs available for GitHub-hosted runners for an organization. + /// List image versions of a custom image for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/machine-sizes`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/machine-sizes/get(actions/get-hosted-runners-machine-specs-for-org)`. - public enum ActionsGetHostedRunnersMachineSpecsForOrg { - public static let id: Swift.String = "actions/get-hosted-runners-machine-specs-for-org" + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/get(actions/list-custom-image-versions-for-org)`. + public enum ActionsListCustomImageVersionsForOrg { + public static let id: Swift.String = "actions/list-custom-image-versions-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/GET/path`. public struct Path: Sendable, Hashable { + /// Image definition ID of custom image + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/GET/path/image_definition_id`. + public var imageDefinitionId: Components.Parameters.ActionsCustomImageDefinitionId /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// /// - Parameters: + /// - imageDefinitionId: Image definition ID of custom image /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + public init( + imageDefinitionId: Components.Parameters.ActionsCustomImageDefinitionId, + org: Components.Parameters.Org + ) { + self.imageDefinitionId = imageDefinitionId self.org = org } } - public var path: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/header`. + public var path: Operations.ActionsListCustomImageVersionsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Headers + public var headers: Operations.ActionsListCustomImageVersionsForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Headers = .init() + path: Operations.ActionsListCustomImageVersionsForOrg.Input.Path, + headers: Operations.ActionsListCustomImageVersionsForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -12142,38 +13374,38 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/GET/responses/200/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/json/total_count`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/GET/responses/200/content/json/total_count`. public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/json/machine_specs`. - public var machineSpecs: [Components.Schemas.ActionsHostedRunnerMachineSpec] + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/GET/responses/200/content/json/image_versions`. + public var imageVersions: [Components.Schemas.ActionsHostedRunnerCustomImageVersion] /// Creates a new `JsonPayload`. /// /// - Parameters: /// - totalCount: - /// - machineSpecs: + /// - imageVersions: public init( totalCount: Swift.Int, - machineSpecs: [Components.Schemas.ActionsHostedRunnerMachineSpec] + imageVersions: [Components.Schemas.ActionsHostedRunnerCustomImageVersion] ) { self.totalCount = totalCount - self.machineSpecs = machineSpecs + self.imageVersions = imageVersions } public enum CodingKeys: String, CodingKey { case totalCount = "total_count" - case machineSpecs = "machine_specs" + case imageVersions = "image_versions" } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/application\/json`. - case json(Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListCustomImageVersionsForOrg.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body.JsonPayload { + public var json: Operations.ActionsListCustomImageVersionsForOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -12183,26 +13415,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body + public var body: Operations.ActionsListCustomImageVersionsForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsListCustomImageVersionsForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/machine-sizes/get(actions/get-hosted-runners-machine-specs-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/get(actions/list-custom-image-versions-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok) + case ok(Operations.ActionsListCustomImageVersionsForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok { + public var ok: Operations.ActionsListCustomImageVersionsForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -12246,50 +13478,68 @@ public enum Operations { } } } - /// Get platforms for GitHub-hosted runners in an organization + /// Get an image version of a custom image for GitHub Actions Hosted Runners /// - /// Get the list of platforms available for GitHub-hosted runners for an organization. + /// Get an image version of a custom image for GitHub Actions Hosted Runners. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/platforms`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/platforms/get(actions/get-hosted-runners-platforms-for-org)`. - public enum ActionsGetHostedRunnersPlatformsForOrg { - public static let id: Swift.String = "actions/get-hosted-runners-platforms-for-org" + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/get(actions/get-custom-image-version-for-org)`. + public enum ActionsGetCustomImageVersionForOrg { + public static let id: Swift.String = "actions/get-custom-image-version-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/GET/path/org`. public var org: Components.Parameters.Org + /// Image definition ID of custom image + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/GET/path/image_definition_id`. + public var imageDefinitionId: Components.Parameters.ActionsCustomImageDefinitionId + /// Version of a custom image + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/GET/path/version`. + public var version: Components.Parameters.ActionsCustomImageVersion /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - imageDefinitionId: Image definition ID of custom image + /// - version: Version of a custom image + public init( + org: Components.Parameters.Org, + imageDefinitionId: Components.Parameters.ActionsCustomImageDefinitionId, + version: Components.Parameters.ActionsCustomImageVersion + ) { self.org = org + self.imageDefinitionId = imageDefinitionId + self.version = version } } - public var path: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/header`. + public var path: Operations.ActionsGetCustomImageVersionForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Headers + public var headers: Operations.ActionsGetCustomImageVersionForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Headers = .init() + path: Operations.ActionsGetCustomImageVersionForOrg.Input.Path, + headers: Operations.ActionsGetCustomImageVersionForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -12297,38 +13547,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content/json/platforms`. - public var platforms: [Swift.String] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - platforms: - public init( - totalCount: Swift.Int, - platforms: [Swift.String] - ) { - self.totalCount = totalCount - self.platforms = platforms - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case platforms - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content/application\/json`. - case json(Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsHostedRunnerCustomImageVersion) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.ActionsHostedRunnerCustomImageVersion { get throws { switch self { case let .json(body): @@ -12338,26 +13565,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body + public var body: Operations.ActionsGetCustomImageVersionForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsGetCustomImageVersionForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/platforms/get(actions/get-hosted-runners-platforms-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/get(actions/get-custom-image-version-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok) + case ok(Operations.ActionsGetCustomImageVersionForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok { + public var ok: Operations.ActionsGetCustomImageVersionForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -12401,61 +13628,142 @@ public enum Operations { } } } - /// Get a GitHub-hosted runner for an organization + /// Delete an image version of custom image from the organization /// - /// Gets a GitHub-hosted runner configured in an organization. + /// Delete an image version of custom image from the organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-for-org)`. - public enum ActionsGetHostedRunnerForOrg { - public static let id: Swift.String = "actions/get-hosted-runner-for-org" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/delete(actions/delete-custom-image-version-from-org)`. + public enum ActionsDeleteCustomImageVersionFromOrg { + public static let id: Swift.String = "actions/delete-custom-image-version-from-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/DELETE/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the GitHub-hosted runner. + /// Image definition ID of custom image /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/path/hosted_runner_id`. - public var hostedRunnerId: Components.Parameters.HostedRunnerId + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/DELETE/path/image_definition_id`. + public var imageDefinitionId: Components.Parameters.ActionsCustomImageDefinitionId + /// Version of a custom image + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/DELETE/path/version`. + public var version: Components.Parameters.ActionsCustomImageVersion /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hostedRunnerId: Unique identifier of the GitHub-hosted runner. + /// - imageDefinitionId: Image definition ID of custom image + /// - version: Version of a custom image public init( org: Components.Parameters.Org, - hostedRunnerId: Components.Parameters.HostedRunnerId + imageDefinitionId: Components.Parameters.ActionsCustomImageDefinitionId, + version: Components.Parameters.ActionsCustomImageVersion ) { self.org = org - self.hostedRunnerId = hostedRunnerId + self.imageDefinitionId = imageDefinitionId + self.version = version } } - public var path: Operations.ActionsGetHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/header`. + public var path: Operations.ActionsDeleteCustomImageVersionFromOrg.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsDeleteCustomImageVersionFromOrg.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/delete(actions/delete-custom-image-version-from-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsDeleteCustomImageVersionFromOrg.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}/delete(actions/delete-custom-image-version-from-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsDeleteCustomImageVersionFromOrg.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Get GitHub-owned images for GitHub-hosted runners in an organization + /// + /// Get the list of GitHub-owned images available for GitHub-hosted runners for an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/github-owned`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)`. + public enum ActionsGetHostedRunnersGithubOwnedImagesForOrg { + public static let id: Swift.String = "actions/get-hosted-runners-github-owned-images-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetHostedRunnerForOrg.Input.Headers + public var headers: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsGetHostedRunnerForOrg.Input.Headers = .init() + path: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -12463,29 +13771,38 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsHostedRunner) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/responses/200/content/json/images`. + public var images: [Components.Schemas.ActionsHostedRunnerCuratedImage] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - images: + public init( + totalCount: Swift.Int, + images: [Components.Schemas.ActionsHostedRunnerCuratedImage] + ) { + self.totalCount = totalCount + self.images = images + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case images + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/github-owned/GET/responses/200/content/application\/json`. + case json(Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActionsHostedRunner { + public var json: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -12495,31 +13812,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Body + public var body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Headers = .init(), - body: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/github-owned/get(actions/get-hosted-runners-github-owned-images-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetHostedRunnerForOrg.Output.Ok) + case ok(Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetHostedRunnerForOrg.Output.Ok { + public var ok: Operations.ActionsGetHostedRunnersGithubOwnedImagesForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -12563,128 +13875,89 @@ public enum Operations { } } } - /// Update a GitHub-hosted runner for an organization + /// Get partner images for GitHub-hosted runners in an organization /// - /// Updates a GitHub-hosted runner for an organization. - /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. + /// Get the list of partner images available for GitHub-hosted runners for an organization. /// - /// - Remark: HTTP `PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)`. - public enum ActionsUpdateHostedRunnerForOrg { - public static let id: Swift.String = "actions/update-hosted-runner-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/images/partner`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/partner/get(actions/get-hosted-runners-partner-images-for-org)`. + public enum ActionsGetHostedRunnersPartnerImagesForOrg { + public static let id: Swift.String = "actions/get-hosted-runners-partner-images-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the GitHub-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/path/hosted_runner_id`. - public var hostedRunnerId: Components.Parameters.HostedRunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hostedRunnerId: Unique identifier of the GitHub-hosted runner. - public init( - org: Components.Parameters.Org, - hostedRunnerId: Components.Parameters.HostedRunnerId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.hostedRunnerId = hostedRunnerId } } - public var path: Operations.ActionsUpdateHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/header`. + public var path: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsUpdateHostedRunnerForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Name of the runner. Must be between 1 and 64 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/name`. - public var name: Swift.String? - /// The existing runner group to add this runner to. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/runner_group_id`. - public var runnerGroupId: Swift.Int? - /// The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/maximum_runners`. - public var maximumRunners: Swift.Int? - /// 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` - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/enable_static_ip`. - public var enableStaticIp: Swift.Bool? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: Name of the runner. Must be between 1 and 64 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. - /// - runnerGroupId: The existing runner group to add this runner to. - /// - 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` - public init( - name: Swift.String? = nil, - runnerGroupId: Swift.Int? = nil, - maximumRunners: Swift.Int? = nil, - enableStaticIp: Swift.Bool? = nil - ) { - self.name = name - self.runnerGroupId = runnerGroupId - self.maximumRunners = maximumRunners - self.enableStaticIp = enableStaticIp - } - public enum CodingKeys: String, CodingKey { - case name - case runnerGroupId = "runner_group_id" - case maximumRunners = "maximum_runners" - case enableStaticIp = "enable_static_ip" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.ActionsUpdateHostedRunnerForOrg.Input.Body.JsonPayload) - } - public var body: Operations.ActionsUpdateHostedRunnerForOrg.Input.Body + public var headers: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.ActionsUpdateHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsUpdateHostedRunnerForOrg.Input.Headers = .init(), - body: Operations.ActionsUpdateHostedRunnerForOrg.Input.Body + path: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsHostedRunner) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/json/images`. + public var images: [Components.Schemas.ActionsHostedRunnerCuratedImage] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - images: + public init( + totalCount: Swift.Int, + images: [Components.Schemas.ActionsHostedRunnerCuratedImage] + ) { + self.totalCount = totalCount + self.images = images + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case images + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/images/partner/GET/responses/200/content/application\/json`. + case json(Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActionsHostedRunner { + public var json: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -12694,26 +13967,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body + public var body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/images/partner/get(actions/get-hosted-runners-partner-images-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok) + case ok(Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok { + public var ok: Operations.ActionsGetHostedRunnersPartnerImagesForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -12757,75 +14030,66 @@ public enum Operations { } } } - /// Delete a GitHub-hosted runner for an organization + /// Get limits on GitHub-hosted runners for an organization /// - /// Deletes a GitHub-hosted runner for an organization. + /// Get the GitHub-hosted runners limits for an organization. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/delete(actions/delete-hosted-runner-for-org)`. - public enum ActionsDeleteHostedRunnerForOrg { - public static let id: Swift.String = "actions/delete-hosted-runner-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/limits`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)`. + public enum ActionsGetHostedRunnersLimitsForOrg { + public static let id: Swift.String = "actions/get-hosted-runners-limits-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the GitHub-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/path/hosted_runner_id`. - public var hostedRunnerId: Components.Parameters.HostedRunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hostedRunnerId: Unique identifier of the GitHub-hosted runner. - public init( - org: Components.Parameters.Org, - hostedRunnerId: Components.Parameters.HostedRunnerId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.hostedRunnerId = hostedRunnerId } } - public var path: Operations.ActionsDeleteHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/header`. + public var path: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsDeleteHostedRunnerForOrg.Input.Headers + public var headers: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsDeleteHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsDeleteHostedRunnerForOrg.Input.Headers = .init() + path: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnersLimitsForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Accepted: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/responses/202/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/responses/202/content/application\/json`. - case json(Components.Schemas.ActionsHostedRunner) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/limits/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsHostedRunnerLimits) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActionsHostedRunner { + public var json: Components.Schemas.ActionsHostedRunnerLimits { get throws { switch self { case let .json(body): @@ -12835,33 +14099,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted.Body - /// Creates a new `Accepted`. + public var body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted.Body) { + public init(body: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/delete(actions/delete-hosted-runner-for-org)/responses/202`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/limits/get(actions/get-hosted-runners-limits-for-org)/responses/200`. /// - /// HTTP response code: `202 accepted`. - case accepted(Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted) - /// The associated value of the enum case if `self` is `.accepted`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.accepted`. - /// - SeeAlso: `.accepted`. - public var accepted: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetHostedRunnersLimitsForOrg.Output.Ok { get throws { switch self { - case let .accepted(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "accepted", + expectedStatus: "ok", response: self ) } @@ -12898,22 +14162,20 @@ public enum Operations { } } } - /// Get GitHub Actions permissions for an organization - /// - /// Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. + /// Get GitHub-hosted runners machine specs for an organization /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get the list of machine specs available for GitHub-hosted runners for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/get(actions/get-github-actions-permissions-organization)`. - public enum ActionsGetGithubActionsPermissionsOrganization { - public static let id: Swift.String = "actions/get-github-actions-permissions-organization" + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/machine-sizes`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/machine-sizes/get(actions/get-hosted-runners-machine-specs-for-org)`. + public enum ActionsGetHostedRunnersMachineSpecsForOrg { + public static let id: Swift.String = "actions/get-hosted-runners-machine-specs-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -12923,27 +14185,27 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/GET/header`. + public var path: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Headers + public var headers: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Path, - headers: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Headers = .init() + path: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -12951,15 +14213,38 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsOrganizationPermissions) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/json/machine_specs`. + public var machineSpecs: [Components.Schemas.ActionsHostedRunnerMachineSpec] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - machineSpecs: + public init( + totalCount: Swift.Int, + machineSpecs: [Components.Schemas.ActionsHostedRunnerMachineSpec] + ) { + self.totalCount = totalCount + self.machineSpecs = machineSpecs + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case machineSpecs = "machine_specs" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/machine-sizes/GET/responses/200/content/application\/json`. + case json(Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActionsOrganizationPermissions { + public var json: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -12969,26 +14254,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body + public var body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body) { + public init(body: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/get(actions/get-github-actions-permissions-organization)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/machine-sizes/get(actions/get-hosted-runners-machine-specs-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok) + case ok(Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok { + public var ok: Operations.ActionsGetHostedRunnersMachineSpecsForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -13032,22 +14317,20 @@ public enum Operations { } } } - /// Set GitHub Actions permissions for an organization - /// - /// Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. + /// Get platforms for GitHub-hosted runners in an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Get the list of platforms available for GitHub-hosted runners for an organization. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)`. - public enum ActionsSetGithubActionsPermissionsOrganization { - public static let id: Swift.String = "actions/set-github-actions-permissions-organization" + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/platforms`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/platforms/get(actions/get-hosted-runners-platforms-for-org)`. + public enum ActionsGetHostedRunnersPlatformsForOrg { + public static let id: Swift.String = "actions/get-hosted-runners-platforms-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -13057,80 +14340,102 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/json/enabled_repositories`. - public var enabledRepositories: Components.Schemas.EnabledRepositories - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/json/allowed_actions`. - public var allowedActions: Components.Schemas.AllowedActions? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - enabledRepositories: - /// - allowedActions: - public init( - enabledRepositories: Components.Schemas.EnabledRepositories, - allowedActions: Components.Schemas.AllowedActions? = nil - ) { - self.enabledRepositories = enabledRepositories - self.allowedActions = allowedActions - } - public enum CodingKeys: String, CodingKey { - case enabledRepositories = "enabled_repositories" - case allowedActions = "allowed_actions" - } + public var path: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Body.JsonPayload) } - public var body: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Body + public var headers: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - body: + /// - headers: public init( - path: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Path, - body: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Body + path: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnersPlatformsForOrg.Input.Headers = .init() ) { self.path = path - self.body = body + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content/json/platforms`. + public var platforms: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - platforms: + public init( + totalCount: Swift.Int, + platforms: [Swift.String] + ) { + self.totalCount = totalCount + self.platforms = platforms + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case platforms + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/platforms/GET/responses/200/content/application\/json`. + case json(Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetGithubActionsPermissionsOrganization.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/platforms/get(actions/get-hosted-runners-platforms-for-org)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetGithubActionsPermissionsOrganization.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetHostedRunnersPlatformsForOrg.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } @@ -13141,119 +14446,117 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } - /// List selected repositories enabled for GitHub Actions in an organization + /// Get a GitHub-hosted runner for an organization /// - /// Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Gets a GitHub-hosted runner configured in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/get(actions/list-selected-repositories-enabled-github-actions-organization)`. - public enum ActionsListSelectedRepositoriesEnabledGithubActionsOrganization { - public static let id: Swift.String = "actions/list-selected-repositories-enabled-github-actions-organization" + /// - Remark: HTTP `GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-for-org)`. + public enum ActionsGetHostedRunnerForOrg { + public static let id: Swift.String = "actions/get-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/path/org`. public var org: Components.Parameters.Org + /// Unique identifier of the GitHub-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/path/hosted_runner_id`. + public var hostedRunnerId: Components.Parameters.HostedRunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." + /// - hostedRunnerId: Unique identifier of the GitHub-hosted runner. public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + org: Components.Parameters.Org, + hostedRunnerId: Components.Parameters.HostedRunnerId ) { - self.perPage = perPage - self.page = page + self.org = org + self.hostedRunnerId = hostedRunnerId } } - public var query: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/header`. + public var path: Operations.ActionsGetHostedRunnerForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Headers + public var headers: Operations.ActionsGetHostedRunnerForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path, - query: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Query = .init(), - headers: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Headers = .init() + path: Operations.ActionsGetHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsGetHostedRunnerForOrg.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Double - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content/json/repositories`. - public var repositories: [Components.Schemas.Repository] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - repositories: - public init( - totalCount: Swift.Double, - repositories: [Components.Schemas.Repository] - ) { - self.totalCount = totalCount - self.repositories = repositories - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case repositories - } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload) + } + /// Received HTTP response headers + public var headers: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsHostedRunner) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.ActionsHostedRunner { get throws { switch self { case let .json(body): @@ -13263,26 +14566,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body + public var body: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body) { + public init( + headers: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Headers = .init(), + body: Operations.ActionsGetHostedRunnerForOrg.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/get(actions/list-selected-repositories-enabled-github-actions-organization)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/get(actions/get-hosted-runner-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok) + case ok(Operations.ActionsGetHostedRunnerForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok { + public var ok: Operations.ActionsGetHostedRunnerForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -13326,100 +14634,172 @@ public enum Operations { } } } - /// Set selected repositories enabled for GitHub Actions in an organization - /// - /// Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." - /// + /// Update a GitHub-hosted runner for an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Updates a GitHub-hosted runner for an organization. + /// OAuth app tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)`. - public enum ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization { - public static let id: Swift.String = "actions/set-selected-repositories-enabled-github-actions-organization" + /// - Remark: HTTP `PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)`. + public enum ActionsUpdateHostedRunnerForOrg { + public static let id: Swift.String = "actions/update-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/path/org`. public var org: Components.Parameters.Org + /// Unique identifier of the GitHub-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/path/hosted_runner_id`. + public var hostedRunnerId: Components.Parameters.HostedRunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - hostedRunnerId: Unique identifier of the GitHub-hosted runner. + public init( + org: Components.Parameters.Org, + hostedRunnerId: Components.Parameters.HostedRunnerId + ) { self.org = org + self.hostedRunnerId = hostedRunnerId } } - public var path: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody`. + public var path: Operations.ActionsUpdateHostedRunnerForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsUpdateHostedRunnerForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// List of repository IDs to enable for GitHub Actions. + /// Name of the runner. Must be between 1 and 64 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int] + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// The existing runner group to add this runner to. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/runner_group_id`. + public var runnerGroupId: Swift.Int? + /// The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/maximum_runners`. + public var maximumRunners: Swift.Int? + /// 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` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/enable_static_ip`. + public var enableStaticIp: Swift.Bool? + /// The version of the runner image to deploy. This is relevant only for runners using custom images. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/json/image_version`. + public var imageVersion: Swift.String? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - selectedRepositoryIds: List of repository IDs to enable for GitHub Actions. - public init(selectedRepositoryIds: [Swift.Int]) { - self.selectedRepositoryIds = selectedRepositoryIds + /// - name: Name of the runner. Must be between 1 and 64 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. + /// - runnerGroupId: The existing runner group to add this runner to. + /// - 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` + /// - imageVersion: The version of the runner image to deploy. This is relevant only for runners using custom images. + public init( + name: Swift.String? = nil, + runnerGroupId: Swift.Int? = nil, + maximumRunners: Swift.Int? = nil, + enableStaticIp: Swift.Bool? = nil, + imageVersion: Swift.String? = nil + ) { + self.name = name + self.runnerGroupId = runnerGroupId + self.maximumRunners = maximumRunners + self.enableStaticIp = enableStaticIp + self.imageVersion = imageVersion } public enum CodingKeys: String, CodingKey { - case selectedRepositoryIds = "selected_repository_ids" + case name + case runnerGroupId = "runner_group_id" + case maximumRunners = "maximum_runners" + case enableStaticIp = "enable_static_ip" + case imageVersion = "image_version" } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ActionsUpdateHostedRunnerForOrg.Input.Body.JsonPayload) } - public var body: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body + public var body: Operations.ActionsUpdateHostedRunnerForOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - headers: /// - body: public init( - path: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path, - body: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body + path: Operations.ActionsUpdateHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsUpdateHostedRunnerForOrg.Input.Headers = .init(), + body: Operations.ActionsUpdateHostedRunnerForOrg.Input.Body ) { self.path = path + self.headers = headers self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsHostedRunner) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ActionsHostedRunner { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/patch(actions/update-hosted-runner-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsUpdateHostedRunnerForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } @@ -13430,81 +14810,137 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } - /// Enable a selected repository for GitHub Actions in an organization - /// - /// Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Delete a GitHub-hosted runner for an organization /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Deletes a GitHub-hosted runner for an organization. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)`. - public enum ActionsEnableSelectedRepositoryGithubActionsOrganization { - public static let id: Swift.String = "actions/enable-selected-repository-github-actions-organization" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/delete(actions/delete-hosted-runner-for-org)`. + public enum ActionsDeleteHostedRunnerForOrg { + public static let id: Swift.String = "actions/delete-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the repository. + /// Unique identifier of the GitHub-hosted runner. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/PUT/path/repository_id`. - public var repositoryId: Components.Parameters.RepositoryId + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/path/hosted_runner_id`. + public var hostedRunnerId: Components.Parameters.HostedRunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - repositoryId: The unique identifier of the repository. + /// - hostedRunnerId: Unique identifier of the GitHub-hosted runner. public init( org: Components.Parameters.Org, - repositoryId: Components.Parameters.RepositoryId + hostedRunnerId: Components.Parameters.HostedRunnerId ) { self.org = org - self.repositoryId = repositoryId + self.hostedRunnerId = hostedRunnerId } } - public var path: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input.Path + public var path: Operations.ActionsDeleteHostedRunnerForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsDeleteHostedRunnerForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input.Path) { + /// - headers: + public init( + path: Operations.ActionsDeleteHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsDeleteHostedRunnerForOrg.Input.Headers = .init() + ) { self.path = path + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Accepted: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/responses/202/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/hosted-runners/{hosted_runner_id}/DELETE/responses/202/content/application\/json`. + case json(Components.Schemas.ActionsHostedRunner) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ActionsHostedRunner { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted.Body + /// Creates a new `Accepted`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/hosted-runners/{hosted_runner_id}/delete(actions/delete-hosted-runner-for-org)/responses/202`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `202 accepted`. + case accepted(Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted) + /// The associated value of the enum case if `self` is `.accepted`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output.NoContent { + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Operations.ActionsDeleteHostedRunnerForOrg.Output.Accepted { get throws { switch self { - case let .noContent(response): + case let .accepted(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "accepted", response: self ) } @@ -13515,154 +14951,94 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } - /// Disable a selected repository for GitHub Actions in an organization + /// Get GitHub Actions permissions for an organization /// - /// Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. /// /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)`. - public enum ActionsDisableSelectedRepositoryGithubActionsOrganization { - public static let id: Swift.String = "actions/disable-selected-repository-github-actions-organization" + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/get(actions/get-github-actions-permissions-organization)`. + public enum ActionsGetGithubActionsPermissionsOrganization { + public static let id: Swift.String = "actions/get-github-actions-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/GET/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the repository. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/DELETE/path/repository_id`. - public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - repositoryId: The unique identifier of the repository. - public init( - org: Components.Parameters.Org, - repositoryId: Components.Parameters.RepositoryId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.repositoryId = repositoryId } } - public var path: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input.Path + public var path: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input.Path) { + /// - headers: + public init( + path: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Path, + headers: Operations.ActionsGetGithubActionsPermissionsOrganization.Input.Headers = .init() + ) { self.path = path - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// Get allowed actions and reusable workflows for an organization - /// - /// Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." - /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/selected-actions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/get(actions/get-allowed-actions-organization)`. - public enum ActionsGetAllowedActionsOrganization { - public static let id: Swift.String = "actions/get-allowed-actions-organization" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/path/org`. - public var org: Components.Parameters.Org - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.ActionsGetAllowedActionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ActionsGetAllowedActionsOrganization.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ActionsGetAllowedActionsOrganization.Input.Path, - headers: Operations.ActionsGetAllowedActionsOrganization.Input.Headers = .init() - ) { - self.path = path - self.headers = headers + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/responses/200/content/application\/json`. - case json(Components.Schemas.SelectedActions) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsOrganizationPermissions) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.SelectedActions { + public var json: Components.Schemas.ActionsOrganizationPermissions { get throws { switch self { case let .json(body): @@ -13672,26 +15048,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetAllowedActionsOrganization.Output.Ok.Body + public var body: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetAllowedActionsOrganization.Output.Ok.Body) { + public init(body: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/get(actions/get-allowed-actions-organization)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/get(actions/get-github-actions-permissions-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetAllowedActionsOrganization.Output.Ok) + case ok(Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetAllowedActionsOrganization.Output.Ok { + public var ok: Operations.ActionsGetGithubActionsPermissionsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -13735,22 +15111,22 @@ public enum Operations { } } } - /// Set allowed actions and reusable workflows for an organization + /// Set GitHub Actions permissions for an organization /// - /// Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + /// Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/selected-actions`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)`. - public enum ActionsSetAllowedActionsOrganization { - public static let id: Swift.String = "actions/set-allowed-actions-organization" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)`. + public enum ActionsSetGithubActionsPermissionsOrganization { + public static let id: Swift.String = "actions/set-github-actions-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -13760,21 +15136,50 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsSetAllowedActionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/PUT/requestBody`. + public var path: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/PUT/requestBody/content/application\/json`. - case json(Components.Schemas.SelectedActions) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/json/enabled_repositories`. + public var enabledRepositories: Components.Schemas.EnabledRepositories + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/json/allowed_actions`. + public var allowedActions: Components.Schemas.AllowedActions? + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/json/sha_pinning_required`. + public var shaPinningRequired: Components.Schemas.ShaPinningRequired? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enabledRepositories: + /// - allowedActions: + /// - shaPinningRequired: + public init( + enabledRepositories: Components.Schemas.EnabledRepositories, + allowedActions: Components.Schemas.AllowedActions? = nil, + shaPinningRequired: Components.Schemas.ShaPinningRequired? = nil + ) { + self.enabledRepositories = enabledRepositories + self.allowedActions = allowedActions + self.shaPinningRequired = shaPinningRequired + } + public enum CodingKeys: String, CodingKey { + case enabledRepositories = "enabled_repositories" + case allowedActions = "allowed_actions" + case shaPinningRequired = "sha_pinning_required" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Body.JsonPayload) } - public var body: Operations.ActionsSetAllowedActionsOrganization.Input.Body? + public var body: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - body: public init( - path: Operations.ActionsSetAllowedActionsOrganization.Input.Path, - body: Operations.ActionsSetAllowedActionsOrganization.Input.Body? = nil + path: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Path, + body: Operations.ActionsSetGithubActionsPermissionsOrganization.Input.Body ) { self.path = path self.body = body @@ -13787,13 +15192,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetAllowedActionsOrganization.Output.NoContent) + case noContent(Operations.ActionsSetGithubActionsPermissionsOrganization.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/put(actions/set-github-actions-permissions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -13803,7 +15208,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetAllowedActionsOrganization.Output.NoContent { + public var noContent: Operations.ActionsSetGithubActionsPermissionsOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -13822,24 +15227,22 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// Get default workflow permissions for an organization + /// Get artifact and log retention settings for an organization /// - /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, - /// as well as whether GitHub Actions can submit approving pull request reviews. For more information, see - /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." + /// Gets artifact and log retention settings for an organization. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/workflow`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-organization)`. - public enum ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization { - public static let id: Swift.String = "actions/get-github-actions-default-workflow-permissions-organization" + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-organization)`. + public enum ActionsGetArtifactAndLogRetentionSettingsOrganization { + public static let id: Swift.String = "actions/get-artifact-and-log-retention-settings-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/artifact-and-log-retention/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/artifact-and-log-retention/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -13849,27 +15252,27 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/header`. + public var path: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/artifact-and-log-retention/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Headers + public var headers: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path, - headers: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Headers = .init() + path: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Path, + headers: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -13877,15 +15280,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/artifact-and-log-retention/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsGetDefaultWorkflowPermissions) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/artifact-and-log-retention/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsArtifactAndLogRetentionResponse) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActionsGetDefaultWorkflowPermissions { + public var json: Components.Schemas.ActionsArtifactAndLogRetentionResponse { get throws { switch self { case let .json(body): @@ -13895,26 +15298,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok.Body + public var body: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok.Body) { + public init(body: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-organization)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok) + case ok(Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok { + public var ok: Operations.ActionsGetArtifactAndLogRetentionSettingsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -13927,6 +15330,52 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-organization)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -13958,24 +15407,22 @@ public enum Operations { } } } - /// Set default workflow permissions for an organization + /// Set artifact and log retention settings for an organization /// - /// Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actions - /// can submit approving pull request reviews. For more information, see - /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." + /// Sets artifact and log retention settings for an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/workflow`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)`. - public enum ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization { - public static let id: Swift.String = "actions/set-github-actions-default-workflow-permissions-organization" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)`. + public enum ActionsSetArtifactAndLogRetentionSettingsOrganization { + public static let id: Swift.String = "actions/set-artifact-and-log-retention-settings-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/artifact-and-log-retention/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/artifact-and-log-retention/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -13985,23 +15432,38 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/PUT/requestBody/content/application\/json`. - case json(Components.Schemas.ActionsSetDefaultWorkflowPermissions) - } - public var body: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Body? - /// Creates a new `Input`. + public var path: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/artifact-and-log-retention/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/artifact-and-log-retention/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/artifact-and-log-retention/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsArtifactAndLogRetention) + } + public var body: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Body + /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - headers: /// - body: public init( - path: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path, - body: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Body? = nil + path: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Path, + headers: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Input.Body ) { self.path = path + self.headers = headers self.body = body } } @@ -14010,15 +15472,15 @@ public enum Operations { /// Creates a new `NoContent`. public init() {} } - /// Success response + /// No content /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Output.NoContent) - /// Success response + case noContent(Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Output.NoContent) + /// No content /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -14028,7 +15490,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Output.NoContent { + public var noContent: Operations.ActionsSetArtifactAndLogRetentionSettingsOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -14041,28 +15503,145 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-organization)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } - /// List self-hosted runner groups for an organization + /// Get fork PR contributor approval permissions for an organization /// - /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. + /// Gets the fork PR contributor approval policy for an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)`. - public enum ActionsListSelfHostedRunnerGroupsForOrg { - public static let id: Swift.String = "actions/list-self-hosted-runner-groups-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-organization)`. + public enum ActionsGetForkPrContributorApprovalPermissionsOrganization { + public static let id: Swift.String = "actions/get-fork-pr-contributor-approval-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-contributor-approval/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-contributor-approval/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -14072,100 +15651,43 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query/page`. - public var page: Components.Parameters.Page? - /// Only return runner groups that are allowed to be used by this repository. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query/visible_to_repository`. - public var visibleToRepository: Components.Parameters.VisibleToRepository? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." - /// - visibleToRepository: Only return runner groups that are allowed to be used by this repository. - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil, - visibleToRepository: Components.Parameters.VisibleToRepository? = nil - ) { - self.perPage = perPage - self.page = page - self.visibleToRepository = visibleToRepository - } - } - public var query: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/header`. + public var path: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-contributor-approval/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Headers + public var headers: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Path, - query: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Query = .init(), - headers: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Headers = .init() + path: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Path, + headers: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-contributor-approval/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Double - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/json/runner_groups`. - public var runnerGroups: [Components.Schemas.RunnerGroupsOrg] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - runnerGroups: - public init( - totalCount: Swift.Double, - runnerGroups: [Components.Schemas.RunnerGroupsOrg] - ) { - self.totalCount = totalCount - self.runnerGroups = runnerGroups - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case runnerGroups = "runner_groups" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-contributor-approval/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsForkPrContributorApproval) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.ActionsForkPrContributorApproval { get throws { switch self { case let .json(body): @@ -14175,26 +15697,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body + public var body: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok) + case ok(Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok { + public var ok: Operations.ActionsGetForkPrContributorApprovalPermissionsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -14207,6 +15729,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -14238,22 +15783,22 @@ public enum Operations { } } } - /// Create a self-hosted runner group for an organization + /// Set fork PR contributor approval permissions for an organization /// - /// Creates a new self-hosted runner group for an organization. + /// Sets the fork PR contributor approval policy for an organization. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runner-groups`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)`. - public enum ActionsCreateSelfHostedRunnerGroupForOrg { - public static let id: Swift.String = "actions/create-self-hosted-runner-group-for-org" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)`. + public enum ActionsSetForkPrContributorApprovalPermissionsOrganization { + public static let id: Swift.String = "actions/set-fork-pr-contributor-approval-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-contributor-approval/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-contributor-approval/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -14263,108 +15808,25 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/header`. + public var path: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-contributor-approval/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody`. + public var headers: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-contributor-approval/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Name of the runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/name`. - public var name: Swift.String - /// Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/visibility`. - @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { - case selected = "selected" - case all = "all" - case _private = "private" - } - /// Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/visibility`. - public var visibility: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? - /// List of repository IDs that can access the runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int]? - /// List of runner IDs to add to the runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/runners`. - public var runners: [Swift.Int]? - /// Whether the runner group can be used by `public` repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/allows_public_repositories`. - public var allowsPublicRepositories: Swift.Bool? - /// If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/restricted_to_workflows`. - public var restrictedToWorkflows: Swift.Bool? - /// List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/selected_workflows`. - public var selectedWorkflows: [Swift.String]? - /// The identifier of a hosted compute network configuration. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/network_configuration_id`. - public var networkConfigurationId: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: Name of the runner group. - /// - visibility: Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. - /// - selectedRepositoryIds: List of repository IDs that can access the runner group. - /// - runners: List of runner IDs to add to the runner group. - /// - allowsPublicRepositories: Whether the runner group can be used by `public` repositories. - /// - restrictedToWorkflows: If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. - /// - selectedWorkflows: List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. - /// - networkConfigurationId: The identifier of a hosted compute network configuration. - public init( - name: Swift.String, - visibility: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? = nil, - selectedRepositoryIds: [Swift.Int]? = nil, - runners: [Swift.Int]? = nil, - allowsPublicRepositories: Swift.Bool? = nil, - restrictedToWorkflows: Swift.Bool? = nil, - selectedWorkflows: [Swift.String]? = nil, - networkConfigurationId: Swift.String? = nil - ) { - self.name = name - self.visibility = visibility - self.selectedRepositoryIds = selectedRepositoryIds - self.runners = runners - self.allowsPublicRepositories = allowsPublicRepositories - self.restrictedToWorkflows = restrictedToWorkflows - self.selectedWorkflows = selectedWorkflows - self.networkConfigurationId = networkConfigurationId - } - public enum CodingKeys: String, CodingKey { - case name - case visibility - case selectedRepositoryIds = "selected_repository_ids" - case runners - case allowsPublicRepositories = "allows_public_repositories" - case restrictedToWorkflows = "restricted_to_workflows" - case selectedWorkflows = "selected_workflows" - case networkConfigurationId = "network_configuration_id" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/content/application\/json`. - case json(Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-contributor-approval/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsForkPrContributorApproval) } - public var body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body + public var body: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -14372,9 +15834,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Path, - headers: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Headers = .init(), - body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body + path: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Path, + headers: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Input.Body ) { self.path = path self.headers = headers @@ -14382,52 +15844,82 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/responses/201/content/application\/json`. - case json(Components.Schemas.RunnerGroupsOrg) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.RunnerGroupsOrg { - get throws { - switch self { - case let .json(body): - return body - } - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsSetForkPrContributorApprovalPermissionsOrganization.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created.Body) { - self.body = body + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } } } - /// Response + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-organization)/responses/422`. /// - /// HTTP response code: `201 created`. - case created(Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .created(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "unprocessableContent", response: self ) } @@ -14464,61 +15956,50 @@ public enum Operations { } } } - /// Get a self-hosted runner group for an organization + /// Get private repo fork PR workflow settings for an organization /// - /// Gets a specific self-hosted runner group for an organization. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Gets the settings for whether workflows from fork pull requests can run on private repositories in an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)`. - public enum ActionsGetSelfHostedRunnerGroupForOrg { - public static let id: Swift.String = "actions/get-self-hosted-runner-group-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-organization)`. + public enum ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization { + public static let id: Swift.String = "actions/get-private-repo-fork-pr-workflows-settings-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId } } - public var path: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/header`. + public var path: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input.Headers + public var headers: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input.Path, - headers: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input.Headers = .init() + path: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path, + headers: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -14526,15 +16007,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.RunnerGroupsOrg) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsForkPrWorkflowsPrivateRepos) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.RunnerGroupsOrg { + public var json: Components.Schemas.ActionsForkPrWorkflowsPrivateRepos { get throws { switch self { case let .json(body): @@ -14544,26 +16025,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok.Body + public var body: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok) + case ok(Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok { + public var ok: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -14576,6 +16057,52 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-organization)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -14607,126 +16134,48 @@ public enum Operations { } } } - /// Update a self-hosted runner group for an organization - /// - /// Updates the `name` and `visibility` of a self-hosted runner group in an organization. + /// Set private repo fork PR workflow settings for an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Sets the settings for whether workflows from fork pull requests can run on private repositories in an organization. /// - /// - Remark: HTTP `PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)`. - public enum ActionsUpdateSelfHostedRunnerGroupForOrg { - public static let id: Swift.String = "actions/update-self-hosted-runner-group-for-org" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)`. + public enum ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization { + public static let id: Swift.String = "actions/set-private-repo-fork-pr-workflows-settings-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId } } - public var path: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/header`. + public var path: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody`. + public var headers: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Name of the runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/name`. - public var name: Swift.String - /// Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/visibility`. - @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { - case selected = "selected" - case all = "all" - case _private = "private" - } - /// Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/visibility`. - public var visibility: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? - /// Whether the runner group can be used by `public` repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/allows_public_repositories`. - public var allowsPublicRepositories: Swift.Bool? - /// If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/restricted_to_workflows`. - public var restrictedToWorkflows: Swift.Bool? - /// List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/selected_workflows`. - public var selectedWorkflows: [Swift.String]? - /// The identifier of a hosted compute network configuration. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/network_configuration_id`. - public var networkConfigurationId: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: Name of the runner group. - /// - visibility: Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. - /// - allowsPublicRepositories: Whether the runner group can be used by `public` repositories. - /// - restrictedToWorkflows: If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. - /// - selectedWorkflows: List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. - /// - networkConfigurationId: The identifier of a hosted compute network configuration. - public init( - name: Swift.String, - visibility: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? = nil, - allowsPublicRepositories: Swift.Bool? = nil, - restrictedToWorkflows: Swift.Bool? = nil, - selectedWorkflows: [Swift.String]? = nil, - networkConfigurationId: Swift.String? = nil - ) { - self.name = name - self.visibility = visibility - self.allowsPublicRepositories = allowsPublicRepositories - self.restrictedToWorkflows = restrictedToWorkflows - self.selectedWorkflows = selectedWorkflows - self.networkConfigurationId = networkConfigurationId - } - public enum CodingKeys: String, CodingKey { - case name - case visibility - case allowsPublicRepositories = "allows_public_repositories" - case restrictedToWorkflows = "restricted_to_workflows" - case selectedWorkflows = "selected_workflows" - case networkConfigurationId = "network_configuration_id" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsForkPrWorkflowsPrivateReposRequest) } - public var body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body + public var body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -14734,9 +16183,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Path, - headers: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Headers = .init(), - body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body + path: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Path, + headers: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Input.Body ) { self.path = path self.headers = headers @@ -14744,16 +16193,51 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/responses/200/content`. + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Empty response for successful settings update + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.NoContent) + /// Empty response for successful settings update + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/responses/403/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.RunnerGroupsOrg) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/PUT/responses/403/content/application\/json`. + case json(Components.Schemas.BasicError) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.RunnerGroupsOrg { + public var json: Components.Schemas.BasicError { get throws { switch self { case let .json(body): @@ -14763,33 +16247,79 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden.Body + /// Creates a new `Forbidden`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden.Body) { self.body = body } } - /// Response + /// Forbidden - Fork PR workflow settings for private repositories are managed by the enterprise owner /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)/responses/403`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsOrganization.Output.Forbidden { get throws { switch self { - case let .ok(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-organization)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", response: self ) } @@ -14826,162 +16356,68 @@ public enum Operations { } } } - /// Delete a self-hosted runner group from an organization + /// List selected repositories enabled for GitHub Actions in an organization /// - /// Deletes a self-hosted runner group for an organization. + /// Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)`. - public enum ActionsDeleteSelfHostedRunnerGroupFromOrg { - public static let id: Swift.String = "actions/delete-self-hosted-runner-group-from-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/get(actions/list-selected-repositories-enabled-github-actions-organization)`. + public enum ActionsListSelectedRepositoriesEnabledGithubActionsOrganization { + public static let id: Swift.String = "actions/list-selected-repositories-enabled-github-actions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/DELETE/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId } } - public var path: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Input.Path) { - self.path = path + public var path: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// List GitHub-hosted runners in a group for an organization - /// - /// Lists the GitHub-hosted runners in an organization group. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/get(actions/list-github-hosted-runners-in-group-for-org)`. - public enum ActionsListGithubHostedRunnersInGroupForOrg { - public static let id: Swift.String = "actions/list-github-hosted-runners-in-group-for-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/path/org`. - public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId - ) { - self.org = org - self.runnerGroupId = runnerGroupId - } - } - public var path: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page - } - } - public var query: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/header`. + public var query: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Headers + public var headers: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -14989,9 +16425,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Path, - query: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Query = .init(), - headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Headers = .init() + path: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path, + query: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Query = .init(), + headers: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Input.Headers = .init() ) { self.path = path self.query = query @@ -15000,52 +16436,38 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/content/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/content/json/total_count`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content/json/total_count`. public var totalCount: Swift.Double - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/content/json/runners`. - public var runners: [Components.Schemas.ActionsHostedRunner] + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content/json/repositories`. + public var repositories: [Components.Schemas.Repository] /// Creates a new `JsonPayload`. /// /// - Parameters: /// - totalCount: - /// - runners: + /// - repositories: public init( totalCount: Swift.Double, - runners: [Components.Schemas.ActionsHostedRunner] + repositories: [Components.Schemas.Repository] ) { self.totalCount = totalCount - self.runners = runners + self.repositories = repositories } public enum CodingKeys: String, CodingKey { case totalCount = "total_count" - case runners + case repositories } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload { + public var json: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -15055,31 +16477,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body + public var body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Headers = .init(), - body: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/get(actions/list-github-hosted-runners-in-group-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/get(actions/list-selected-repositories-enabled-github-actions-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok) + case ok(Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok { + public var ok: Operations.ActionsListSelectedRepositoriesEnabledGithubActionsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -15123,163 +16540,100 @@ public enum Operations { } } } - /// List repository access to a self-hosted runner group in an organization + /// Set selected repositories enabled for GitHub Actions in an organization + /// + /// Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// Lists the repositories with access to a self-hosted runner group configured in an organization. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)`. - public enum ActionsListRepoAccessToSelfHostedRunnerGroupInOrg { - public static let id: Swift.String = "actions/list-repo-access-to-self-hosted-runner-group-in-org" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)`. + public enum ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization { + public static let id: Swift.String = "actions/set-selected-repositories-enabled-github-actions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId - } - } - public var path: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/query`. - public struct Query: Sendable, Hashable { - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/query/page`. - public var page: Components.Parameters.Page? - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - page: The page number of the results to fetch. 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)." - /// - perPage: The number of results per page (max 100). 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)." - public init( - page: Components.Parameters.Page? = nil, - perPage: Components.Parameters.PerPage? = nil - ) { - self.page = page - self.perPage = perPage } } - public var query: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + public var path: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// List of repository IDs to enable for GitHub Actions. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedRepositoryIds: List of repository IDs to enable for GitHub Actions. + public init(selectedRepositoryIds: [Swift.Int]) { + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case selectedRepositoryIds = "selected_repository_ids" + } } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body.JsonPayload) } - public var headers: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Headers + public var body: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: - /// - headers: + /// - body: public init( - path: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path, - query: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Query = .init(), - headers: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Headers = .init() + path: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Path, + body: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Input.Body ) { self.path = path - self.query = query - self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Double - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/json/repositories`. - public var repositories: [Components.Schemas.MinimalRepository] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - repositories: - public init( - totalCount: Swift.Double, - repositories: [Components.Schemas.MinimalRepository] - ) { - self.totalCount = totalCount - self.repositories = repositories - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case repositories - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/put(actions/set-selected-repositories-enabled-github-actions-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsSetSelectedRepositoriesEnabledGithubActionsOrganization.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } @@ -15290,101 +16644,48 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } } - /// Set repository access for a self-hosted runner group in an organization + /// Enable a selected repository for GitHub Actions in an organization /// - /// Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. + /// Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)`. - public enum ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg { - public static let id: Swift.String = "actions/set-repo-access-to-self-hosted-runner-group-in-org" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)`. + public enum ActionsEnableSelectedRepositoryGithubActionsOrganization { + public static let id: Swift.String = "actions/enable-selected-repository-github-actions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/PUT/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. + /// The unique identifier of the repository. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/PUT/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. + /// - repositoryId: The unique identifier of the repository. public init( org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId + repositoryId: Components.Parameters.RepositoryId ) { self.org = org - self.runnerGroupId = runnerGroupId - } - } - public var path: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// List of repository IDs that can access the runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - selectedRepositoryIds: List of repository IDs that can access the runner group. - public init(selectedRepositoryIds: [Swift.Int]) { - self.selectedRepositoryIds = selectedRepositoryIds - } - public enum CodingKeys: String, CodingKey { - case selectedRepositoryIds = "selected_repository_ids" - } + self.repositoryId = repositoryId } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Body.JsonPayload) } - public var body: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Body + public var path: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - body: - public init( - path: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path, - body: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Body - ) { + public init(path: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Input.Path) { self.path = path - self.body = body } } @frozen public enum Output: Sendable, Hashable { @@ -15394,13 +16695,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent) + case noContent(Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/put(actions/enable-selected-repository-github-actions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -15410,7 +16711,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent { + public var noContent: Operations.ActionsEnableSelectedRepositoryGithubActionsOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -15429,53 +16730,46 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// Add repository access to a self-hosted runner group in an organization + /// Disable a selected repository for GitHub Actions in an organization /// - /// Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)`. - public enum ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg { - public static let id: Swift.String = "actions/add-repo-access-to-self-hosted-runner-group-in-org" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)`. + public enum ActionsDisableSelectedRepositoryGithubActionsOrganization { + public static let id: Swift.String = "actions/disable-selected-repository-github-actions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId /// The unique identifier of the repository. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path/repository_id`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/repositories/{repository_id}/DELETE/path/repository_id`. public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. /// - repositoryId: The unique identifier of the repository. public init( org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId, repositoryId: Components.Parameters.RepositoryId ) { self.org = org - self.runnerGroupId = runnerGroupId self.repositoryId = repositoryId } } - public var path: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path + public var path: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path) { + public init(path: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Input.Path) { self.path = path } } @@ -15486,13 +16780,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent) + case noContent(Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/repositories/{repository_id}/delete(actions/disable-selected-repository-github-actions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -15502,7 +16796,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent { + public var noContent: Operations.ActionsDisableSelectedRepositoryGithubActionsOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -15521,233 +16815,68 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// Remove repository access to a self-hosted runner group in an organization + /// Get allowed actions and reusable workflows for an organization /// - /// Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + /// Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)`. - public enum ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg { - public static let id: Swift.String = "actions/remove-repo-access-to-self-hosted-runner-group-in-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/selected-actions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/get(actions/get-allowed-actions-organization)`. + public enum ActionsGetAllowedActionsOrganization { + public static let id: Swift.String = "actions/get-allowed-actions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId - /// The unique identifier of the repository. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path/repository_id`. - public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - /// - repositoryId: The unique identifier of the repository. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId, - repositoryId: Components.Parameters.RepositoryId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId - self.repositoryId = repositoryId } } - public var path: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path) { - self.path = path - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// List self-hosted runners in a group for an organization - /// - /// Lists self-hosted runners that are in a specific organization group. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)`. - public enum ActionsListSelfHostedRunnersInGroupForOrg { - public static let id: Swift.String = "actions/list-self-hosted-runners-in-group-for-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/path/org`. - public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId - ) { - self.org = org - self.runnerGroupId = runnerGroupId - } - } - public var path: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page - } - } - public var query: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/header`. + public var path: Operations.ActionsGetAllowedActionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Headers + public var headers: Operations.ActionsGetAllowedActionsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Path, - query: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Query = .init(), - headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Headers = .init() + path: Operations.ActionsGetAllowedActionsOrganization.Input.Path, + headers: Operations.ActionsGetAllowedActionsOrganization.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Double - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/json/runners`. - public var runners: [Components.Schemas.Runner] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - runners: - public init( - totalCount: Swift.Double, - runners: [Components.Schemas.Runner] - ) { - self.totalCount = totalCount - self.runners = runners - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case runners - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/GET/responses/200/content/application\/json`. + case json(Components.Schemas.SelectedActions) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.SelectedActions { get throws { switch self { case let .json(body): @@ -15757,31 +16886,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body + public var body: Operations.ActionsGetAllowedActionsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Headers = .init(), - body: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ActionsGetAllowedActionsOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/get(actions/get-allowed-actions-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok) + case ok(Operations.ActionsGetAllowedActionsOrganization.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok { + public var ok: Operations.ActionsGetAllowedActionsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -15825,72 +16949,46 @@ public enum Operations { } } } - /// Set self-hosted runners in a group for an organization + /// Set allowed actions and reusable workflows for an organization /// - /// Replaces the list of self-hosted runners that are part of an organization runner group. + /// Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)`. - public enum ActionsSetSelfHostedRunnersInGroupForOrg { - public static let id: Swift.String = "actions/set-self-hosted-runners-in-group-for-org" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/selected-actions`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)`. + public enum ActionsSetAllowedActionsOrganization { + public static let id: Swift.String = "actions/set-allowed-actions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/PUT/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId } } - public var path: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody`. + public var path: Operations.ActionsSetAllowedActionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// List of runner IDs to add to the runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody/json/runners`. - public var runners: [Swift.Int] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - runners: List of runner IDs to add to the runner group. - public init(runners: [Swift.Int]) { - self.runners = runners - } - public enum CodingKeys: String, CodingKey { - case runners - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/selected-actions/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.SelectedActions) } - public var body: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Body + public var body: Operations.ActionsSetAllowedActionsOrganization.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - body: public init( - path: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Path, - body: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Body + path: Operations.ActionsSetAllowedActionsOrganization.Input.Path, + body: Operations.ActionsSetAllowedActionsOrganization.Input.Body? = nil ) { self.path = path self.body = body @@ -15903,13 +17001,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Output.NoContent) + case noContent(Operations.ActionsSetAllowedActionsOrganization.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/selected-actions/put(actions/set-allowed-actions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -15919,7 +17017,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Output.NoContent { + public var noContent: Operations.ActionsSetAllowedActionsOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -15938,87 +17036,150 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// Add a self-hosted runner to a group for an organization + /// Get self-hosted runners settings for an organization /// - /// Adds a self-hosted runner to a runner group configured in an organization. + /// Gets the settings for self-hosted runners for an organization. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)`. - public enum ActionsAddSelfHostedRunnerToGroupForOrg { - public static let id: Swift.String = "actions/add-self-hosted-runner-to-group-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)`. + public enum ActionsGetSelfHostedRunnersPermissionsOrganization { + public static let id: Swift.String = "actions/get-self-hosted-runners-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId - /// Unique identifier of the self-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - /// - runnerId: Unique identifier of the self-hosted runner. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId, - runnerId: Components.Parameters.RunnerId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId - self.runnerId = runnerId } } - public var path: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Input.Path + public var path: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Input.Path) { + /// - headers: + public init( + path: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Path, + headers: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Input.Headers = .init() + ) { self.path = path + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/GET/responses/200/content/application\/json`. + case json(Components.Schemas.SelfHostedRunnersSettings) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.SelfHostedRunnersSettings { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)/responses/200`. /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Output.NoContent) - /// Response + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)/responses/204`. + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetSelfHostedRunnersPermissionsOrganization.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } } - /// The associated value of the enum case if `self` is `.noContent`. + /// Resource not found /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Output.NoContent { + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/get(actions/get-self-hosted-runners-permissions-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .noContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "notFound", response: self ) } @@ -16029,55 +17190,115 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } - /// Remove a self-hosted runner from a group for an organization + /// Set self-hosted runners settings for an organization /// - /// Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. + /// Sets the settings for self-hosted runners for an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)`. - public enum ActionsRemoveSelfHostedRunnerFromGroupForOrg { - public static let id: Swift.String = "actions/remove-self-hosted-runner-from-group-for-org" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/self-hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)`. + public enum ActionsSetSelfHostedRunnersPermissionsOrganization { + public static let id: Swift.String = "actions/set-self-hosted-runners-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/PUT/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner group. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path/runner_group_id`. - public var runnerGroupId: Components.Parameters.RunnerGroupId - /// Unique identifier of the self-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerGroupId: Unique identifier of the self-hosted runner group. - /// - runnerId: Unique identifier of the self-hosted runner. - public init( - org: Components.Parameters.Org, - runnerGroupId: Components.Parameters.RunnerGroupId, - runnerId: Components.Parameters.RunnerId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerGroupId = runnerGroupId - self.runnerId = runnerId } } - public var path: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Input.Path + public var path: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The policy that controls whether self-hosted runners can be used in the organization + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/PUT/requestBody/json/enabled_repositories`. + @frozen public enum EnabledRepositoriesPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case selected = "selected" + case none = "none" + } + /// The policy that controls whether self-hosted runners can be used in the organization + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/PUT/requestBody/json/enabled_repositories`. + public var enabledRepositories: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Body.JsonPayload.EnabledRepositoriesPayload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enabledRepositories: The policy that controls whether self-hosted runners can be used in the organization + public init(enabledRepositories: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Body.JsonPayload.EnabledRepositoriesPayload) { + self.enabledRepositories = enabledRepositories + } + public enum CodingKeys: String, CodingKey { + case enabledRepositories = "enabled_repositories" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Body.JsonPayload) + } + public var body: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Input.Path) { + /// - headers: + /// - body: + public init( + path: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Path, + headers: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Headers = .init(), + body: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Input.Body + ) { self.path = path + self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { @@ -16085,15 +17306,15 @@ public enum Operations { /// Creates a new `NoContent`. public init() {} } - /// Response + /// No content /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Output.NoContent) - /// Response + case noContent(Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Output.NoContent) + /// No content /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -16103,7 +17324,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Output.NoContent { + public var noContent: Operations.ActionsSetSelfHostedRunnersPermissionsOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -16116,83 +17337,191 @@ public enum Operations { } } } - /// Undocumented response. + /// Forbidden /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// List self-hosted runners for an organization - /// - /// Lists all self-hosted runners configured in an organization. - /// - /// Authenticated users must have admin access to the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. - /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/get(actions/list-self-hosted-runners-for-org)`. - public enum ActionsListSelfHostedRunnersForOrg { - public static let id: Swift.String = "actions/list-self-hosted-runners-for-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/path/org`. - public var org: Components.Parameters.Org - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.ActionsListSelfHostedRunnersForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/query`. - public struct Query: Sendable, Hashable { - /// The name of a self-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/query/name`. - public var name: Swift.String? - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/put(actions/set-self-hosted-runners-permissions-organization)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List repositories allowed to use self-hosted runners in an organization + /// + /// Lists repositories that are allowed to use self-hosted runners in an organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)`. + public enum ActionsListSelectedRepositoriesSelfHostedRunnersOrganization { + public static let id: Swift.String = "actions/list-selected-repositories-self-hosted-runners-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: - /// - name: The name of a self-hosted runner. /// - perPage: The number of results per page (max 100). 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)." /// - page: The page number of the results to fetch. 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)." public init( - name: Swift.String? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil ) { - self.name = name self.perPage = perPage self.page = page } } - public var query: Operations.ActionsListSelfHostedRunnersForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/header`. + public var query: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsListSelfHostedRunnersForOrg.Input.Headers + public var headers: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -16200,9 +17529,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ActionsListSelfHostedRunnersForOrg.Input.Path, - query: Operations.ActionsListSelfHostedRunnersForOrg.Input.Query = .init(), - headers: Operations.ActionsListSelfHostedRunnersForOrg.Input.Headers = .init() + path: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path, + query: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Query = .init(), + headers: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers = .init() ) { self.path = path self.query = query @@ -16211,52 +17540,38 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/GET/responses/200/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/json/runners`. - public var runners: [Components.Schemas.Runner] + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/GET/responses/200/content/json/repositories`. + public var repositories: [Components.Schemas.Repository]? /// Creates a new `JsonPayload`. /// /// - Parameters: /// - totalCount: - /// - runners: + /// - repositories: public init( - totalCount: Swift.Int, - runners: [Components.Schemas.Runner] + totalCount: Swift.Int? = nil, + repositories: [Components.Schemas.Repository]? = nil ) { self.totalCount = totalCount - self.runners = runners + self.repositories = repositories } public enum CodingKeys: String, CodingKey { case totalCount = "total_count" - case runners + case repositories } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body.JsonPayload { + public var json: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -16266,31 +17581,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body + public var body: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Headers = .init(), - body: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/get(actions/list-self-hosted-runners-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok) + case ok(Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok { + public var ok: Operations.ActionsListSelectedRepositoriesSelfHostedRunnersOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -16303,6 +17613,52 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/get(actions/list-selected-repositories-self-hosted-runners-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -16334,24 +17690,22 @@ public enum Operations { } } } - /// List runner applications for an organization - /// - /// Lists binaries for the runner application that you can download and run. + /// Set repositories allowed to use self-hosted runners in an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Sets repositories that are allowed to use self-hosted runners in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners/downloads`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/downloads/get(actions/list-runner-applications-for-org)`. - public enum ActionsListRunnerApplicationsForOrg { - public static let id: Swift.String = "actions/list-runner-applications-for-org" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)`. + public enum ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization { + public static let id: Swift.String = "actions/set-selected-repositories-self-hosted-runners-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -16361,204 +17715,42 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsListRunnerApplicationsForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/header`. + public var path: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsListRunnerApplicationsForOrg.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ActionsListRunnerApplicationsForOrg.Input.Path, - headers: Operations.ActionsListRunnerApplicationsForOrg.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/responses/200/content/application\/json`. - case json([Components.Schemas.RunnerApplication]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.RunnerApplication] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ActionsListRunnerApplicationsForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsListRunnerApplicationsForOrg.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/downloads/get(actions/list-runner-applications-for-org)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListRunnerApplicationsForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListRunnerApplicationsForOrg.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create configuration for a just-in-time runner for an organization - /// - /// Generates a configuration that can be passed to the runner application at startup. - /// - /// The authenticated user must have admin access to the organization. - /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/generate-jitconfig`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)`. - public enum ActionsGenerateRunnerJitconfigForOrg { - public static let id: Swift.String = "actions/generate-runner-jitconfig-for-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/path/org`. - public var org: Components.Parameters.Org - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody`. + public var headers: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/PUT/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The name of the new runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/name`. - public var name: Swift.String - /// The ID of the runner group to register the runner to. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/runner_group_id`. - public var runnerGroupId: Swift.Int - /// The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/labels`. - public var labels: [Swift.String] - /// The working directory to be used for job execution, relative to the runner install directory. + /// IDs of repositories that can use repository-level self-hosted runners /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/work_folder`. - public var workFolder: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int] /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - name: The name of the new runner. - /// - runnerGroupId: The ID of the runner group to register the runner to. - /// - labels: The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. - /// - workFolder: The working directory to be used for job execution, relative to the runner install directory. - public init( - name: Swift.String, - runnerGroupId: Swift.Int, - labels: [Swift.String], - workFolder: Swift.String? = nil - ) { - self.name = name - self.runnerGroupId = runnerGroupId - self.labels = labels - self.workFolder = workFolder + /// - selectedRepositoryIds: IDs of repositories that can use repository-level self-hosted runners + public init(selectedRepositoryIds: [Swift.Int]) { + self.selectedRepositoryIds = selectedRepositoryIds } public enum CodingKeys: String, CodingKey { - case name - case runnerGroupId = "runner_group_id" - case labels - case workFolder = "work_folder" + case selectedRepositoryIds = "selected_repository_ids" } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/content/application\/json`. - case json(Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Body.JsonPayload) } - public var body: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Body + public var body: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -16566,9 +17758,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Path, - headers: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Headers = .init(), - body: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Body + path: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Path, + headers: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Headers = .init(), + body: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Input.Body ) { self.path = path self.headers = headers @@ -16576,24 +17768,59 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - /// Response + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// No content /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)/responses/204`. /// - /// HTTP response code: `201 created`. - case created(Components.Responses.ActionsRunnerJitconfig) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Output.NoContent) + /// No content /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Components.Responses.ActionsRunnerJitconfig { + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsSetSelectedRepositoriesSelfHostedRunnersOrganization.Output.NoContent { get throws { switch self { - case let .created(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", response: self ) } @@ -16601,7 +17828,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -16624,15 +17851,15 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/put(actions/set-selected-repositories-self-hosted-runners-organization)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) + case unprocessableContent(Components.Responses.ValidationFailed) /// The associated value of the enum case if `self` is `.unprocessableContent`. /// /// - Throws: An error if `self` is not `.unprocessableContent`. /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { case let .unprocessableContent(response): @@ -16645,29 +17872,6 @@ public enum Operations { } } } - /// Conflict - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - case conflict(Components.Responses.Conflict) - /// The associated value of the enum case if `self` is `.conflict`. - /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Components.Responses.Conflict { - get throws { - switch self { - case let .conflict(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "conflict", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -16699,112 +17903,189 @@ public enum Operations { } } } - /// Create a registration token for an organization - /// - /// Returns a token that you can pass to the `config` script. The token expires after one hour. + /// Add a repository to the list of repositories allowed to use self-hosted runners in an organization /// - /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner: + /// Adds a repository to the list of repositories that are allowed to use self-hosted runners in an organization. /// - /// ``` - /// ./config.sh --url https://github.com/octo-org --token TOKEN - /// ``` + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// Authenticated users must have admin access to the organization to use this endpoint. - /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. - /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/registration-token`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/registration-token/post(actions/create-registration-token-for-org)`. - public enum ActionsCreateRegistrationTokenForOrg { - public static let id: Swift.String = "actions/create-registration-token-for-org" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)`. + public enum ActionsEnableSelectedRepositorySelfHostedRunnersOrganization { + public static let id: Swift.String = "actions/enable-selected-repository-self-hosted-runners-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/PUT/path/org`. public var org: Components.Parameters.Org + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/PUT/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - repositoryId: The unique identifier of the repository. + public init( + org: Components.Parameters.Org, + repositoryId: Components.Parameters.RepositoryId + ) { self.org = org + self.repositoryId = repositoryId } } - public var path: Operations.ActionsCreateRegistrationTokenForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/header`. + public var path: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsCreateRegistrationTokenForOrg.Input.Headers + public var headers: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsCreateRegistrationTokenForOrg.Input.Path, - headers: Operations.ActionsCreateRegistrationTokenForOrg.Input.Headers = .init() + path: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Path, + headers: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/responses/201/content/application\/json`. - case json(Components.Schemas.AuthenticationToken) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.AuthenticationToken { - get throws { - switch self { - case let .json(body): - return body - } - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// No content + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Output.NoContent) + /// No content + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsEnableSelectedRepositorySelfHostedRunnersOrganization.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.ActionsCreateRegistrationTokenForOrg.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsCreateRegistrationTokenForOrg.Output.Created.Body) { - self.body = body + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } } } - /// Response + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/registration-token/post(actions/create-registration-token-for-org)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)/responses/404`. /// - /// HTTP response code: `201 created`. - case created(Operations.ActionsCreateRegistrationTokenForOrg.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ActionsCreateRegistrationTokenForOrg.Output.Created { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .created(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/put(actions/enable-selected-repository-self-hosted-runners-organization)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", response: self ) } @@ -16841,129 +18122,206 @@ public enum Operations { } } } - /// Create a remove token for an organization - /// - /// Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. - /// - /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization: - /// - /// ``` - /// ./config.sh remove --token TOKEN - /// ``` + /// Remove a repository from the list of repositories allowed to use self-hosted runners in an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Removes a repository from the list of repositories that are allowed to use self-hosted runners in an organization. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope or the "Actions policies" fine-grained permission to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/remove-token`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/remove-token/post(actions/create-remove-token-for-org)`. - public enum ActionsCreateRemoveTokenForOrg { - public static let id: Swift.String = "actions/create-remove-token-for-org" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)`. + public enum ActionsDisableSelectedRepositorySelfHostedRunnersOrganization { + public static let id: Swift.String = "actions/disable-selected-repository-self-hosted-runners-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/DELETE/path/org`. public var org: Components.Parameters.Org + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/DELETE/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - repositoryId: The unique identifier of the repository. + public init( + org: Components.Parameters.Org, + repositoryId: Components.Parameters.RepositoryId + ) { self.org = org + self.repositoryId = repositoryId } } - public var path: Operations.ActionsCreateRemoveTokenForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/header`. + public var path: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsCreateRemoveTokenForOrg.Input.Headers + public var headers: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsCreateRemoveTokenForOrg.Input.Path, - headers: Operations.ActionsCreateRemoveTokenForOrg.Input.Headers = .init() + path: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Path, + headers: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/responses/201/content/application\/json`. - case json(Components.Schemas.AuthenticationToken) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.AuthenticationToken { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ActionsCreateRemoveTokenForOrg.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsCreateRemoveTokenForOrg.Output.Created.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Response + /// No content /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/remove-token/post(actions/create-remove-token-for-org)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)/responses/204`. /// - /// HTTP response code: `201 created`. - case created(Operations.ActionsCreateRemoveTokenForOrg.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Output.NoContent) + /// No content /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ActionsCreateRemoveTokenForOrg.Output.Created { + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsDisableSelectedRepositorySelfHostedRunnersOrganization.Output.NoContent { get throws { switch self { - case let .created(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "noContent", response: self ) } } } - /// Undocumented response. + /// Forbidden /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}/delete(actions/disable-selected-repository-self-hosted-runners-organization)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json default: self = .other(rawValue) } @@ -16983,63 +18341,54 @@ public enum Operations { } } } - /// Get a self-hosted runner for an organization - /// - /// Gets a specific self-hosted runner configured in an organization. + /// Get default workflow permissions for an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, + /// as well as whether GitHub Actions can submit approving pull request reviews. For more information, see + /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/get(actions/get-self-hosted-runner-for-org)`. - public enum ActionsGetSelfHostedRunnerForOrg { - public static let id: Swift.String = "actions/get-self-hosted-runner-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/permissions/workflow`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-organization)`. + public enum ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization { + public static let id: Swift.String = "actions/get-github-actions-default-workflow-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerId: Unique identifier of the self-hosted runner. - public init( - org: Components.Parameters.Org, - runnerId: Components.Parameters.RunnerId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerId = runnerId } } - public var path: Operations.ActionsGetSelfHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/header`. + public var path: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetSelfHostedRunnerForOrg.Input.Headers + public var headers: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetSelfHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsGetSelfHostedRunnerForOrg.Input.Headers = .init() + path: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path, + headers: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -17047,15 +18396,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Runner) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsGetDefaultWorkflowPermissions) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Runner { + public var json: Components.Schemas.ActionsGetDefaultWorkflowPermissions { get throws { switch self { case let .json(body): @@ -17065,26 +18414,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok.Body + public var body: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok.Body) { + public init(body: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/get(actions/get-self-hosted-runner-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/get(actions/get-github-actions-default-workflow-permissions-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok) + case ok(Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok { + public var ok: Operations.ActionsGetGithubActionsDefaultWorkflowPermissionsOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -17128,49 +18477,51 @@ public enum Operations { } } } - /// Delete a self-hosted runner from an organization - /// - /// Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. + /// Set default workflow permissions for an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actions + /// can submit approving pull request reviews. For more information, see + /// "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)`. - public enum ActionsDeleteSelfHostedRunnerFromOrg { - public static let id: Swift.String = "actions/delete-self-hosted-runner-from-org" + /// - Remark: HTTP `PUT /orgs/{org}/actions/permissions/workflow`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)`. + public enum ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization { + public static let id: Swift.String = "actions/set-github-actions-default-workflow-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/PUT/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/DELETE/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerId: Unique identifier of the self-hosted runner. - public init( - org: Components.Parameters.Org, - runnerId: Components.Parameters.RunnerId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerId = runnerId } } - public var path: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input.Path + public var path: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/permissions/workflow/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsSetDefaultWorkflowPermissions) + } + public var body: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input.Path) { + /// - body: + public init( + path: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Path, + body: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Input.Body? = nil + ) { self.path = path + self.body = body } } @frozen public enum Output: Sendable, Hashable { @@ -17178,15 +18529,15 @@ public enum Operations { /// Creates a new `NoContent`. public init() {} } - /// Response + /// Success response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsDeleteSelfHostedRunnerFromOrg.Output.NoContent) - /// Response + case noContent(Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Output.NoContent) + /// Success response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/permissions/workflow/put(actions/set-github-actions-default-workflow-permissions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -17196,7 +18547,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Output.NoContent { + public var noContent: Operations.ActionsSetGithubActionsDefaultWorkflowPermissionsOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -17215,80 +18566,154 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// List labels for a self-hosted runner for an organization - /// - /// Lists all labels for a self-hosted runner configured in an organization. + /// List self-hosted runner groups for an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)`. - public enum ActionsListLabelsForSelfHostedRunnerForOrg { - public static let id: Swift.String = "actions/list-labels-for-self-hosted-runner-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)`. + public enum ActionsListSelfHostedRunnerGroupsForOrg { + public static let id: Swift.String = "actions/list-self-hosted-runner-groups-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/GET/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerId: Unique identifier of the self-hosted runner. - public init( - org: Components.Parameters.Org, - runnerId: Components.Parameters.RunnerId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerId = runnerId } } - public var path: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. + public var path: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query/page`. + public var page: Components.Parameters.Page? + /// Only return runner groups that are allowed to be used by this repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/query/visible_to_repository`. + public var visibleToRepository: Components.Parameters.VisibleToRepository? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + /// - visibleToRepository: Only return runner groups that are allowed to be used by this repository. + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil, + visibleToRepository: Components.Parameters.VisibleToRepository? = nil + ) { + self.perPage = perPage + self.page = page + self.visibleToRepository = visibleToRepository + } + } + public var query: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Headers + public var headers: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Headers = .init() + path: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Path, + query: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Query = .init(), + headers: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Double + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/json/runner_groups`. + public var runnerGroups: [Components.Schemas.RunnerGroupsOrg] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - runnerGroups: + public init( + totalCount: Swift.Double, + runnerGroups: [Components.Schemas.RunnerGroupsOrg] + ) { + self.totalCount = totalCount + self.runnerGroups = runnerGroups + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case runnerGroups = "runner_groups" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok.Body) { + self.body = body + } + } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/get(actions/list-self-hosted-runner-groups-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Components.Responses.ActionsRunnerLabels) + case ok(Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Components.Responses.ActionsRunnerLabels { + public var ok: Operations.ActionsListSelfHostedRunnerGroupsForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -17301,29 +18726,6 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -17355,78 +18757,133 @@ public enum Operations { } } } - /// Add custom labels to a self-hosted runner for an organization - /// - /// Adds custom labels to a self-hosted runner configured in an organization. + /// Create a self-hosted runner group for an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Creates a new self-hosted runner group for an organization. /// /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)`. - public enum ActionsAddCustomLabelsToSelfHostedRunnerForOrg { - public static let id: Swift.String = "actions/add-custom-labels-to-self-hosted-runner-for-org" + /// - Remark: HTTP `POST /orgs/{org}/actions/runner-groups`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)`. + public enum ActionsCreateSelfHostedRunnerGroupForOrg { + public static let id: Swift.String = "actions/create-self-hosted-runner-group-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerId: Unique identifier of the self-hosted runner. - public init( - org: Components.Parameters.Org, - runnerId: Components.Parameters.RunnerId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.runnerId = runnerId } } - public var path: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/header`. + public var path: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody`. + public var headers: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The names of the custom labels to add to the runner. + /// Name of the runner group. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody/json/labels`. - public var labels: [Swift.String] + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/name`. + public var name: Swift.String + /// Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/visibility`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case selected = "selected" + case all = "all" + case _private = "private" + } + /// Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/visibility`. + public var visibility: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? + /// List of repository IDs that can access the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int]? + /// List of runner IDs to add to the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/runners`. + public var runners: [Swift.Int]? + /// Whether the runner group can be used by `public` repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/allows_public_repositories`. + public var allowsPublicRepositories: Swift.Bool? + /// If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/restricted_to_workflows`. + public var restrictedToWorkflows: Swift.Bool? + /// List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/selected_workflows`. + public var selectedWorkflows: [Swift.String]? + /// The identifier of a hosted compute network configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/json/network_configuration_id`. + public var networkConfigurationId: Swift.String? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - labels: The names of the custom labels to add to the runner. - public init(labels: [Swift.String]) { - self.labels = labels + /// - name: Name of the runner group. + /// - visibility: Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. + /// - selectedRepositoryIds: List of repository IDs that can access the runner group. + /// - runners: List of runner IDs to add to the runner group. + /// - allowsPublicRepositories: Whether the runner group can be used by `public` repositories. + /// - restrictedToWorkflows: If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + /// - selectedWorkflows: List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + /// - networkConfigurationId: The identifier of a hosted compute network configuration. + public init( + name: Swift.String, + visibility: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? = nil, + selectedRepositoryIds: [Swift.Int]? = nil, + runners: [Swift.Int]? = nil, + allowsPublicRepositories: Swift.Bool? = nil, + restrictedToWorkflows: Swift.Bool? = nil, + selectedWorkflows: [Swift.String]? = nil, + networkConfigurationId: Swift.String? = nil + ) { + self.name = name + self.visibility = visibility + self.selectedRepositoryIds = selectedRepositoryIds + self.runners = runners + self.allowsPublicRepositories = allowsPublicRepositories + self.restrictedToWorkflows = restrictedToWorkflows + self.selectedWorkflows = selectedWorkflows + self.networkConfigurationId = networkConfigurationId } public enum CodingKeys: String, CodingKey { - case labels + case name + case visibility + case selectedRepositoryIds = "selected_repository_ids" + case runners + case allowsPublicRepositories = "allows_public_repositories" + case restrictedToWorkflows = "restricted_to_workflows" + case selectedWorkflows = "selected_workflows" + case networkConfigurationId = "network_configuration_id" } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody/content/application\/json`. - case json(Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/requestBody/content/application\/json`. + case json(Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload) } - public var body: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Body + public var body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -17434,9 +18891,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Headers = .init(), - body: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Body + path: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Path, + headers: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Headers = .init(), + body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Input.Body ) { self.path = path self.headers = headers @@ -17444,70 +18901,52 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Components.Responses.ActionsRunnerLabels) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Components.Responses.ActionsRunnerLabels { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/POST/responses/201/content/application\/json`. + case json(Components.Schemas.RunnerGroupsOrg) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.RunnerGroupsOrg { + get throws { + switch self { + case let .json(body): + return body + } + } } } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } + /// Received HTTP response body + public var body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created.Body) { + self.body = body } } - /// Validation failed, or the endpoint has been spammed. + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/post(actions/create-self-hosted-runner-group-for-org)/responses/201`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `201 created`. + case created(Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ActionsCreateSelfHostedRunnerGroupForOrg.Output.Created { get throws { switch self { - case let .unprocessableContent(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "created", response: self ) } @@ -17544,107 +18983,106 @@ public enum Operations { } } } - /// Set custom labels for a self-hosted runner for an organization - /// - /// Remove all previous custom labels and set the new custom labels for a specific - /// self-hosted runner configured in an organization. + /// Get a self-hosted runner group for an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Gets a specific self-hosted runner group for an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)`. - public enum ActionsSetCustomLabelsForSelfHostedRunnerForOrg { - public static let id: Swift.String = "actions/set-custom-labels-for-self-hosted-runner-for-org" + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)`. + public enum ActionsGetSelfHostedRunnerGroupForOrg { + public static let id: Swift.String = "actions/get-self-hosted-runner-group-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner. + /// Unique identifier of the self-hosted runner group. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerId: Unique identifier of the self-hosted runner. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. public init( org: Components.Parameters.Org, - runnerId: Components.Parameters.RunnerId + runnerGroupId: Components.Parameters.RunnerGroupId ) { self.org = org - self.runnerId = runnerId + self.runnerGroupId = runnerGroupId } } - public var path: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/header`. + public var path: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody/json/labels`. - public var labels: [Swift.String] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - labels: The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. - public init(labels: [Swift.String]) { - self.labels = labels - } - public enum CodingKeys: String, CodingKey { - case labels - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Body.JsonPayload) - } - public var body: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Body + public var headers: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Headers = .init(), - body: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Body + path: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input.Path, + headers: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.RunnerGroupsOrg) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.RunnerGroupsOrg { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok.Body) { + self.body = body + } + } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/get(actions/get-self-hosted-runner-group-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Components.Responses.ActionsRunnerLabels) + case ok(Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Components.Responses.ActionsRunnerLabels { + public var ok: Operations.ActionsGetSelfHostedRunnerGroupForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -17657,52 +19095,6 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -17734,81 +19126,182 @@ public enum Operations { } } } - /// Remove all custom labels from a self-hosted runner for an organization - /// - /// Remove all custom labels from a self-hosted runner configured in an - /// organization. Returns the remaining read-only labels from the runner. + /// Update a self-hosted runner group for an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Updates the `name` and `visibility` of a self-hosted runner group in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)`. - public enum ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg { - public static let id: Swift.String = "actions/remove-all-custom-labels-from-self-hosted-runner-for-org" + /// - Remark: HTTP `PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)`. + public enum ActionsUpdateSelfHostedRunnerGroupForOrg { + public static let id: Swift.String = "actions/update-self-hosted-runner-group-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner. + /// Unique identifier of the self-hosted runner group. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/DELETE/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerId: Unique identifier of the self-hosted runner. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. public init( org: Components.Parameters.Org, - runnerId: Components.Parameters.RunnerId + runnerGroupId: Components.Parameters.RunnerGroupId ) { self.org = org - self.runnerId = runnerId + self.runnerGroupId = runnerGroupId } } - public var path: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/DELETE/header`. + public var path: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input.Headers + public var headers: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Name of the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/name`. + public var name: Swift.String + /// Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/visibility`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case selected = "selected" + case all = "all" + case _private = "private" + } + /// Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/visibility`. + public var visibility: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? + /// Whether the runner group can be used by `public` repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/allows_public_repositories`. + public var allowsPublicRepositories: Swift.Bool? + /// If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/restricted_to_workflows`. + public var restrictedToWorkflows: Swift.Bool? + /// List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/selected_workflows`. + public var selectedWorkflows: [Swift.String]? + /// The identifier of a hosted compute network configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/json/network_configuration_id`. + public var networkConfigurationId: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: Name of the runner group. + /// - visibility: Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. + /// - allowsPublicRepositories: Whether the runner group can be used by `public` repositories. + /// - restrictedToWorkflows: If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + /// - selectedWorkflows: List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + /// - networkConfigurationId: The identifier of a hosted compute network configuration. + public init( + name: Swift.String, + visibility: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload.VisibilityPayload? = nil, + allowsPublicRepositories: Swift.Bool? = nil, + restrictedToWorkflows: Swift.Bool? = nil, + selectedWorkflows: [Swift.String]? = nil, + networkConfigurationId: Swift.String? = nil + ) { + self.name = name + self.visibility = visibility + self.allowsPublicRepositories = allowsPublicRepositories + self.restrictedToWorkflows = restrictedToWorkflows + self.selectedWorkflows = selectedWorkflows + self.networkConfigurationId = networkConfigurationId + } + public enum CodingKeys: String, CodingKey { + case name + case visibility + case allowsPublicRepositories = "allows_public_repositories" + case restrictedToWorkflows = "restricted_to_workflows" + case selectedWorkflows = "selected_workflows" + case networkConfigurationId = "network_configuration_id" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input.Headers = .init() + path: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Path, + headers: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Headers = .init(), + body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.RunnerGroupsOrg) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.RunnerGroupsOrg { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok.Body) { + self.body = body + } + } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/patch(actions/update-self-hosted-runner-group-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Components.Responses.ActionsRunnerLabelsReadonly) + case ok(Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Components.Responses.ActionsRunnerLabelsReadonly { + public var ok: Operations.ActionsUpdateSelfHostedRunnerGroupForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -17821,29 +19314,6 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -17875,144 +19345,80 @@ public enum Operations { } } } - /// Remove a custom label from a self-hosted runner for an organization - /// - /// Remove a custom label from a self-hosted runner configured - /// in an organization. Returns the remaining labels from the runner. - /// - /// This endpoint returns a `404 Not Found` status if the custom label is not - /// present on the runner. + /// Delete a self-hosted runner group from an organization /// - /// Authenticated users must have admin access to the organization to use this endpoint. + /// Deletes a self-hosted runner group for an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)`. - public enum ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg { - public static let id: Swift.String = "actions/remove-custom-label-from-self-hosted-runner-for-org" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)`. + public enum ActionsDeleteSelfHostedRunnerGroupFromOrg { + public static let id: Swift.String = "actions/delete-self-hosted-runner-group-from-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the self-hosted runner. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path/runner_id`. - public var runnerId: Components.Parameters.RunnerId - /// The name of a self-hosted runner's custom label. + /// Unique identifier of the self-hosted runner group. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path/name`. - public var name: Components.Parameters.RunnerLabelName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/DELETE/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - runnerId: Unique identifier of the self-hosted runner. - /// - name: The name of a self-hosted runner's custom label. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. public init( org: Components.Parameters.Org, - runnerId: Components.Parameters.RunnerId, - name: Components.Parameters.RunnerLabelName + runnerGroupId: Components.Parameters.RunnerGroupId ) { self.org = org - self.runnerId = runnerId - self.name = name - } - } - public var path: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + self.runnerGroupId = runnerGroupId } } - public var headers: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input.Headers + public var path: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: - public init( - path: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input.Path, - headers: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input.Headers = .init() - ) { + public init(path: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Input.Path) { self.path = path - self.headers = headers } } @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Components.Responses.ActionsRunnerLabels) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Components.Responses.ActionsRunnerLabels { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/delete(actions/delete-self-hosted-runner-group-from-org)/responses/204`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// The associated value of the enum case if `self` is `.noContent`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsDeleteSelfHostedRunnerGroupFromOrg.Output.NoContent { get throws { switch self { - case let .unprocessableContent(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "noContent", response: self ) } @@ -18023,70 +19429,51 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } } - /// List organization secrets - /// - /// Lists all secrets available in an organization without revealing their - /// encrypted values. + /// List GitHub-hosted runners in a group for an organization /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Lists the GitHub-hosted runners in an organization group. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/get(actions/list-org-secrets)`. - public enum ActionsListOrgSecrets { - public static let id: Swift.String = "actions/list-org-secrets" + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/get(actions/list-github-hosted-runners-in-group-for-org)`. + public enum ActionsListGithubHostedRunnersInGroupForOrg { + public static let id: Swift.String = "actions/list-github-hosted-runners-in-group-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/path/org`. public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.Org, + runnerGroupId: Components.Parameters.RunnerGroupId + ) { self.org = org + self.runnerGroupId = runnerGroupId } } - public var path: Operations.ActionsListOrgSecrets.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/query`. + public var path: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/query`. public struct Query: Sendable, Hashable { /// The number of results per page (max 100). 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// @@ -18101,19 +19488,19 @@ public enum Operations { self.page = page } } - public var query: Operations.ActionsListOrgSecrets.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/header`. + public var query: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsListOrgSecrets.Input.Headers + public var headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -18121,9 +19508,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ActionsListOrgSecrets.Input.Path, - query: Operations.ActionsListOrgSecrets.Input.Query = .init(), - headers: Operations.ActionsListOrgSecrets.Input.Headers = .init() + path: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Path, + query: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Query = .init(), + headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Input.Headers = .init() ) { self.path = path self.query = query @@ -18132,9 +19519,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -18145,39 +19532,39 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ActionsListOrgSecrets.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content`. + public var headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/json/secrets`. - public var secrets: [Components.Schemas.OrganizationActionsSecret] + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Double + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/content/json/runners`. + public var runners: [Components.Schemas.ActionsHostedRunner] /// Creates a new `JsonPayload`. /// /// - Parameters: /// - totalCount: - /// - secrets: + /// - runners: public init( - totalCount: Swift.Int, - secrets: [Components.Schemas.OrganizationActionsSecret] + totalCount: Swift.Double, + runners: [Components.Schemas.ActionsHostedRunner] ) { self.totalCount = totalCount - self.secrets = secrets + self.runners = runners } public enum CodingKeys: String, CodingKey { case totalCount = "total_count" - case secrets + case runners } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListOrgSecrets.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ActionsListOrgSecrets.Output.Ok.Body.JsonPayload { + public var json: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -18187,15 +19574,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListOrgSecrets.Output.Ok.Body + public var body: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ActionsListOrgSecrets.Output.Ok.Headers = .init(), - body: Operations.ActionsListOrgSecrets.Output.Ok.Body + headers: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Headers = .init(), + body: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok.Body ) { self.headers = headers self.body = body @@ -18203,15 +19590,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/get(actions/list-org-secrets)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners/get(actions/list-github-hosted-runners-in-group-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListOrgSecrets.Output.Ok) + case ok(Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListOrgSecrets.Output.Ok { + public var ok: Operations.ActionsListGithubHostedRunnersInGroupForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -18255,71 +19642,127 @@ public enum Operations { } } } - /// Get an organization public key - /// - /// Gets your public key, which you need to encrypt secrets. You need to - /// encrypt a secret before you can create or update secrets. + /// List repository access to a self-hosted runner group in an organization /// - /// The authenticated user must have collaborator access to a repository to create, update, or read secrets. + /// Lists the repositories with access to a self-hosted runner group configured in an organization. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/public-key`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/public-key/get(actions/get-org-public-key)`. - public enum ActionsGetOrgPublicKey { - public static let id: Swift.String = "actions/get-org-public-key" + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)`. + public enum ActionsListRepoAccessToSelfHostedRunnerGroupInOrg { + public static let id: Swift.String = "actions/list-repo-access-to-self-hosted-runner-group-in-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/path/org`. public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + public init( + org: Components.Parameters.Org, + runnerGroupId: Components.Parameters.RunnerGroupId + ) { self.org = org + self.runnerGroupId = runnerGroupId } } - public var path: Operations.ActionsGetOrgPublicKey.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/header`. + public var path: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/query`. + public struct Query: Sendable, Hashable { + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - page: The page number of the results to fetch. 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)." + /// - perPage: The number of results per page (max 100). 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)." + public init( + page: Components.Parameters.Page? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.page = page + self.perPage = perPage + } + } + public var query: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetOrgPublicKey.Input.Headers + public var headers: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ActionsGetOrgPublicKey.Input.Path, - headers: Operations.ActionsGetOrgPublicKey.Input.Headers = .init() + path: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path, + query: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Query = .init(), + headers: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsPublicKey) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActionsPublicKey { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Double + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/json/repositories`. + public var repositories: [Components.Schemas.MinimalRepository] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - repositories: + public init( + totalCount: Swift.Double, + repositories: [Components.Schemas.MinimalRepository] + ) { + self.totalCount = totalCount + self.repositories = repositories + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case repositories + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -18329,26 +19772,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetOrgPublicKey.Output.Ok.Body + public var body: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetOrgPublicKey.Output.Ok.Body) { + public init(body: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/public-key/get(actions/get-org-public-key)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/get(actions/list-repo-access-to-self-hosted-runner-group-in-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetOrgPublicKey.Output.Ok) + case ok(Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetOrgPublicKey.Output.Ok { + public var ok: Operations.ActionsListRepoAccessToSelfHostedRunnerGroupInOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -18392,115 +19835,108 @@ public enum Operations { } } } - /// Get an organization secret - /// - /// Gets a single organization secret without revealing its encrypted value. + /// Set repository access for a self-hosted runner group in an organization /// - /// The authenticated user must have collaborator access to a repository to create, update, or read secrets + /// Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/get(actions/get-org-secret)`. - public enum ActionsGetOrgSecret { - public static let id: Swift.String = "actions/get-org-secret" + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)`. + public enum ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg { + public static let id: Swift.String = "actions/set-repo-access-to-self-hosted-runner-group-in-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/path/org`. public var org: Components.Parameters.Org - /// The name of the secret. + /// Unique identifier of the self-hosted runner group. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/path/secret_name`. - public var secretName: Components.Parameters.SecretName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - secretName: The name of the secret. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. public init( org: Components.Parameters.Org, - secretName: Components.Parameters.SecretName + runnerGroupId: Components.Parameters.RunnerGroupId ) { self.org = org - self.secretName = secretName + self.runnerGroupId = runnerGroupId } } - public var path: Operations.ActionsGetOrgSecret.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + public var path: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// List of repository IDs that can access the runner group. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedRepositoryIds: List of repository IDs that can access the runner group. + public init(selectedRepositoryIds: [Swift.Int]) { + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case selectedRepositoryIds = "selected_repository_ids" + } } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Body.JsonPayload) } - public var headers: Operations.ActionsGetOrgSecret.Input.Headers + public var body: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: + /// - body: public init( - path: Operations.ActionsGetOrgSecret.Input.Path, - headers: Operations.ActionsGetOrgSecret.Input.Headers = .init() + path: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path, + body: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Input.Body ) { self.path = path - self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.OrganizationActionsSecret) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.OrganizationActionsSecret { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ActionsGetOrgSecret.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsGetOrgSecret.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/get(actions/get-org-secret)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetOrgSecret.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetOrgSecret.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/put(actions/set-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsSetRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } @@ -18511,220 +19947,71 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } } - /// Create or update an organization secret - /// - /// Creates or updates an organization secret with an encrypted value. Encrypt your secret using - /// [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// Add repository access to a self-hosted runner group in an organization /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)`. - public enum ActionsCreateOrUpdateOrgSecret { - public static let id: Swift.String = "actions/create-or-update-org-secret" + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)`. + public enum ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg { + public static let id: Swift.String = "actions/add-repo-access-to-self-hosted-runner-group-in-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path/org`. public var org: Components.Parameters.Org - /// The name of the secret. + /// Unique identifier of the self-hosted runner group. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/path/secret_name`. - public var secretName: Components.Parameters.SecretName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/PUT/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - secretName: The name of the secret. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + /// - repositoryId: The unique identifier of the repository. public init( org: Components.Parameters.Org, - secretName: Components.Parameters.SecretName + runnerGroupId: Components.Parameters.RunnerGroupId, + repositoryId: Components.Parameters.RepositoryId ) { self.org = org - self.secretName = secretName + self.runnerGroupId = runnerGroupId + self.repositoryId = repositoryId } } - public var path: Operations.ActionsCreateOrUpdateOrgSecret.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ActionsCreateOrUpdateOrgSecret.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// 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/actions/secrets#get-an-organization-public-key) endpoint. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json/encrypted_value`. - public var encryptedValue: Swift.String - /// ID of the key you used to encrypt the secret. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json/key_id`. - public var keyId: Swift.String - /// 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. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json/visibility`. - @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case _private = "private" - case selected = "selected" - } - /// 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. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json/visibility`. - public var visibility: Operations.ActionsCreateOrUpdateOrgSecret.Input.Body.JsonPayload.VisibilityPayload - /// 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/actions/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - 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/actions/secrets#get-an-organization-public-key) endpoint. - /// - keyId: ID of the key you used to encrypt the secret. - /// - 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. - /// - 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/actions/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. - public init( - encryptedValue: Swift.String, - keyId: Swift.String, - visibility: Operations.ActionsCreateOrUpdateOrgSecret.Input.Body.JsonPayload.VisibilityPayload, - selectedRepositoryIds: [Swift.Int]? = nil - ) { - self.encryptedValue = encryptedValue - self.keyId = keyId - self.visibility = visibility - self.selectedRepositoryIds = selectedRepositoryIds - } - public enum CodingKeys: String, CodingKey { - case encryptedValue = "encrypted_value" - case keyId = "key_id" - case visibility - case selectedRepositoryIds = "selected_repository_ids" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsCreateOrUpdateOrgSecret.Input.Body.JsonPayload) - } - public var body: Operations.ActionsCreateOrUpdateOrgSecret.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ActionsCreateOrUpdateOrgSecret.Input.Path, - headers: Operations.ActionsCreateOrUpdateOrgSecret.Input.Headers = .init(), - body: Operations.ActionsCreateOrUpdateOrgSecret.Input.Body - ) { - self.path = path - self.headers = headers - self.body = body + public var path: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path) { + self.path = path } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/responses/201/content/application\/json`. - case json(Components.Schemas.EmptyObject) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.EmptyObject { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ActionsCreateOrUpdateOrgSecret.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsCreateOrUpdateOrgSecret.Output.Created.Body) { - self.body = body - } - } - /// Response when creating a secret - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ActionsCreateOrUpdateOrgSecret.Output.Created) - /// The associated value of the enum case if `self` is `.created`. - /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ActionsCreateOrUpdateOrgSecret.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } public struct NoContent: Sendable, Hashable { /// Creates a new `NoContent`. public init() {} } - /// Response when updating a secret + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsCreateOrUpdateOrgSecret.Output.NoContent) - /// Response when updating a secret + case noContent(Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent) + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/put(actions/add-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -18734,7 +20021,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsCreateOrUpdateOrgSecret.Output.NoContent { + public var noContent: Operations.ActionsAddRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -18752,74 +20039,54 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } } - /// Delete an organization secret - /// - /// Deletes a secret in an organization using the secret name. + /// Remove repository access to a self-hosted runner group in an organization /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)`. - public enum ActionsDeleteOrgSecret { - public static let id: Swift.String = "actions/delete-org-secret" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)`. + public enum ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg { + public static let id: Swift.String = "actions/remove-repo-access-to-self-hosted-runner-group-in-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The name of the secret. + /// Unique identifier of the self-hosted runner group. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/DELETE/path/secret_name`. - public var secretName: Components.Parameters.SecretName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/DELETE/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - secretName: The name of the secret. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + /// - repositoryId: The unique identifier of the repository. public init( org: Components.Parameters.Org, - secretName: Components.Parameters.SecretName + runnerGroupId: Components.Parameters.RunnerGroupId, + repositoryId: Components.Parameters.RepositoryId ) { self.org = org - self.secretName = secretName + self.runnerGroupId = runnerGroupId + self.repositoryId = repositoryId } } - public var path: Operations.ActionsDeleteOrgSecret.Input.Path + public var path: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsDeleteOrgSecret.Input.Path) { + public init(path: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Input.Path) { self.path = path } } @@ -18830,13 +20097,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsDeleteOrgSecret.Output.NoContent) + case noContent(Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}/delete(actions/remove-repo-access-to-self-hosted-runner-group-in-org)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -18846,7 +20113,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsDeleteOrgSecret.Output.NoContent { + public var noContent: Operations.ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrg.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -18865,80 +20132,77 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// List selected repositories for an organization secret - /// - /// Lists all repositories that have been selected when the `visibility` - /// for repository access to a secret is set to `selected`. + /// List self-hosted runners in a group for an organization /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Lists self-hosted runners that are in a specific organization group. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/get(actions/list-selected-repos-for-org-secret)`. - public enum ActionsListSelectedReposForOrgSecret { - public static let id: Swift.String = "actions/list-selected-repos-for-org-secret" + /// - Remark: HTTP `GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)`. + public enum ActionsListSelfHostedRunnersInGroupForOrg { + public static let id: Swift.String = "actions/list-self-hosted-runners-in-group-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/path/org`. public var org: Components.Parameters.Org - /// The name of the secret. + /// Unique identifier of the self-hosted runner group. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/path/secret_name`. - public var secretName: Components.Parameters.SecretName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - secretName: The name of the secret. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. public init( org: Components.Parameters.Org, - secretName: Components.Parameters.SecretName + runnerGroupId: Components.Parameters.RunnerGroupId ) { self.org = org - self.secretName = secretName + self.runnerGroupId = runnerGroupId } } - public var path: Operations.ActionsListSelectedReposForOrgSecret.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/query`. + public var path: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/query`. public struct Query: Sendable, Hashable { - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/query/page`. - public var page: Components.Parameters.Page? /// The number of results per page (max 100). 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/query/page`. + public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: - /// - page: The page number of the results to fetch. 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)." /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." public init( - page: Components.Parameters.Page? = nil, - perPage: Components.Parameters.PerPage? = nil + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil ) { - self.page = page self.perPage = perPage + self.page = page } } - public var query: Operations.ActionsListSelectedReposForOrgSecret.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/header`. + public var query: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsListSelectedReposForOrgSecret.Input.Headers + public var headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -18946,9 +20210,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ActionsListSelectedReposForOrgSecret.Input.Path, - query: Operations.ActionsListSelectedReposForOrgSecret.Input.Query = .init(), - headers: Operations.ActionsListSelectedReposForOrgSecret.Input.Headers = .init() + path: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Path, + query: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Query = .init(), + headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Input.Headers = .init() ) { self.path = path self.query = query @@ -18957,38 +20221,52 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/json/repositories`. - public var repositories: [Components.Schemas.MinimalRepository] + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Double + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/json/runners`. + public var runners: [Components.Schemas.Runner] /// Creates a new `JsonPayload`. /// /// - Parameters: /// - totalCount: - /// - repositories: + /// - runners: public init( - totalCount: Swift.Int, - repositories: [Components.Schemas.MinimalRepository] + totalCount: Swift.Double, + runners: [Components.Schemas.Runner] ) { self.totalCount = totalCount - self.repositories = repositories + self.runners = runners } public enum CodingKeys: String, CodingKey { case totalCount = "total_count" - case repositories + case runners } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body.JsonPayload { + public var json: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -18998,26 +20276,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body + public var body: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body) { + public init( + headers: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Headers = .init(), + body: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/get(actions/list-selected-repos-for-org-secret)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/get(actions/list-self-hosted-runners-in-group-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListSelectedReposForOrgSecret.Output.Ok) + case ok(Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok { + public var ok: Operations.ActionsListSelfHostedRunnersInGroupForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -19061,76 +20344,72 @@ public enum Operations { } } } - /// Set selected repositories for an organization secret - /// - /// Replaces all repositories for an organization secret when the `visibility` - /// for repository access is set to `selected`. The visibility is set when you [Create - /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// Set self-hosted runners in a group for an organization /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Replaces the list of self-hosted runners that are part of an organization runner group. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)`. - public enum ActionsSetSelectedReposForOrgSecret { - public static let id: Swift.String = "actions/set-selected-repos-for-org-secret" + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)`. + public enum ActionsSetSelfHostedRunnersInGroupForOrg { + public static let id: Swift.String = "actions/set-self-hosted-runners-in-group-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/path/org`. public var org: Components.Parameters.Org - /// The name of the secret. + /// Unique identifier of the self-hosted runner group. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/path/secret_name`. - public var secretName: Components.Parameters.SecretName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - secretName: The name of the secret. + /// - runnerGroupId: Unique identifier of the self-hosted runner group. public init( org: Components.Parameters.Org, - secretName: Components.Parameters.SecretName + runnerGroupId: Components.Parameters.RunnerGroupId ) { self.org = org - self.secretName = secretName + self.runnerGroupId = runnerGroupId } } - public var path: Operations.ActionsSetSelectedReposForOrgSecret.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody`. + public var path: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// 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 add and remove individual repositories using the [Add selected repository to an organization secret](https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + /// List of runner IDs to add to the runner group. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int] + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody/json/runners`. + public var runners: [Swift.Int] /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - 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 add and remove individual repositories using the [Add selected repository to an organization secret](https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. - public init(selectedRepositoryIds: [Swift.Int]) { - self.selectedRepositoryIds = selectedRepositoryIds + /// - runners: List of runner IDs to add to the runner group. + public init(runners: [Swift.Int]) { + self.runners = runners } public enum CodingKeys: String, CodingKey { - case selectedRepositoryIds = "selected_repository_ids" + case runners } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetSelectedReposForOrgSecret.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Body.JsonPayload) } - public var body: Operations.ActionsSetSelectedReposForOrgSecret.Input.Body + public var body: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - body: public init( - path: Operations.ActionsSetSelectedReposForOrgSecret.Input.Path, - body: Operations.ActionsSetSelectedReposForOrgSecret.Input.Body + path: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Path, + body: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Input.Body ) { self.path = path self.body = body @@ -19143,13 +20422,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetSelectedReposForOrgSecret.Output.NoContent) + case noContent(Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/put(actions/set-self-hosted-runners-in-group-for-org)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -19159,7 +20438,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetSelectedReposForOrgSecret.Output.NoContent { + public var noContent: Operations.ActionsSetSelfHostedRunnersInGroupForOrg.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -19178,55 +20457,53 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// Add selected repository to an organization secret - /// - /// Adds a repository to an organization secret when the `visibility` for - /// repository access is set to `selected`. For more information about setting the visibility, see [Create or - /// update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// Add a self-hosted runner to a group for an organization /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Adds a self-hosted runner to a runner group configured in an organization. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)`. - public enum ActionsAddSelectedRepoToOrgSecret { - public static let id: Swift.String = "actions/add-selected-repo-to-org-secret" + /// - Remark: HTTP `PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)`. + public enum ActionsAddSelfHostedRunnerToGroupForOrg { + public static let id: Swift.String = "actions/add-self-hosted-runner-to-group-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path/org`. public var org: Components.Parameters.Org - /// The name of the secret. + /// Unique identifier of the self-hosted runner group. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path/secret_name`. - public var secretName: Components.Parameters.SecretName - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path/repository_id`. - public var repositoryId: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId + /// Unique identifier of the self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/PUT/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - secretName: The name of the secret. - /// - repositoryId: + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + /// - runnerId: Unique identifier of the self-hosted runner. public init( org: Components.Parameters.Org, - secretName: Components.Parameters.SecretName, - repositoryId: Swift.Int + runnerGroupId: Components.Parameters.RunnerGroupId, + runnerId: Components.Parameters.RunnerId ) { self.org = org - self.secretName = secretName - self.repositoryId = repositoryId + self.runnerGroupId = runnerGroupId + self.runnerId = runnerId } } - public var path: Operations.ActionsAddSelectedRepoToOrgSecret.Input.Path + public var path: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsAddSelectedRepoToOrgSecret.Input.Path) { + public init(path: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Input.Path) { self.path = path } } @@ -19235,15 +20512,15 @@ public enum Operations { /// Creates a new `NoContent`. public init() {} } - /// No Content when repository was added to the selected list + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsAddSelectedRepoToOrgSecret.Output.NoContent) - /// No Content when repository was added to the selected list + case noContent(Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Output.NoContent) + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/put(actions/add-self-hosted-runner-to-group-for-org)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -19253,7 +20530,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsAddSelectedRepoToOrgSecret.Output.NoContent { + public var noContent: Operations.ActionsAddSelfHostedRunnerToGroupForOrg.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -19266,96 +20543,59 @@ public enum Operations { } } } - public struct Conflict: Sendable, Hashable { - /// Creates a new `Conflict`. - public init() {} - } - /// Conflict when visibility type is not set to selected - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - case conflict(Operations.ActionsAddSelectedRepoToOrgSecret.Output.Conflict) - /// Conflict when visibility type is not set to selected - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - public static var conflict: Self { - .conflict(.init()) - } - /// The associated value of the enum case if `self` is `.conflict`. - /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Operations.ActionsAddSelectedRepoToOrgSecret.Output.Conflict { - get throws { - switch self { - case let .conflict(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "conflict", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// Remove selected repository from an organization secret + /// Remove a self-hosted runner from a group for an organization /// - /// Removes a repository from an organization secret when the `visibility` - /// for repository access is set to `selected`. The visibility is set when you [Create - /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)`. - public enum ActionsRemoveSelectedRepoFromOrgSecret { - public static let id: Swift.String = "actions/remove-selected-repo-from-org-secret" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)`. + public enum ActionsRemoveSelfHostedRunnerFromGroupForOrg { + public static let id: Swift.String = "actions/remove-self-hosted-runner-from-group-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The name of the secret. + /// Unique identifier of the self-hosted runner group. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path/secret_name`. - public var secretName: Components.Parameters.SecretName - /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path/repository_id`. - public var repositoryId: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path/runner_group_id`. + public var runnerGroupId: Components.Parameters.RunnerGroupId + /// Unique identifier of the self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/DELETE/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - secretName: The name of the secret. - /// - repositoryId: + /// - runnerGroupId: Unique identifier of the self-hosted runner group. + /// - runnerId: Unique identifier of the self-hosted runner. public init( org: Components.Parameters.Org, - secretName: Components.Parameters.SecretName, - repositoryId: Swift.Int + runnerGroupId: Components.Parameters.RunnerGroupId, + runnerId: Components.Parameters.RunnerId ) { self.org = org - self.secretName = secretName - self.repositoryId = repositoryId + self.runnerGroupId = runnerGroupId + self.runnerId = runnerId } } - public var path: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Input.Path + public var path: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Input.Path) { + public init(path: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Input.Path) { self.path = path } } @@ -19364,15 +20604,15 @@ public enum Operations { /// Creates a new `NoContent`. public init() {} } - /// Response when repository was removed from the selected list + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output.NoContent) - /// Response when repository was removed from the selected list + case noContent(Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Output.NoContent) + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}/delete(actions/remove-self-hosted-runner-from-group-for-org)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -19382,7 +20622,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output.NoContent { + public var noContent: Operations.ActionsRemoveSelfHostedRunnerFromGroupForOrg.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -19395,65 +20635,30 @@ public enum Operations { } } } - public struct Conflict: Sendable, Hashable { - /// Creates a new `Conflict`. - public init() {} - } - /// Conflict when visibility type not set to selected - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - case conflict(Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output.Conflict) - /// Conflict when visibility type not set to selected - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - public static var conflict: Self { - .conflict(.init()) - } - /// The associated value of the enum case if `self` is `.conflict`. - /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output.Conflict { - get throws { - switch self { - case let .conflict(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "conflict", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// List organization variables + /// List self-hosted runners for an organization /// - /// Lists all organization variables. + /// Lists all self-hosted runners configured in an organization. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Authenticated users must have admin access to the organization to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/variables`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/get(actions/list-org-variables)`. - public enum ActionsListOrgVariables { - public static let id: Swift.String = "actions/list-org-variables" + /// - Remark: HTTP `GET /orgs/{org}/actions/runners`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/get(actions/list-self-hosted-runners-for-org)`. + public enum ActionsListSelfHostedRunnersForOrg { + public static let id: Swift.String = "actions/list-self-hosted-runners-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -19463,43 +20668,50 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsListOrgVariables.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/query`. + public var path: Operations.ActionsListSelfHostedRunnersForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/query`. public struct Query: Sendable, Hashable { - /// The number of results per page (max 30). 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)." + /// The name of a self-hosted runner. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/query/per_page`. - public var perPage: Components.Parameters.VariablesPerPage? + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/query/name`. + public var name: Swift.String? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: - /// - perPage: The number of results per page (max 30). 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)." + /// - name: The name of a self-hosted runner. + /// - perPage: The number of results per page (max 100). 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)." /// - page: The page number of the results to fetch. 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)." public init( - perPage: Components.Parameters.VariablesPerPage? = nil, + name: Swift.String? = nil, + perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil ) { + self.name = name self.perPage = perPage self.page = page } } - public var query: Operations.ActionsListOrgVariables.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/header`. + public var query: Operations.ActionsListSelfHostedRunnersForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsListOrgVariables.Input.Headers + public var headers: Operations.ActionsListSelfHostedRunnersForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -19507,9 +20719,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ActionsListOrgVariables.Input.Path, - query: Operations.ActionsListOrgVariables.Input.Query = .init(), - headers: Operations.ActionsListOrgVariables.Input.Headers = .init() + path: Operations.ActionsListSelfHostedRunnersForOrg.Input.Path, + query: Operations.ActionsListSelfHostedRunnersForOrg.Input.Query = .init(), + headers: Operations.ActionsListSelfHostedRunnersForOrg.Input.Headers = .init() ) { self.path = path self.query = query @@ -19518,9 +20730,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -19531,39 +20743,39 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ActionsListOrgVariables.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content`. + public var headers: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/json/total_count`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/json/total_count`. public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/json/variables`. - public var variables: [Components.Schemas.OrganizationActionsVariable] + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/json/runners`. + public var runners: [Components.Schemas.Runner] /// Creates a new `JsonPayload`. /// /// - Parameters: /// - totalCount: - /// - variables: + /// - runners: public init( totalCount: Swift.Int, - variables: [Components.Schemas.OrganizationActionsVariable] + runners: [Components.Schemas.Runner] ) { self.totalCount = totalCount - self.variables = variables + self.runners = runners } public enum CodingKeys: String, CodingKey { case totalCount = "total_count" - case variables + case runners } } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListOrgVariables.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ActionsListOrgVariables.Output.Ok.Body.JsonPayload { + public var json: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -19573,15 +20785,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListOrgVariables.Output.Ok.Body + public var body: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ActionsListOrgVariables.Output.Ok.Headers = .init(), - body: Operations.ActionsListOrgVariables.Output.Ok.Body + headers: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Headers = .init(), + body: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok.Body ) { self.headers = headers self.body = body @@ -19589,15 +20801,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/get(actions/list-org-variables)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/get(actions/list-self-hosted-runners-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListOrgVariables.Output.Ok) + case ok(Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListOrgVariables.Output.Ok { + public var ok: Operations.ActionsListSelfHostedRunnersForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -19641,24 +20853,24 @@ public enum Operations { } } } - /// Create an organization variable + /// List runner applications for an organization /// - /// Creates an organization variable that you can reference in a GitHub Actions workflow. + /// Lists binaries for the runner application that you can download and run. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Authenticated users must have admin access to the organization to use this endpoint. /// - /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `POST /orgs/{org}/actions/variables`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/post(actions/create-org-variable)`. - public enum ActionsCreateOrgVariable { - public static let id: Swift.String = "actions/create-org-variable" + /// - Remark: HTTP `GET /orgs/{org}/actions/runners/downloads`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/downloads/get(actions/list-runner-applications-for-org)`. + public enum ActionsListRunnerApplicationsForOrg { + public static let id: Swift.String = "actions/list-runner-applications-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -19668,103 +20880,43 @@ public enum Operations { self.org = org } } - public var path: Operations.ActionsCreateOrgVariable.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/header`. + public var path: Operations.ActionsListRunnerApplicationsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsCreateOrgVariable.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The name of the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/name`. - public var name: Swift.String - /// The value of the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/value`. - public var value: Swift.String - /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/visibility`. - @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case _private = "private" - case selected = "selected" - } - /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/visibility`. - public var visibility: Operations.ActionsCreateOrgVariable.Input.Body.JsonPayload.VisibilityPayload - /// An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: The name of the variable. - /// - value: The value of the variable. - /// - visibility: The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. - /// - selectedRepositoryIds: An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. - public init( - name: Swift.String, - value: Swift.String, - visibility: Operations.ActionsCreateOrgVariable.Input.Body.JsonPayload.VisibilityPayload, - selectedRepositoryIds: [Swift.Int]? = nil - ) { - self.name = name - self.value = value - self.visibility = visibility - self.selectedRepositoryIds = selectedRepositoryIds - } - public enum CodingKeys: String, CodingKey { - case name - case value - case visibility - case selectedRepositoryIds = "selected_repository_ids" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/content/application\/json`. - case json(Operations.ActionsCreateOrgVariable.Input.Body.JsonPayload) - } - public var body: Operations.ActionsCreateOrgVariable.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ActionsCreateOrgVariable.Input.Path, - headers: Operations.ActionsCreateOrgVariable.Input.Headers = .init(), - body: Operations.ActionsCreateOrgVariable.Input.Body - ) { - self.path = path - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/responses/201/content/application\/json`. - case json(Components.Schemas.EmptyObject) - /// The associated value of the enum case if `self` is `.json`. + public var headers: Operations.ActionsListRunnerApplicationsForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsListRunnerApplicationsForOrg.Input.Path, + headers: Operations.ActionsListRunnerApplicationsForOrg.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/downloads/GET/responses/200/content/application\/json`. + case json([Components.Schemas.RunnerApplication]) + /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.EmptyObject { + public var json: [Components.Schemas.RunnerApplication] { get throws { switch self { case let .json(body): @@ -19774,33 +20926,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsCreateOrgVariable.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.ActionsListRunnerApplicationsForOrg.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsCreateOrgVariable.Output.Created.Body) { + public init(body: Operations.ActionsListRunnerApplicationsForOrg.Output.Ok.Body) { self.body = body } } - /// Response when creating a variable + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/post(actions/create-org-variable)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/downloads/get(actions/list-runner-applications-for-org)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.ActionsCreateOrgVariable.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListRunnerApplicationsForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ActionsCreateOrgVariable.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsListRunnerApplicationsForOrg.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } @@ -19837,125 +20989,209 @@ public enum Operations { } } } - /// Get an organization variable + /// Create configuration for a just-in-time runner for an organization /// - /// Gets a specific variable in an organization. + /// Generates a configuration that can be passed to the runner application at startup. /// - /// The authenticated user must have collaborator access to a repository to create, update, or read variables. + /// The authenticated user must have admin access to the organization. /// /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/get(actions/get-org-variable)`. - public enum ActionsGetOrgVariable { - public static let id: Swift.String = "actions/get-org-variable" + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/generate-jitconfig`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)`. + public enum ActionsGenerateRunnerJitconfigForOrg { + public static let id: Swift.String = "actions/generate-runner-jitconfig-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/path/org`. public var org: Components.Parameters.Org - /// The name of the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/path/name`. - public var name: Components.Parameters.VariableName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - name: The name of the variable. - public init( - org: Components.Parameters.Org, - name: Components.Parameters.VariableName - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.name = name } } - public var path: Operations.ActionsGetOrgVariable.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/header`. + public var path: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetOrgVariable.Input.Headers + public var headers: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the new runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/name`. + public var name: Swift.String + /// The ID of the runner group to register the runner to. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/runner_group_id`. + public var runnerGroupId: Swift.Int + /// The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/labels`. + public var labels: [Swift.String] + /// The working directory to be used for job execution, relative to the runner install directory. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/json/work_folder`. + public var workFolder: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the new runner. + /// - runnerGroupId: The ID of the runner group to register the runner to. + /// - labels: The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. + /// - workFolder: The working directory to be used for job execution, relative to the runner install directory. + public init( + name: Swift.String, + runnerGroupId: Swift.Int, + labels: [Swift.String], + workFolder: Swift.String? = nil + ) { + self.name = name + self.runnerGroupId = runnerGroupId + self.labels = labels + self.workFolder = workFolder + } + public enum CodingKeys: String, CodingKey { + case name + case runnerGroupId = "runner_group_id" + case labels + case workFolder = "work_folder" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/generate-jitconfig/POST/requestBody/content/application\/json`. + case json(Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.ActionsGetOrgVariable.Input.Path, - headers: Operations.ActionsGetOrgVariable.Input.Headers = .init() + path: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Path, + headers: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Headers = .init(), + body: Operations.ActionsGenerateRunnerJitconfigForOrg.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.OrganizationActionsVariable) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.OrganizationActionsVariable { - get throws { - switch self { - case let .json(body): - return body - } - } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Components.Responses.ActionsRunnerJitconfig) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Components.Responses.ActionsRunnerJitconfig { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.ActionsGetOrgVariable.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsGetOrgVariable.Output.Ok.Body) { - self.body = body - } } - /// Response + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/get(actions/get-org-variable)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/404`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetOrgVariable.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetOrgVariable.Output.Ok { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .ok(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "notFound", response: self ) } } } - /// Undocumented response. + /// Validation failed, or the endpoint has been spammed. /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/generate-jitconfig/post(actions/generate-runner-jitconfig-for-org)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } @frozen public enum AcceptableContentType: AcceptableProtocol { case json case other(Swift.String) @@ -19982,144 +21218,112 @@ public enum Operations { } } } - /// Update an organization variable + /// Create a registration token for an organization /// - /// Updates an organization variable that you can reference in a GitHub Actions workflow. + /// Returns a token that you can pass to the `config` script. The token expires after one hour. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner: /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// ``` + /// ./config.sh --url https://github.com/octo-org --token TOKEN + /// ``` /// - /// - Remark: HTTP `PATCH /orgs/{org}/actions/variables/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)`. - public enum ActionsUpdateOrgVariable { - public static let id: Swift.String = "actions/update-org-variable" + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/registration-token`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/registration-token/post(actions/create-registration-token-for-org)`. + public enum ActionsCreateRegistrationTokenForOrg { + public static let id: Swift.String = "actions/create-registration-token-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/path/org`. public var org: Components.Parameters.Org - /// The name of the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/path/name`. - public var name: Components.Parameters.VariableName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - name: The name of the variable. - public init( - org: Components.Parameters.Org, - name: Components.Parameters.VariableName - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.name = name } } - public var path: Operations.ActionsUpdateOrgVariable.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The name of the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/name`. - public var name: Swift.String? - /// The value of the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/value`. - public var value: Swift.String? - /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/visibility`. - @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case _private = "private" - case selected = "selected" - } - /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/visibility`. - public var visibility: Operations.ActionsUpdateOrgVariable.Input.Body.JsonPayload.VisibilityPayload? - /// An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: The name of the variable. - /// - value: The value of the variable. - /// - visibility: The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. - /// - selectedRepositoryIds: An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. - public init( - name: Swift.String? = nil, - value: Swift.String? = nil, - visibility: Operations.ActionsUpdateOrgVariable.Input.Body.JsonPayload.VisibilityPayload? = nil, - selectedRepositoryIds: [Swift.Int]? = nil - ) { - self.name = name - self.value = value - self.visibility = visibility - self.selectedRepositoryIds = selectedRepositoryIds - } - public enum CodingKeys: String, CodingKey { - case name - case value - case visibility - case selectedRepositoryIds = "selected_repository_ids" - } + public var path: Operations.ActionsCreateRegistrationTokenForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/content/application\/json`. - case json(Operations.ActionsUpdateOrgVariable.Input.Body.JsonPayload) } - public var body: Operations.ActionsUpdateOrgVariable.Input.Body + public var headers: Operations.ActionsCreateRegistrationTokenForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - body: + /// - headers: public init( - path: Operations.ActionsUpdateOrgVariable.Input.Path, - body: Operations.ActionsUpdateOrgVariable.Input.Body + path: Operations.ActionsCreateRegistrationTokenForOrg.Input.Path, + headers: Operations.ActionsCreateRegistrationTokenForOrg.Input.Headers = .init() ) { self.path = path - self.body = body + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/registration-token/POST/responses/201/content/application\/json`. + case json(Components.Schemas.AuthenticationToken) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.AuthenticationToken { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsCreateRegistrationTokenForOrg.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsCreateRegistrationTokenForOrg.Output.Created.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsUpdateOrgVariable.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/registration-token/post(actions/create-registration-token-for-org)/responses/201`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `201 created`. + case created(Operations.ActionsCreateRegistrationTokenForOrg.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsUpdateOrgVariable.Output.NoContent { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ActionsCreateRegistrationTokenForOrg.Output.Created { get throws { switch self { - case let .noContent(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "created", response: self ) } @@ -20130,83 +21334,138 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } - /// Delete an organization variable + /// Create a remove token for an organization /// - /// Deletes an organization variable using the variable name. + /// Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization: + /// + /// ``` + /// ./config.sh remove --token TOKEN + /// ``` + /// + /// Authenticated users must have admin access to the organization to use this endpoint. /// /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)`. - public enum ActionsDeleteOrgVariable { - public static let id: Swift.String = "actions/delete-org-variable" + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/remove-token`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/remove-token/post(actions/create-remove-token-for-org)`. + public enum ActionsCreateRemoveTokenForOrg { + public static let id: Swift.String = "actions/create-remove-token-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/path/org`. public var org: Components.Parameters.Org - /// The name of the variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/DELETE/path/name`. - public var name: Components.Parameters.VariableName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - name: The name of the variable. - public init( - org: Components.Parameters.Org, - name: Components.Parameters.VariableName - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.name = name } } - public var path: Operations.ActionsDeleteOrgVariable.Input.Path + public var path: Operations.ActionsCreateRemoveTokenForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsCreateRemoveTokenForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsDeleteOrgVariable.Input.Path) { + /// - headers: + public init( + path: Operations.ActionsCreateRemoveTokenForOrg.Input.Path, + headers: Operations.ActionsCreateRemoveTokenForOrg.Input.Headers = .init() + ) { self.path = path + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/remove-token/POST/responses/201/content/application\/json`. + case json(Components.Schemas.AuthenticationToken) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.AuthenticationToken { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsCreateRemoveTokenForOrg.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsCreateRemoveTokenForOrg.Output.Created.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsDeleteOrgVariable.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/remove-token/post(actions/create-remove-token-for-org)/responses/201`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `201 created`. + case created(Operations.ActionsCreateRemoveTokenForOrg.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsDeleteOrgVariable.Output.NoContent { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ActionsCreateRemoveTokenForOrg.Output.Created { get throws { switch self { - case let .noContent(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "created", response: self ) } @@ -20217,131 +21476,105 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } - /// List selected repositories for an organization variable + /// Get a self-hosted runner for an organization /// - /// Lists all repositories that can access an organization variable - /// that is available to selected repositories. + /// Gets a specific self-hosted runner configured in an organization. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Authenticated users must have admin access to the organization to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)`. - public enum ActionsListSelectedReposForOrgVariable { - public static let id: Swift.String = "actions/list-selected-repos-for-org-variable" + /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/get(actions/get-self-hosted-runner-for-org)`. + public enum ActionsGetSelfHostedRunnerForOrg { + public static let id: Swift.String = "actions/get-self-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/path/org`. public var org: Components.Parameters.Org - /// The name of the variable. + /// Unique identifier of the self-hosted runner. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/path/name`. - public var name: Components.Parameters.VariableName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - name: The name of the variable. + /// - runnerId: Unique identifier of the self-hosted runner. public init( org: Components.Parameters.Org, - name: Components.Parameters.VariableName + runnerId: Components.Parameters.RunnerId ) { self.org = org - self.name = name - } - } - public var path: Operations.ActionsListSelectedReposForOrgVariable.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/query`. - public struct Query: Sendable, Hashable { - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/query/page`. - public var page: Components.Parameters.Page? - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - page: The page number of the results to fetch. 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)." - /// - perPage: The number of results per page (max 100). 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)." - public init( - page: Components.Parameters.Page? = nil, - perPage: Components.Parameters.PerPage? = nil - ) { - self.page = page - self.perPage = perPage + self.runnerId = runnerId } } - public var query: Operations.ActionsListSelectedReposForOrgVariable.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/header`. + public var path: Operations.ActionsGetSelfHostedRunnerForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsListSelectedReposForOrgVariable.Input.Headers + public var headers: Operations.ActionsGetSelfHostedRunnerForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsListSelectedReposForOrgVariable.Input.Path, - query: Operations.ActionsListSelectedReposForOrgVariable.Input.Query = .init(), - headers: Operations.ActionsListSelectedReposForOrgVariable.Input.Headers = .init() + path: Operations.ActionsGetSelfHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsGetSelfHostedRunnerForOrg.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/json/repositories`. - public var repositories: [Components.Schemas.MinimalRepository] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - repositories: - public init( - totalCount: Swift.Int, - repositories: [Components.Schemas.MinimalRepository] - ) { - self.totalCount = totalCount - self.repositories = repositories - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case repositories - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.Runner) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.Runner { get throws { switch self { case let .json(body): @@ -20351,26 +21584,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body + public var body: Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body) { + public init(body: Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/get(actions/get-self-hosted-runner-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListSelectedReposForOrgVariable.Output.Ok) + case ok(Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok { + public var ok: Operations.ActionsGetSelfHostedRunnerForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -20383,42 +21616,7 @@ public enum Operations { } } } - public struct Conflict: Sendable, Hashable { - /// Creates a new `Conflict`. - public init() {} - } - /// Response when the visibility of the variable is not set to `selected` - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - case conflict(Operations.ActionsListSelectedReposForOrgVariable.Output.Conflict) - /// Response when the visibility of the variable is not set to `selected` - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - public static var conflict: Self { - .conflict(.init()) - } - /// The associated value of the enum case if `self` is `.conflict`. - /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Operations.ActionsListSelectedReposForOrgVariable.Output.Conflict { - get throws { - switch self { - case let .conflict(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "conflict", - response: self - ) - } - } - } - /// Undocumented response. + /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) @@ -20449,79 +21647,66 @@ public enum Operations { } } } - /// Set selected repositories for an organization variable + /// Delete a self-hosted runner from an organization /// - /// Replaces all repositories for an organization variable that is available - /// to selected repositories. Organization variables that are available to selected - /// repositories have their `visibility` field set to `selected`. + /// Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Authenticated users must have admin access to the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)`. - public enum ActionsSetSelectedReposForOrgVariable { - public static let id: Swift.String = "actions/set-selected-repos-for-org-variable" + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)`. + public enum ActionsDeleteSelfHostedRunnerFromOrg { + public static let id: Swift.String = "actions/delete-self-hosted-runner-from-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The name of the variable. + /// Unique identifier of the self-hosted runner. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/path/name`. - public var name: Components.Parameters.VariableName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/DELETE/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - name: The name of the variable. + /// - runnerId: Unique identifier of the self-hosted runner. public init( org: Components.Parameters.Org, - name: Components.Parameters.VariableName + runnerId: Components.Parameters.RunnerId ) { self.org = org - self.name = name + self.runnerId = runnerId } } - public var path: Operations.ActionsSetSelectedReposForOrgVariable.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The IDs of the repositories that can access the organization variable. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - selectedRepositoryIds: The IDs of the repositories that can access the organization variable. - public init(selectedRepositoryIds: [Swift.Int]) { - self.selectedRepositoryIds = selectedRepositoryIds - } - public enum CodingKeys: String, CodingKey { - case selectedRepositoryIds = "selected_repository_ids" - } + public var path: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept } - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetSelectedReposForOrgVariable.Input.Body.JsonPayload) } - public var body: Operations.ActionsSetSelectedReposForOrgVariable.Input.Body + public var headers: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - body: + /// - headers: public init( - path: Operations.ActionsSetSelectedReposForOrgVariable.Input.Path, - body: Operations.ActionsSetSelectedReposForOrgVariable.Input.Body + path: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input.Path, + headers: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Input.Headers = .init() ) { self.path = path - self.body = body + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { @@ -20531,13 +21716,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetSelectedReposForOrgVariable.Output.NoContent) + case noContent(Operations.ActionsDeleteSelfHostedRunnerFromOrg.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -20547,7 +21732,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetSelectedReposForOrgVariable.Output.NoContent { + public var noContent: Operations.ActionsDeleteSelfHostedRunnerFromOrg.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -20560,36 +21745,24 @@ public enum Operations { } } } - public struct Conflict: Sendable, Hashable { - /// Creates a new `Conflict`. - public init() {} - } - /// Response when the visibility of the variable is not set to `selected` - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - case conflict(Operations.ActionsSetSelectedReposForOrgVariable.Output.Conflict) - /// Response when the visibility of the variable is not set to `selected` + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/409`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-org)/responses/422`. /// - /// HTTP response code: `409 conflict`. - public static var conflict: Self { - .conflict(.init()) - } - /// The associated value of the enum case if `self` is `.conflict`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Operations.ActionsSetSelectedReposForOrgVariable.Output.Conflict { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { get throws { switch self { - case let .conflict(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "conflict", + expectedStatus: "unprocessableContent", response: self ) } @@ -20600,184 +21773,4094 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } - /// Add selected repository to an organization variable + /// List labels for a self-hosted runner for an organization /// - /// Adds a repository to an organization variable that is available to selected repositories. - /// Organization variables that are available to selected repositories have their `visibility` field set to `selected`. + /// Lists all labels for a self-hosted runner configured in an organization. /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Authenticated users must have admin access to the organization to use this endpoint. /// - /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. /// - /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)`. - public enum ActionsAddSelectedRepoToOrgVariable { - public static let id: Swift.String = "actions/add-selected-repo-to-org-variable" + /// - Remark: HTTP `GET /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)`. + public enum ActionsListLabelsForSelfHostedRunnerForOrg { + public static let id: Swift.String = "actions/list-labels-for-self-hosted-runner-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/GET/path/org`. public var org: Components.Parameters.Org - /// The name of the variable. + /// Unique identifier of the self-hosted runner. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path/name`. - public var name: Components.Parameters.VariableName - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path/repository_id`. - public var repositoryId: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/GET/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - name: The name of the variable. - /// - repositoryId: + /// - runnerId: Unique identifier of the self-hosted runner. public init( org: Components.Parameters.Org, - name: Components.Parameters.VariableName, - repositoryId: Swift.Int + runnerId: Components.Parameters.RunnerId ) { self.org = org - self.name = name - self.repositoryId = repositoryId + self.runnerId = runnerId } } - public var path: Operations.ActionsAddSelectedRepoToOrgVariable.Input.Path + public var path: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsAddSelectedRepoToOrgVariable.Input.Path) { + /// - headers: + public init( + path: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsListLabelsForSelfHostedRunnerForOrg.Input.Headers = .init() + ) { self.path = path + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsAddSelectedRepoToOrgVariable.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Components.Responses.ActionsRunnerLabels) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsAddSelectedRepoToOrgVariable.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.ActionsRunnerLabels { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } } } - public struct Conflict: Sendable, Hashable { - /// Creates a new `Conflict`. - public init() {} - } - /// Response when the visibility of the variable is not set to `selected` - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/409`. + /// Resource not found /// - /// HTTP response code: `409 conflict`. - case conflict(Operations.ActionsAddSelectedRepoToOrgVariable.Output.Conflict) - /// Response when the visibility of the variable is not set to `selected` + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/get(actions/list-labels-for-self-hosted-runner-for-org)/responses/404`. /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/409`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// HTTP response code: `409 conflict`. + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Add custom labels to a self-hosted runner for an organization + /// + /// Adds custom labels to a self-hosted runner configured in an organization. + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)`. + public enum ActionsAddCustomLabelsToSelfHostedRunnerForOrg { + public static let id: Swift.String = "actions/add-custom-labels-to-self-hosted-runner-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerId: Unique identifier of the self-hosted runner. + public init( + org: Components.Parameters.Org, + runnerId: Components.Parameters.RunnerId + ) { + self.org = org + self.runnerId = runnerId + } + } + public var path: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The names of the custom labels to add to the runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody/json/labels`. + public var labels: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - labels: The names of the custom labels to add to the runner. + public init(labels: [Swift.String]) { + self.labels = labels + } + public enum CodingKeys: String, CodingKey { + case labels + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/POST/requestBody/content/application\/json`. + case json(Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Headers = .init(), + body: Operations.ActionsAddCustomLabelsToSelfHostedRunnerForOrg.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Components.Responses.ActionsRunnerLabels) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.ActionsRunnerLabels { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/post(actions/add-custom-labels-to-self-hosted-runner-for-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set custom labels for a self-hosted runner for an organization + /// + /// Remove all previous custom labels and set the new custom labels for a specific + /// self-hosted runner configured in an organization. + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)`. + public enum ActionsSetCustomLabelsForSelfHostedRunnerForOrg { + public static let id: Swift.String = "actions/set-custom-labels-for-self-hosted-runner-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerId: Unique identifier of the self-hosted runner. + public init( + org: Components.Parameters.Org, + runnerId: Components.Parameters.RunnerId + ) { + self.org = org + self.runnerId = runnerId + } + } + public var path: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody/json/labels`. + public var labels: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - labels: The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. + public init(labels: [Swift.String]) { + self.labels = labels + } + public enum CodingKeys: String, CodingKey { + case labels + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Headers = .init(), + body: Operations.ActionsSetCustomLabelsForSelfHostedRunnerForOrg.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Components.Responses.ActionsRunnerLabels) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.ActionsRunnerLabels { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/put(actions/set-custom-labels-for-self-hosted-runner-for-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Remove all custom labels from a self-hosted runner for an organization + /// + /// Remove all custom labels from a self-hosted runner configured in an + /// organization. Returns the remaining read-only labels from the runner. + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)`. + public enum ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg { + public static let id: Swift.String = "actions/remove-all-custom-labels-from-self-hosted-runner-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/DELETE/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/DELETE/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerId: Unique identifier of the self-hosted runner. + public init( + org: Components.Parameters.Org, + runnerId: Components.Parameters.RunnerId + ) { + self.org = org + self.runnerId = runnerId + } + } + public var path: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsRemoveAllCustomLabelsFromSelfHostedRunnerForOrg.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Components.Responses.ActionsRunnerLabelsReadonly) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.ActionsRunnerLabelsReadonly { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/delete(actions/remove-all-custom-labels-from-self-hosted-runner-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Remove a custom label from a self-hosted runner for an organization + /// + /// Remove a custom label from a self-hosted runner configured + /// in an organization. Returns the remaining labels from the runner. + /// + /// This endpoint returns a `404 Not Found` status if the custom label is not + /// present on the runner. + /// + /// Authenticated users must have admin access to the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)`. + public enum ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg { + public static let id: Swift.String = "actions/remove-custom-label-from-self-hosted-runner-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// Unique identifier of the self-hosted runner. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path/runner_id`. + public var runnerId: Components.Parameters.RunnerId + /// The name of a self-hosted runner's custom label. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/path/name`. + public var name: Components.Parameters.RunnerLabelName + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - runnerId: Unique identifier of the self-hosted runner. + /// - name: The name of a self-hosted runner's custom label. + public init( + org: Components.Parameters.Org, + runnerId: Components.Parameters.RunnerId, + name: Components.Parameters.RunnerLabelName + ) { + self.org = org + self.runnerId = runnerId + self.name = name + } + } + public var path: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/runners/{runner_id}/labels/{name}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input.Path, + headers: Operations.ActionsRemoveCustomLabelFromSelfHostedRunnerForOrg.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Components.Responses.ActionsRunnerLabels) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.ActionsRunnerLabels { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/runners/{runner_id}/labels/{name}/delete(actions/remove-custom-label-from-self-hosted-runner-for-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List organization secrets + /// + /// Lists all secrets available in an organization without revealing their + /// encrypted values. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/get(actions/list-org-secrets)`. + public enum ActionsListOrgSecrets { + public static let id: Swift.String = "actions/list-org-secrets" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsListOrgSecrets.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ActionsListOrgSecrets.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsListOrgSecrets.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ActionsListOrgSecrets.Input.Path, + query: Operations.ActionsListOrgSecrets.Input.Query = .init(), + headers: Operations.ActionsListOrgSecrets.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ActionsListOrgSecrets.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/json/secrets`. + public var secrets: [Components.Schemas.OrganizationActionsSecret] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - secrets: + public init( + totalCount: Swift.Int, + secrets: [Components.Schemas.OrganizationActionsSecret] + ) { + self.totalCount = totalCount + self.secrets = secrets + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case secrets + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListOrgSecrets.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ActionsListOrgSecrets.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListOrgSecrets.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ActionsListOrgSecrets.Output.Ok.Headers = .init(), + body: Operations.ActionsListOrgSecrets.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/get(actions/list-org-secrets)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListOrgSecrets.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsListOrgSecrets.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get an organization public key + /// + /// Gets your public key, which you need to encrypt secrets. You need to + /// encrypt a secret before you can create or update secrets. + /// + /// The authenticated user must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/public-key`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/public-key/get(actions/get-org-public-key)`. + public enum ActionsGetOrgPublicKey { + public static let id: Swift.String = "actions/get-org-public-key" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsGetOrgPublicKey.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetOrgPublicKey.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsGetOrgPublicKey.Input.Path, + headers: Operations.ActionsGetOrgPublicKey.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/public-key/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsPublicKey) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ActionsPublicKey { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetOrgPublicKey.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetOrgPublicKey.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/public-key/get(actions/get-org-public-key)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetOrgPublicKey.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetOrgPublicKey.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get an organization secret + /// + /// Gets a single organization secret without revealing its encrypted value. + /// + /// The authenticated user must have collaborator access to a repository to create, update, or read secrets + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/get(actions/get-org-secret)`. + public enum ActionsGetOrgSecret { + public static let id: Swift.String = "actions/get-org-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/path/org`. + public var org: Components.Parameters.Org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/path/secret_name`. + public var secretName: Components.Parameters.SecretName + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - secretName: The name of the secret. + public init( + org: Components.Parameters.Org, + secretName: Components.Parameters.SecretName + ) { + self.org = org + self.secretName = secretName + } + } + public var path: Operations.ActionsGetOrgSecret.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetOrgSecret.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsGetOrgSecret.Input.Path, + headers: Operations.ActionsGetOrgSecret.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.OrganizationActionsSecret) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.OrganizationActionsSecret { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetOrgSecret.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetOrgSecret.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/get(actions/get-org-secret)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetOrgSecret.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetOrgSecret.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create or update an organization secret + /// + /// Creates or updates an organization secret with an encrypted value. Encrypt your secret using + /// [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)`. + public enum ActionsCreateOrUpdateOrgSecret { + public static let id: Swift.String = "actions/create-or-update-org-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/path/org`. + public var org: Components.Parameters.Org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/path/secret_name`. + public var secretName: Components.Parameters.SecretName + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - secretName: The name of the secret. + public init( + org: Components.Parameters.Org, + secretName: Components.Parameters.SecretName + ) { + self.org = org + self.secretName = secretName + } + } + public var path: Operations.ActionsCreateOrUpdateOrgSecret.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsCreateOrUpdateOrgSecret.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// 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/actions/secrets#get-an-organization-public-key) endpoint. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json/encrypted_value`. + public var encryptedValue: Swift.String + /// ID of the key you used to encrypt the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json/key_id`. + public var keyId: Swift.String + /// 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. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json/visibility`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case _private = "private" + case selected = "selected" + } + /// 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. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json/visibility`. + public var visibility: Operations.ActionsCreateOrUpdateOrgSecret.Input.Body.JsonPayload.VisibilityPayload + /// 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/actions/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - 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/actions/secrets#get-an-organization-public-key) endpoint. + /// - keyId: ID of the key you used to encrypt the secret. + /// - 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. + /// - 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/actions/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + public init( + encryptedValue: Swift.String, + keyId: Swift.String, + visibility: Operations.ActionsCreateOrUpdateOrgSecret.Input.Body.JsonPayload.VisibilityPayload, + selectedRepositoryIds: [Swift.Int]? = nil + ) { + self.encryptedValue = encryptedValue + self.keyId = keyId + self.visibility = visibility + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case encryptedValue = "encrypted_value" + case keyId = "key_id" + case visibility + case selectedRepositoryIds = "selected_repository_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsCreateOrUpdateOrgSecret.Input.Body.JsonPayload) + } + public var body: Operations.ActionsCreateOrUpdateOrgSecret.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ActionsCreateOrUpdateOrgSecret.Input.Path, + headers: Operations.ActionsCreateOrUpdateOrgSecret.Input.Headers = .init(), + body: Operations.ActionsCreateOrUpdateOrgSecret.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/PUT/responses/201/content/application\/json`. + case json(Components.Schemas.EmptyObject) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.EmptyObject { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsCreateOrUpdateOrgSecret.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsCreateOrUpdateOrgSecret.Output.Created.Body) { + self.body = body + } + } + /// Response when creating a secret + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ActionsCreateOrUpdateOrgSecret.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ActionsCreateOrUpdateOrgSecret.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response when updating a secret + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsCreateOrUpdateOrgSecret.Output.NoContent) + /// Response when updating a secret + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/put(actions/create-or-update-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsCreateOrUpdateOrgSecret.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete an organization secret + /// + /// Deletes a secret in an organization using the secret name. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)`. + public enum ActionsDeleteOrgSecret { + public static let id: Swift.String = "actions/delete-org-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/DELETE/path/secret_name`. + public var secretName: Components.Parameters.SecretName + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - secretName: The name of the secret. + public init( + org: Components.Parameters.Org, + secretName: Components.Parameters.SecretName + ) { + self.org = org + self.secretName = secretName + } + } + public var path: Operations.ActionsDeleteOrgSecret.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsDeleteOrgSecret.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsDeleteOrgSecret.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/delete(actions/delete-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsDeleteOrgSecret.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// List selected repositories for an organization secret + /// + /// Lists all repositories that have been selected when the `visibility` + /// for repository access to a secret is set to `selected`. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/get(actions/list-selected-repos-for-org-secret)`. + public enum ActionsListSelectedReposForOrgSecret { + public static let id: Swift.String = "actions/list-selected-repos-for-org-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/path/org`. + public var org: Components.Parameters.Org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/path/secret_name`. + public var secretName: Components.Parameters.SecretName + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - secretName: The name of the secret. + public init( + org: Components.Parameters.Org, + secretName: Components.Parameters.SecretName + ) { + self.org = org + self.secretName = secretName + } + } + public var path: Operations.ActionsListSelectedReposForOrgSecret.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/query`. + public struct Query: Sendable, Hashable { + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - page: The page number of the results to fetch. 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)." + /// - perPage: The number of results per page (max 100). 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)." + public init( + page: Components.Parameters.Page? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.page = page + self.perPage = perPage + } + } + public var query: Operations.ActionsListSelectedReposForOrgSecret.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsListSelectedReposForOrgSecret.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ActionsListSelectedReposForOrgSecret.Input.Path, + query: Operations.ActionsListSelectedReposForOrgSecret.Input.Query = .init(), + headers: Operations.ActionsListSelectedReposForOrgSecret.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/json/repositories`. + public var repositories: [Components.Schemas.MinimalRepository] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - repositories: + public init( + totalCount: Swift.Int, + repositories: [Components.Schemas.MinimalRepository] + ) { + self.totalCount = totalCount + self.repositories = repositories + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case repositories + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/get(actions/list-selected-repos-for-org-secret)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListSelectedReposForOrgSecret.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsListSelectedReposForOrgSecret.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set selected repositories for an organization secret + /// + /// Replaces all repositories for an organization secret when the `visibility` + /// for repository access is set to `selected`. The visibility is set when you [Create + /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)`. + public enum ActionsSetSelectedReposForOrgSecret { + public static let id: Swift.String = "actions/set-selected-repos-for-org-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/path/org`. + public var org: Components.Parameters.Org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/path/secret_name`. + public var secretName: Components.Parameters.SecretName + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - secretName: The name of the secret. + public init( + org: Components.Parameters.Org, + secretName: Components.Parameters.SecretName + ) { + self.org = org + self.secretName = secretName + } + } + public var path: Operations.ActionsSetSelectedReposForOrgSecret.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// 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 add and remove individual repositories using the [Add selected repository to an organization secret](https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - 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 add and remove individual repositories using the [Add selected repository to an organization secret](https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + public init(selectedRepositoryIds: [Swift.Int]) { + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case selectedRepositoryIds = "selected_repository_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetSelectedReposForOrgSecret.Input.Body.JsonPayload) + } + public var body: Operations.ActionsSetSelectedReposForOrgSecret.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.ActionsSetSelectedReposForOrgSecret.Input.Path, + body: Operations.ActionsSetSelectedReposForOrgSecret.Input.Body + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetSelectedReposForOrgSecret.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/put(actions/set-selected-repos-for-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsSetSelectedReposForOrgSecret.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Add selected repository to an organization secret + /// + /// Adds a repository to an organization secret when the `visibility` for + /// repository access is set to `selected`. For more information about setting the visibility, see [Create or + /// update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)`. + public enum ActionsAddSelectedRepoToOrgSecret { + public static let id: Swift.String = "actions/add-selected-repo-to-org-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path/org`. + public var org: Components.Parameters.Org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path/secret_name`. + public var secretName: Components.Parameters.SecretName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/PUT/path/repository_id`. + public var repositoryId: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - secretName: The name of the secret. + /// - repositoryId: + public init( + org: Components.Parameters.Org, + secretName: Components.Parameters.SecretName, + repositoryId: Swift.Int + ) { + self.org = org + self.secretName = secretName + self.repositoryId = repositoryId + } + } + public var path: Operations.ActionsAddSelectedRepoToOrgSecret.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsAddSelectedRepoToOrgSecret.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// No Content when repository was added to the selected list + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsAddSelectedRepoToOrgSecret.Output.NoContent) + /// No Content when repository was added to the selected list + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsAddSelectedRepoToOrgSecret.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// Creates a new `Conflict`. + public init() {} + } + /// Conflict when visibility type is not set to selected + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.ActionsAddSelectedRepoToOrgSecret.Output.Conflict) + /// Conflict when visibility type is not set to selected + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-secret)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + public static var conflict: Self { + .conflict(.init()) + } + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ActionsAddSelectedRepoToOrgSecret.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Remove selected repository from an organization secret + /// + /// Removes a repository from an organization secret when the `visibility` + /// for repository access is set to `selected`. The visibility is set when you [Create + /// or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)`. + public enum ActionsRemoveSelectedRepoFromOrgSecret { + public static let id: Swift.String = "actions/remove-selected-repo-from-org-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path/secret_name`. + public var secretName: Components.Parameters.SecretName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/DELETE/path/repository_id`. + public var repositoryId: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - secretName: The name of the secret. + /// - repositoryId: + public init( + org: Components.Parameters.Org, + secretName: Components.Parameters.SecretName, + repositoryId: Swift.Int + ) { + self.org = org + self.secretName = secretName + self.repositoryId = repositoryId + } + } + public var path: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response when repository was removed from the selected list + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output.NoContent) + /// Response when repository was removed from the selected list + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// Creates a new `Conflict`. + public init() {} + } + /// Conflict when visibility type not set to selected + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output.Conflict) + /// Conflict when visibility type not set to selected + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-secret)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + public static var conflict: Self { + .conflict(.init()) + } + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ActionsRemoveSelectedRepoFromOrgSecret.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// List organization variables + /// + /// Lists all organization variables. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/get(actions/list-org-variables)`. + public enum ActionsListOrgVariables { + public static let id: Swift.String = "actions/list-org-variables" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsListOrgVariables.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 30). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/query/per_page`. + public var perPage: Components.Parameters.VariablesPerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 30). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.VariablesPerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ActionsListOrgVariables.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsListOrgVariables.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ActionsListOrgVariables.Input.Path, + query: Operations.ActionsListOrgVariables.Input.Query = .init(), + headers: Operations.ActionsListOrgVariables.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ActionsListOrgVariables.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/json/variables`. + public var variables: [Components.Schemas.OrganizationActionsVariable] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - variables: + public init( + totalCount: Swift.Int, + variables: [Components.Schemas.OrganizationActionsVariable] + ) { + self.totalCount = totalCount + self.variables = variables + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case variables + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListOrgVariables.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ActionsListOrgVariables.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListOrgVariables.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ActionsListOrgVariables.Output.Ok.Headers = .init(), + body: Operations.ActionsListOrgVariables.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/get(actions/list-org-variables)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListOrgVariables.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsListOrgVariables.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create an organization variable + /// + /// Creates an organization variable that you can reference in a GitHub Actions workflow. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/actions/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/post(actions/create-org-variable)`. + public enum ActionsCreateOrgVariable { + public static let id: Swift.String = "actions/create-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ActionsCreateOrgVariable.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsCreateOrgVariable.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/name`. + public var name: Swift.String + /// The value of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/value`. + public var value: Swift.String + /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/visibility`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case _private = "private" + case selected = "selected" + } + /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/visibility`. + public var visibility: Operations.ActionsCreateOrgVariable.Input.Body.JsonPayload.VisibilityPayload + /// An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the variable. + /// - value: The value of the variable. + /// - visibility: The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. + /// - selectedRepositoryIds: An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. + public init( + name: Swift.String, + value: Swift.String, + visibility: Operations.ActionsCreateOrgVariable.Input.Body.JsonPayload.VisibilityPayload, + selectedRepositoryIds: [Swift.Int]? = nil + ) { + self.name = name + self.value = value + self.visibility = visibility + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case name + case value + case visibility + case selectedRepositoryIds = "selected_repository_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/requestBody/content/application\/json`. + case json(Operations.ActionsCreateOrgVariable.Input.Body.JsonPayload) + } + public var body: Operations.ActionsCreateOrgVariable.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ActionsCreateOrgVariable.Input.Path, + headers: Operations.ActionsCreateOrgVariable.Input.Headers = .init(), + body: Operations.ActionsCreateOrgVariable.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/POST/responses/201/content/application\/json`. + case json(Components.Schemas.EmptyObject) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.EmptyObject { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsCreateOrgVariable.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsCreateOrgVariable.Output.Created.Body) { + self.body = body + } + } + /// Response when creating a variable + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/post(actions/create-org-variable)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ActionsCreateOrgVariable.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ActionsCreateOrgVariable.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get an organization variable + /// + /// Gets a specific variable in an organization. + /// + /// The authenticated user must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/get(actions/get-org-variable)`. + public enum ActionsGetOrgVariable { + public static let id: Swift.String = "actions/get-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/path/org`. + public var org: Components.Parameters.Org + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/path/name`. + public var name: Components.Parameters.VariableName + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - name: The name of the variable. + public init( + org: Components.Parameters.Org, + name: Components.Parameters.VariableName + ) { + self.org = org + self.name = name + } + } + public var path: Operations.ActionsGetOrgVariable.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetOrgVariable.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsGetOrgVariable.Input.Path, + headers: Operations.ActionsGetOrgVariable.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.OrganizationActionsVariable) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.OrganizationActionsVariable { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetOrgVariable.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetOrgVariable.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/get(actions/get-org-variable)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetOrgVariable.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetOrgVariable.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update an organization variable + /// + /// Updates an organization variable that you can reference in a GitHub Actions workflow. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/actions/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)`. + public enum ActionsUpdateOrgVariable { + public static let id: Swift.String = "actions/update-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/path/org`. + public var org: Components.Parameters.Org + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/path/name`. + public var name: Components.Parameters.VariableName + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - name: The name of the variable. + public init( + org: Components.Parameters.Org, + name: Components.Parameters.VariableName + ) { + self.org = org + self.name = name + } + } + public var path: Operations.ActionsUpdateOrgVariable.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// The value of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/value`. + public var value: Swift.String? + /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/visibility`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case _private = "private" + case selected = "selected" + } + /// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/visibility`. + public var visibility: Operations.ActionsUpdateOrgVariable.Input.Body.JsonPayload.VisibilityPayload? + /// An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the variable. + /// - value: The value of the variable. + /// - visibility: The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. + /// - selectedRepositoryIds: An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. + public init( + name: Swift.String? = nil, + value: Swift.String? = nil, + visibility: Operations.ActionsUpdateOrgVariable.Input.Body.JsonPayload.VisibilityPayload? = nil, + selectedRepositoryIds: [Swift.Int]? = nil + ) { + self.name = name + self.value = value + self.visibility = visibility + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case name + case value + case visibility + case selectedRepositoryIds = "selected_repository_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/PATCH/requestBody/content/application\/json`. + case json(Operations.ActionsUpdateOrgVariable.Input.Body.JsonPayload) + } + public var body: Operations.ActionsUpdateOrgVariable.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.ActionsUpdateOrgVariable.Input.Path, + body: Operations.ActionsUpdateOrgVariable.Input.Body + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsUpdateOrgVariable.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/patch(actions/update-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsUpdateOrgVariable.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Delete an organization variable + /// + /// Deletes an organization variable using the variable name. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)`. + public enum ActionsDeleteOrgVariable { + public static let id: Swift.String = "actions/delete-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/DELETE/path/name`. + public var name: Components.Parameters.VariableName + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - name: The name of the variable. + public init( + org: Components.Parameters.Org, + name: Components.Parameters.VariableName + ) { + self.org = org + self.name = name + } + } + public var path: Operations.ActionsDeleteOrgVariable.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsDeleteOrgVariable.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsDeleteOrgVariable.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/delete(actions/delete-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsDeleteOrgVariable.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// List selected repositories for an organization variable + /// + /// Lists all repositories that can access an organization variable + /// that is available to selected repositories. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `GET /orgs/{org}/actions/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)`. + public enum ActionsListSelectedReposForOrgVariable { + public static let id: Swift.String = "actions/list-selected-repos-for-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/path/org`. + public var org: Components.Parameters.Org + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/path/name`. + public var name: Components.Parameters.VariableName + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - name: The name of the variable. + public init( + org: Components.Parameters.Org, + name: Components.Parameters.VariableName + ) { + self.org = org + self.name = name + } + } + public var path: Operations.ActionsListSelectedReposForOrgVariable.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/query`. + public struct Query: Sendable, Hashable { + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - page: The page number of the results to fetch. 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)." + /// - perPage: The number of results per page (max 100). 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)." + public init( + page: Components.Parameters.Page? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.page = page + self.perPage = perPage + } + } + public var query: Operations.ActionsListSelectedReposForOrgVariable.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsListSelectedReposForOrgVariable.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ActionsListSelectedReposForOrgVariable.Input.Path, + query: Operations.ActionsListSelectedReposForOrgVariable.Input.Query = .init(), + headers: Operations.ActionsListSelectedReposForOrgVariable.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/json/repositories`. + public var repositories: [Components.Schemas.MinimalRepository] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - repositories: + public init( + totalCount: Swift.Int, + repositories: [Components.Schemas.MinimalRepository] + ) { + self.totalCount = totalCount + self.repositories = repositories + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case repositories + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListSelectedReposForOrgVariable.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsListSelectedReposForOrgVariable.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// Creates a new `Conflict`. + public init() {} + } + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.ActionsListSelectedReposForOrgVariable.Output.Conflict) + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/get(actions/list-selected-repos-for-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + public static var conflict: Self { + .conflict(.init()) + } + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ActionsListSelectedReposForOrgVariable.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set selected repositories for an organization variable + /// + /// Replaces all repositories for an organization variable that is available + /// to selected repositories. Organization variables that are available to selected + /// repositories have their `visibility` field set to `selected`. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)`. + public enum ActionsSetSelectedReposForOrgVariable { + public static let id: Swift.String = "actions/set-selected-repos-for-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/path/org`. + public var org: Components.Parameters.Org + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/path/name`. + public var name: Components.Parameters.VariableName + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - name: The name of the variable. + public init( + org: Components.Parameters.Org, + name: Components.Parameters.VariableName + ) { + self.org = org + self.name = name + } + } + public var path: Operations.ActionsSetSelectedReposForOrgVariable.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The IDs of the repositories that can access the organization variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedRepositoryIds: The IDs of the repositories that can access the organization variable. + public init(selectedRepositoryIds: [Swift.Int]) { + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case selectedRepositoryIds = "selected_repository_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetSelectedReposForOrgVariable.Input.Body.JsonPayload) + } + public var body: Operations.ActionsSetSelectedReposForOrgVariable.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.ActionsSetSelectedReposForOrgVariable.Input.Path, + body: Operations.ActionsSetSelectedReposForOrgVariable.Input.Body + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetSelectedReposForOrgVariable.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsSetSelectedReposForOrgVariable.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// Creates a new `Conflict`. + public init() {} + } + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.ActionsSetSelectedReposForOrgVariable.Output.Conflict) + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/put(actions/set-selected-repos-for-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + public static var conflict: Self { + .conflict(.init()) + } + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ActionsSetSelectedReposForOrgVariable.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Add selected repository to an organization variable + /// + /// Adds a repository to an organization variable that is available to selected repositories. + /// Organization variables that are available to selected repositories have their `visibility` field set to `selected`. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)`. + public enum ActionsAddSelectedRepoToOrgVariable { + public static let id: Swift.String = "actions/add-selected-repo-to-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path/org`. + public var org: Components.Parameters.Org + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path/name`. + public var name: Components.Parameters.VariableName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/PUT/path/repository_id`. + public var repositoryId: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - name: The name of the variable. + /// - repositoryId: + public init( + org: Components.Parameters.Org, + name: Components.Parameters.VariableName, + repositoryId: Swift.Int + ) { + self.org = org + self.name = name + self.repositoryId = repositoryId + } + } + public var path: Operations.ActionsAddSelectedRepoToOrgVariable.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsAddSelectedRepoToOrgVariable.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsAddSelectedRepoToOrgVariable.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsAddSelectedRepoToOrgVariable.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// Creates a new `Conflict`. + public init() {} + } + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.ActionsAddSelectedRepoToOrgVariable.Output.Conflict) + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/put(actions/add-selected-repo-to-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. public static var conflict: Self { .conflict(.init()) } - /// The associated value of the enum case if `self` is `.conflict`. + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ActionsAddSelectedRepoToOrgVariable.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Remove selected repository from an organization variable + /// + /// Removes a repository from an organization variable that is + /// available to selected repositories. Organization variables that are available to + /// selected repositories have their `visibility` field set to `selected`. + /// + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)`. + public enum ActionsRemoveSelectedRepoFromOrgVariable { + public static let id: Swift.String = "actions/remove-selected-repo-from-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path/name`. + public var name: Components.Parameters.VariableName + /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path/repository_id`. + public var repositoryId: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - name: The name of the variable. + /// - repositoryId: + public init( + org: Components.Parameters.Org, + name: Components.Parameters.VariableName, + repositoryId: Swift.Int + ) { + self.org = org + self.name = name + self.repositoryId = repositoryId + } + } + public var path: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// Creates a new `Conflict`. + public init() {} + } + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output.Conflict) + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + public static var conflict: Self { + .conflict(.init()) + } + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// List artifacts for a repository + /// + /// Lists all artifacts for a repository. + /// + /// Anyone with read access to the repository can use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/get(actions/list-artifacts-for-repo)`. + public enum ActionsListArtifactsForRepo { + public static let id: Swift.String = "actions/list-artifacts-for-repo" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ActionsListArtifactsForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/query/page`. + public var page: Components.Parameters.Page? + /// The name field of an artifact. When specified, only artifacts with this name will be returned. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/query/name`. + public var name: Components.Parameters.ArtifactName? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + /// - name: The name field of an artifact. When specified, only artifacts with this name will be returned. + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil, + name: Components.Parameters.ArtifactName? = nil + ) { + self.perPage = perPage + self.page = page + self.name = name + } + } + public var query: Operations.ActionsListArtifactsForRepo.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsListArtifactsForRepo.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ActionsListArtifactsForRepo.Input.Path, + query: Operations.ActionsListArtifactsForRepo.Input.Query = .init(), + headers: Operations.ActionsListArtifactsForRepo.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ActionsListArtifactsForRepo.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/json/artifacts`. + public var artifacts: [Components.Schemas.Artifact] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - artifacts: + public init( + totalCount: Swift.Int, + artifacts: [Components.Schemas.Artifact] + ) { + self.totalCount = totalCount + self.artifacts = artifacts + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case artifacts + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListArtifactsForRepo.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ActionsListArtifactsForRepo.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListArtifactsForRepo.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ActionsListArtifactsForRepo.Output.Ok.Headers = .init(), + body: Operations.ActionsListArtifactsForRepo.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Operations.ActionsAddSelectedRepoToOrgVariable.Output.Conflict { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/get(actions/list-artifacts-for-repo)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListArtifactsForRepo.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsListArtifactsForRepo.Output.Ok { get throws { switch self { - case let .conflict(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "conflict", + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get an artifact + /// + /// Gets a specific artifact for a workflow run. + /// + /// Anyone with read access to the repository can use this endpoint. + /// + /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/get(actions/get-artifact)`. + public enum ActionsGetArtifact { + public static let id: Swift.String = "actions/get-artifact" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the artifact. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/path/artifact_id`. + public var artifactId: Components.Parameters.ArtifactId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - artifactId: The unique identifier of the artifact. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + artifactId: Components.Parameters.ArtifactId + ) { + self.owner = owner + self.repo = repo + self.artifactId = artifactId + } + } + public var path: Operations.ActionsGetArtifact.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetArtifact.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsGetArtifact.Input.Path, + headers: Operations.ActionsGetArtifact.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.Artifact) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Artifact { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetArtifact.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetArtifact.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/get(actions/get-artifact)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetArtifact.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetArtifact.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", response: self ) } } } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } } } - /// Remove selected repository from an organization variable - /// - /// Removes a repository from an organization variable that is - /// available to selected repositories. Organization variables that are available to - /// selected repositories have their `visibility` field set to `selected`. - /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Delete an artifact /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. + /// Deletes an artifact for a workflow run. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)`. - public enum ActionsRemoveSelectedRepoFromOrgVariable { - public static let id: Swift.String = "actions/remove-selected-repo-from-org-variable" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)`. + public enum ActionsDeleteArtifact { + public static let id: Swift.String = "actions/delete-artifact" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/DELETE/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path/org`. - public var org: Components.Parameters.Org - /// The name of the variable. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/DELETE/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path/name`. - public var name: Components.Parameters.VariableName - /// - Remark: Generated from `#/paths/orgs/{org}/actions/variables/{name}/repositories/{repository_id}/DELETE/path/repository_id`. - public var repositoryId: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the artifact. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/DELETE/path/artifact_id`. + public var artifactId: Components.Parameters.ArtifactId /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - name: The name of the variable. - /// - repositoryId: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - artifactId: The unique identifier of the artifact. public init( - org: Components.Parameters.Org, - name: Components.Parameters.VariableName, - repositoryId: Swift.Int + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + artifactId: Components.Parameters.ArtifactId ) { - self.org = org - self.name = name - self.repositoryId = repositoryId + self.owner = owner + self.repo = repo + self.artifactId = artifactId } } - public var path: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Input.Path + public var path: Operations.ActionsDeleteArtifact.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Input.Path) { + public init(path: Operations.ActionsDeleteArtifact.Input.Path) { self.path = path } } @@ -20788,13 +25871,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output.NoContent) + case noContent(Operations.ActionsDeleteArtifact.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -20804,7 +25887,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output.NoContent { + public var noContent: Operations.ActionsDeleteArtifact.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -20817,232 +25900,150 @@ public enum Operations { } } } - public struct Conflict: Sendable, Hashable { - /// Creates a new `Conflict`. - public init() {} - } - /// Response when the visibility of the variable is not set to `selected` - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - case conflict(Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output.Conflict) - /// Response when the visibility of the variable is not set to `selected` - /// - /// - Remark: Generated from `#/paths//orgs/{org}/actions/variables/{name}/repositories/{repository_id}/delete(actions/remove-selected-repo-from-org-variable)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - public static var conflict: Self { - .conflict(.init()) - } - /// The associated value of the enum case if `self` is `.conflict`. - /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Operations.ActionsRemoveSelectedRepoFromOrgVariable.Output.Conflict { - get throws { - switch self { - case let .conflict(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "conflict", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// List artifacts for a repository - /// - /// Lists all artifacts for a repository. + /// Download an artifact /// - /// Anyone with read access to the repository can use this endpoint. + /// Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in + /// the response header to find the URL for the download. The `:archive_format` must be `zip`. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/get(actions/list-artifacts-for-repo)`. - public enum ActionsListArtifactsForRepo { - public static let id: Swift.String = "actions/list-artifacts-for-repo" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)`. + public enum ActionsDownloadArtifact { + public static let id: Swift.String = "actions/download-artifact" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path/repo`. public var repo: Components.Parameters.Repo + /// The unique identifier of the artifact. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path/artifact_id`. + public var artifactId: Components.Parameters.ArtifactId + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path/archive_format`. + public var archiveFormat: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - artifactId: The unique identifier of the artifact. + /// - archiveFormat: public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo + repo: Components.Parameters.Repo, + artifactId: Components.Parameters.ArtifactId, + archiveFormat: Swift.String ) { self.owner = owner self.repo = repo + self.artifactId = artifactId + self.archiveFormat = archiveFormat } } - public var path: Operations.ActionsListArtifactsForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/query/page`. - public var page: Components.Parameters.Page? - /// The name field of an artifact. When specified, only artifacts with this name will be returned. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/query/name`. - public var name: Components.Parameters.ArtifactName? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." - /// - name: The name field of an artifact. When specified, only artifacts with this name will be returned. - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil, - name: Components.Parameters.ArtifactName? = nil - ) { - self.perPage = perPage - self.page = page - self.name = name - } - } - public var query: Operations.ActionsListArtifactsForRepo.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/header`. + public var path: Operations.ActionsDownloadArtifact.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ActionsListArtifactsForRepo.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.ActionsListArtifactsForRepo.Input.Path, - query: Operations.ActionsListArtifactsForRepo.Input.Query = .init(), - headers: Operations.ActionsListArtifactsForRepo.Input.Headers = .init() - ) { - self.path = path - self.query = query - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ActionsListArtifactsForRepo.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/json/artifacts`. - public var artifacts: [Components.Schemas.Artifact] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - artifacts: - public init( - totalCount: Swift.Int, - artifacts: [Components.Schemas.Artifact] - ) { - self.totalCount = totalCount - self.artifacts = artifacts - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case artifacts - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListArtifactsForRepo.Output.Ok.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsDownloadArtifact.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ActionsDownloadArtifact.Input.Path, + headers: Operations.ActionsDownloadArtifact.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Found: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/responses/302/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/responses/302/headers/Location`. + public var location: Components.Headers.Location? + /// Creates a new `Headers`. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.ActionsListArtifactsForRepo.Output.Ok.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } + /// - Parameters: + /// - location: + public init(location: Components.Headers.Location? = nil) { + self.location = location } } - /// Received HTTP response body - public var body: Operations.ActionsListArtifactsForRepo.Output.Ok.Body - /// Creates a new `Ok`. + /// Received HTTP response headers + public var headers: Operations.ActionsDownloadArtifact.Output.Found.Headers + /// Creates a new `Found`. /// /// - Parameters: /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ActionsListArtifactsForRepo.Output.Ok.Headers = .init(), - body: Operations.ActionsListArtifactsForRepo.Output.Ok.Body - ) { + public init(headers: Operations.ActionsDownloadArtifact.Output.Found.Headers = .init()) { self.headers = headers - self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/get(actions/list-artifacts-for-repo)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)/responses/302`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListArtifactsForRepo.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `302 found`. + case found(Operations.ActionsDownloadArtifact.Output.Found) + /// The associated value of the enum case if `self` is `.found`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListArtifactsForRepo.Output.Ok { + /// - Throws: An error if `self` is not `.found`. + /// - SeeAlso: `.found`. + public var found: Operations.ActionsDownloadArtifact.Output.Found { get throws { switch self { - case let .ok(response): + case let .found(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "found", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", response: self ) } @@ -21079,70 +26080,64 @@ public enum Operations { } } } - /// Get an artifact + /// Get GitHub Actions cache usage for a repository /// - /// Gets a specific artifact for a workflow run. + /// Gets GitHub Actions cache usage for a repository. + /// The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. /// /// Anyone with read access to the repository can use this endpoint. /// /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/get(actions/get-artifact)`. - public enum ActionsGetArtifact { - public static let id: Swift.String = "actions/get-artifact" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/usage`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/usage/get(actions/get-actions-cache-usage)`. + public enum ActionsGetActionsCacheUsage { + public static let id: Swift.String = "actions/get-actions-cache-usage" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the artifact. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/path/artifact_id`. - public var artifactId: Components.Parameters.ArtifactId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - artifactId: The unique identifier of the artifact. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - artifactId: Components.Parameters.ArtifactId + repo: Components.Parameters.Repo ) { self.owner = owner self.repo = repo - self.artifactId = artifactId } } - public var path: Operations.ActionsGetArtifact.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/header`. + public var path: Operations.ActionsGetActionsCacheUsage.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetArtifact.Input.Headers + public var headers: Operations.ActionsGetActionsCacheUsage.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetArtifact.Input.Path, - headers: Operations.ActionsGetArtifact.Input.Headers = .init() + path: Operations.ActionsGetActionsCacheUsage.Input.Path, + headers: Operations.ActionsGetActionsCacheUsage.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -21150,15 +26145,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Artifact) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsCacheUsageByRepository) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Artifact { + public var json: Components.Schemas.ActionsCacheUsageByRepository { get throws { switch self { case let .json(body): @@ -21168,26 +26163,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetArtifact.Output.Ok.Body + public var body: Operations.ActionsGetActionsCacheUsage.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetArtifact.Output.Ok.Body) { + public init(body: Operations.ActionsGetActionsCacheUsage.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/get(actions/get-artifact)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/usage/get(actions/get-actions-cache-usage)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetArtifact.Output.Ok) + case ok(Operations.ActionsGetActionsCacheUsage.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetArtifact.Output.Ok { + public var ok: Operations.ActionsGetActionsCacheUsage.Output.Ok { get throws { switch self { case let .ok(response): @@ -21213,253 +26208,216 @@ public enum Operations { case "application/json": self = .json default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete an artifact - /// - /// Deletes an artifact for a workflow run. - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)`. - public enum ActionsDeleteArtifact { - public static let id: Swift.String = "actions/delete-artifact" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/DELETE/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/DELETE/path/repo`. - public var repo: Components.Parameters.Repo - /// The unique identifier of the artifact. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/DELETE/path/artifact_id`. - public var artifactId: Components.Parameters.ArtifactId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - artifactId: The unique identifier of the artifact. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - artifactId: Components.Parameters.ArtifactId - ) { - self.owner = owner - self.repo = repo - self.artifactId = artifactId - } - } - public var path: Operations.ActionsDeleteArtifact.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.ActionsDeleteArtifact.Input.Path) { - self.path = path - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsDeleteArtifact.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/delete(actions/delete-artifact)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsDeleteArtifact.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } + self = .other(rawValue) } } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } } } - /// Download an artifact + /// List GitHub Actions caches for a repository /// - /// Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in - /// the response header to find the URL for the download. The `:archive_format` must be `zip`. + /// Lists the GitHub Actions caches for a repository. /// /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)`. - public enum ActionsDownloadArtifact { - public static let id: Swift.String = "actions/download-artifact" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/caches`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/get(actions/get-actions-cache-list)`. + public enum ActionsGetActionsCacheList { + public static let id: Swift.String = "actions/get-actions-cache-list" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the artifact. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path/artifact_id`. - public var artifactId: Components.Parameters.ArtifactId - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/path/archive_format`. - public var archiveFormat: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - artifactId: The unique identifier of the artifact. - /// - archiveFormat: public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - artifactId: Components.Parameters.ArtifactId, - archiveFormat: Swift.String + repo: Components.Parameters.Repo ) { self.owner = owner self.repo = repo - self.artifactId = artifactId - self.archiveFormat = archiveFormat } } - public var path: Operations.ActionsDownloadArtifact.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/header`. + public var path: Operations.ActionsGetActionsCacheList.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/page`. + public var page: Components.Parameters.Page? + /// The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/ref`. + public var ref: Components.Parameters.ActionsCacheGitRefFull? + /// An explicit key or prefix for identifying the cache + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/key`. + public var key: Components.Parameters.ActionsCacheKey? + /// - Remark: Generated from `#/components/parameters/actions-cache-list-sort`. + @frozen public enum ActionsCacheListSort: String, Codable, Hashable, Sendable, CaseIterable { + case createdAt = "created_at" + case lastAccessedAt = "last_accessed_at" + case sizeInBytes = "size_in_bytes" + } + /// The property to sort the results by. `created_at` means when the cache was created. `last_accessed_at` means when the cache was last accessed. `size_in_bytes` is the size of the cache in bytes. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/sort`. + public var sort: Components.Parameters.ActionsCacheListSort? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/direction`. + public var direction: Components.Parameters.Direction? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + /// - ref: The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. + /// - key: An explicit key or prefix for identifying the cache + /// - sort: The property to sort the results by. `created_at` means when the cache was created. `last_accessed_at` means when the cache was last accessed. `size_in_bytes` is the size of the cache in bytes. + /// - direction: The direction to sort the results by. + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil, + ref: Components.Parameters.ActionsCacheGitRefFull? = nil, + key: Components.Parameters.ActionsCacheKey? = nil, + sort: Components.Parameters.ActionsCacheListSort? = nil, + direction: Components.Parameters.Direction? = nil + ) { + self.perPage = perPage + self.page = page + self.ref = ref + self.key = key + self.sort = sort + self.direction = direction + } + } + public var query: Operations.ActionsGetActionsCacheList.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsDownloadArtifact.Input.Headers + public var headers: Operations.ActionsGetActionsCacheList.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ActionsDownloadArtifact.Input.Path, - headers: Operations.ActionsDownloadArtifact.Input.Headers = .init() + path: Operations.ActionsGetActionsCacheList.Input.Path, + query: Operations.ActionsGetActionsCacheList.Input.Query = .init(), + headers: Operations.ActionsGetActionsCacheList.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Found: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/responses/302/headers`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/GET/responses/302/headers/Location`. - public var location: Components.Headers.Location? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? /// Creates a new `Headers`. /// /// - Parameters: - /// - location: - public init(location: Components.Headers.Location? = nil) { - self.location = location + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link } } /// Received HTTP response headers - public var headers: Operations.ActionsDownloadArtifact.Output.Found.Headers - /// Creates a new `Found`. + public var headers: Operations.ActionsGetActionsCacheList.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsCacheList) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ActionsCacheList { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetActionsCacheList.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers - public init(headers: Operations.ActionsDownloadArtifact.Output.Found.Headers = .init()) { + /// - body: Received HTTP response body + public init( + headers: Operations.ActionsGetActionsCacheList.Output.Ok.Headers = .init(), + body: Operations.ActionsGetActionsCacheList.Output.Ok.Body + ) { self.headers = headers + self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)/responses/302`. - /// - /// HTTP response code: `302 found`. - case found(Operations.ActionsDownloadArtifact.Output.Found) - /// The associated value of the enum case if `self` is `.found`. - /// - /// - Throws: An error if `self` is not `.found`. - /// - SeeAlso: `.found`. - public var found: Operations.ActionsDownloadArtifact.Output.Found { - get throws { - switch self { - case let .found(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "found", - response: self - ) - } - } - } - /// Gone - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}/get(actions/download-artifact)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/get(actions/get-actions-cache-list)/responses/200`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetActionsCacheList.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetActionsCacheList.Output.Ok { get throws { switch self { - case let .gone(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "ok", response: self ) } @@ -21496,80 +26454,104 @@ public enum Operations { } } } - /// Get GitHub Actions cache usage for a repository - /// - /// Gets GitHub Actions cache usage for a repository. - /// The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. + /// Delete GitHub Actions caches for a repository (using a cache key) /// - /// Anyone with read access to the repository can use this endpoint. + /// Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref. /// - /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/cache/usage`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/usage/get(actions/get-actions-cache-usage)`. - public enum ActionsGetActionsCacheUsage { - public static let id: Swift.String = "actions/get-actions-cache-usage" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/delete(actions/delete-actions-cache-by-key)`. + public enum ActionsDeleteActionsCacheByKey { + public static let id: Swift.String = "actions/delete-actions-cache-by-key" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/path/repo`. - public var repo: Components.Parameters.Repo - /// Creates a new `Path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ActionsDeleteActionsCacheByKey.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/query`. + public struct Query: Sendable, Hashable { + /// A key for identifying the cache. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/query/key`. + public var key: Components.Parameters.ActionsCacheKeyRequired + /// The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/query/ref`. + public var ref: Components.Parameters.ActionsCacheGitRefFull? + /// Creates a new `Query`. /// /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - key: A key for identifying the cache. + /// - ref: The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo + key: Components.Parameters.ActionsCacheKeyRequired, + ref: Components.Parameters.ActionsCacheGitRefFull? = nil ) { - self.owner = owner - self.repo = repo + self.key = key + self.ref = ref } } - public var path: Operations.ActionsGetActionsCacheUsage.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/header`. + public var query: Operations.ActionsDeleteActionsCacheByKey.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetActionsCacheUsage.Input.Headers + public var headers: Operations.ActionsDeleteActionsCacheByKey.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ActionsGetActionsCacheUsage.Input.Path, - headers: Operations.ActionsGetActionsCacheUsage.Input.Headers = .init() + path: Operations.ActionsDeleteActionsCacheByKey.Input.Path, + query: Operations.ActionsDeleteActionsCacheByKey.Input.Query, + headers: Operations.ActionsDeleteActionsCacheByKey.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/cache/usage/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsCacheUsageByRepository) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsCacheList) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActionsCacheUsageByRepository { + public var json: Components.Schemas.ActionsCacheList { get throws { switch self { case let .json(body): @@ -21579,26 +26561,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetActionsCacheUsage.Output.Ok.Body + public var body: Operations.ActionsDeleteActionsCacheByKey.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetActionsCacheUsage.Output.Ok.Body) { + public init(body: Operations.ActionsDeleteActionsCacheByKey.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/cache/usage/get(actions/get-actions-cache-usage)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/delete(actions/delete-actions-cache-by-key)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetActionsCacheUsage.Output.Ok) + case ok(Operations.ActionsDeleteActionsCacheByKey.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetActionsCacheUsage.Output.Ok { + public var ok: Operations.ActionsDeleteActionsCacheByKey.Output.Ok { get throws { switch self { case let .ok(response): @@ -21642,157 +26624,178 @@ public enum Operations { } } } - /// List GitHub Actions caches for a repository + /// Delete a GitHub Actions cache for a repository (using a cache ID) /// - /// Lists the GitHub Actions caches for a repository. + /// Deletes a GitHub Actions cache for a repository, using a cache ID. /// /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/caches`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/get(actions/get-actions-cache-list)`. - public enum ActionsGetActionsCacheList { - public static let id: Swift.String = "actions/get-actions-cache-list" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)`. + public enum ActionsDeleteActionsCacheById { + public static let id: Swift.String = "actions/delete-actions-cache-by-id" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/{cache_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/{cache_id}/DELETE/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/{cache_id}/DELETE/path/repo`. public var repo: Components.Parameters.Repo + /// The unique identifier of the GitHub Actions cache. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/{cache_id}/DELETE/path/cache_id`. + public var cacheId: Components.Parameters.CacheId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - cacheId: The unique identifier of the GitHub Actions cache. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo + repo: Components.Parameters.Repo, + cacheId: Components.Parameters.CacheId ) { self.owner = owner self.repo = repo + self.cacheId = cacheId } } - public var path: Operations.ActionsGetActionsCacheList.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/page`. - public var page: Components.Parameters.Page? - /// The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/ref`. - public var ref: Components.Parameters.ActionsCacheGitRefFull? - /// An explicit key or prefix for identifying the cache - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/key`. - public var key: Components.Parameters.ActionsCacheKey? - /// - Remark: Generated from `#/components/parameters/actions-cache-list-sort`. - @frozen public enum ActionsCacheListSort: String, Codable, Hashable, Sendable, CaseIterable { - case createdAt = "created_at" - case lastAccessedAt = "last_accessed_at" - case sizeInBytes = "size_in_bytes" + public var path: Operations.ActionsDeleteActionsCacheById.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsDeleteActionsCacheById.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsDeleteActionsCacheById.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsDeleteActionsCacheById.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } } - /// The property to sort the results by. `created_at` means when the cache was created. `last_accessed_at` means when the cache was last accessed. `size_in_bytes` is the size of the cache in bytes. + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Get a job for a workflow run + /// + /// Gets a specific job in a workflow run. + /// + /// Anyone with read access to the repository can use this endpoint. + /// + /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/get(actions/get-job-for-workflow-run)`. + public enum ActionsGetJobForWorkflowRun { + public static let id: Swift.String = "actions/get-job-for-workflow-run" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/sort`. - public var sort: Components.Parameters.ActionsCacheListSort? - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The direction to sort the results by. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// Creates a new `Query`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the job. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/path/job_id`. + public var jobId: Components.Parameters.JobId + /// Creates a new `Path`. /// /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." - /// - ref: The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. - /// - key: An explicit key or prefix for identifying the cache - /// - sort: The property to sort the results by. `created_at` means when the cache was created. `last_accessed_at` means when the cache was last accessed. `size_in_bytes` is the size of the cache in bytes. - /// - direction: The direction to sort the results by. + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - jobId: The unique identifier of the job. public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil, - ref: Components.Parameters.ActionsCacheGitRefFull? = nil, - key: Components.Parameters.ActionsCacheKey? = nil, - sort: Components.Parameters.ActionsCacheListSort? = nil, - direction: Components.Parameters.Direction? = nil + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + jobId: Components.Parameters.JobId ) { - self.perPage = perPage - self.page = page - self.ref = ref - self.key = key - self.sort = sort - self.direction = direction + self.owner = owner + self.repo = repo + self.jobId = jobId } } - public var query: Operations.ActionsGetActionsCacheList.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/header`. + public var path: Operations.ActionsGetJobForWorkflowRun.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetActionsCacheList.Input.Headers + public var headers: Operations.ActionsGetJobForWorkflowRun.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsGetActionsCacheList.Input.Path, - query: Operations.ActionsGetActionsCacheList.Input.Query = .init(), - headers: Operations.ActionsGetActionsCacheList.Input.Headers = .init() + path: Operations.ActionsGetJobForWorkflowRun.Input.Path, + headers: Operations.ActionsGetJobForWorkflowRun.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ActionsGetActionsCacheList.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsCacheList) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.Job) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActionsCacheList { + public var json: Components.Schemas.Job { get throws { switch self { case let .json(body): @@ -21802,31 +26805,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetActionsCacheList.Output.Ok.Body + public var body: Operations.ActionsGetJobForWorkflowRun.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ActionsGetActionsCacheList.Output.Ok.Headers = .init(), - body: Operations.ActionsGetActionsCacheList.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ActionsGetJobForWorkflowRun.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/get(actions/get-actions-cache-list)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/get(actions/get-job-for-workflow-run)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetActionsCacheList.Output.Ok) + case ok(Operations.ActionsGetJobForWorkflowRun.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetActionsCacheList.Output.Ok { + public var ok: Operations.ActionsGetJobForWorkflowRun.Output.Ok { get throws { switch self { case let .ok(response): @@ -21870,104 +26868,216 @@ public enum Operations { } } } - /// Delete GitHub Actions caches for a repository (using a cache key) + /// Download job logs for a workflow run /// - /// Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref. + /// Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look + /// for `Location:` in the response header to find the URL for the download. /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// Anyone with read access to the repository can use this endpoint. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/delete(actions/delete-actions-cache-by-key)`. - public enum ActionsDeleteActionsCacheByKey { - public static let id: Swift.String = "actions/delete-actions-cache-by-key" + /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/logs/get(actions/download-job-logs-for-workflow-run)`. + public enum ActionsDownloadJobLogsForWorkflowRun { + public static let id: Swift.String = "actions/download-job-logs-for-workflow-run" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/path/repo`. public var repo: Components.Parameters.Repo + /// The unique identifier of the job. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/path/job_id`. + public var jobId: Components.Parameters.JobId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - jobId: The unique identifier of the job. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo + repo: Components.Parameters.Repo, + jobId: Components.Parameters.JobId ) { self.owner = owner self.repo = repo + self.jobId = jobId } } - public var path: Operations.ActionsDeleteActionsCacheByKey.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/query`. - public struct Query: Sendable, Hashable { - /// A key for identifying the cache. + public var path: Operations.ActionsDownloadJobLogsForWorkflowRun.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.ActionsDownloadJobLogsForWorkflowRun.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Found: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/responses/302/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/responses/302/headers/Location`. + public var location: Swift.String? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - location: + public init(location: Swift.String? = nil) { + self.location = location + } + } + /// Received HTTP response headers + public var headers: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found.Headers + /// Creates a new `Found`. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/query/key`. - public var key: Components.Parameters.ActionsCacheKeyRequired - /// The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. + /// - Parameters: + /// - headers: Received HTTP response headers + public init(headers: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found.Headers = .init()) { + self.headers = headers + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/logs/get(actions/download-job-logs-for-workflow-run)/responses/302`. + /// + /// HTTP response code: `302 found`. + case found(Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found) + /// The associated value of the enum case if `self` is `.found`. + /// + /// - Throws: An error if `self` is not `.found`. + /// - SeeAlso: `.found`. + public var found: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found { + get throws { + switch self { + case let .found(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "found", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Re-run a job from a workflow run + /// + /// Re-run a job and its dependent jobs in a workflow run. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)`. + public enum ActionsReRunJobForWorkflowRun { + public static let id: Swift.String = "actions/re-run-job-for-workflow-run" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/query/ref`. - public var ref: Components.Parameters.ActionsCacheGitRefFull? - /// Creates a new `Query`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the job. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/path/job_id`. + public var jobId: Components.Parameters.JobId + /// Creates a new `Path`. /// /// - Parameters: - /// - key: A key for identifying the cache. - /// - ref: The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - jobId: The unique identifier of the job. public init( - key: Components.Parameters.ActionsCacheKeyRequired, - ref: Components.Parameters.ActionsCacheGitRefFull? = nil + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + jobId: Components.Parameters.JobId ) { - self.key = key - self.ref = ref + self.owner = owner + self.repo = repo + self.jobId = jobId } } - public var query: Operations.ActionsDeleteActionsCacheByKey.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/header`. + public var path: Operations.ActionsReRunJobForWorkflowRun.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsDeleteActionsCacheByKey.Input.Headers + public var headers: Operations.ActionsReRunJobForWorkflowRun.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Whether to enable debug logging for the re-run. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody/json/enable_debug_logging`. + public var enableDebugLogging: Swift.Bool? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enableDebugLogging: Whether to enable debug logging for the re-run. + public init(enableDebugLogging: Swift.Bool? = nil) { + self.enableDebugLogging = enableDebugLogging + } + public enum CodingKeys: String, CodingKey { + case enableDebugLogging = "enable_debug_logging" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody/content/application\/json`. + case json(Operations.ActionsReRunJobForWorkflowRun.Input.Body.JsonPayload) + } + public var body: Operations.ActionsReRunJobForWorkflowRun.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ActionsDeleteActionsCacheByKey.Input.Path, - query: Operations.ActionsDeleteActionsCacheByKey.Input.Query, - headers: Operations.ActionsDeleteActionsCacheByKey.Input.Headers = .init() + path: Operations.ActionsReRunJobForWorkflowRun.Input.Path, + headers: Operations.ActionsReRunJobForWorkflowRun.Input.Headers = .init(), + body: Operations.ActionsReRunJobForWorkflowRun.Input.Body? = nil ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/DELETE/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsCacheList) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/responses/201/content/application\/json`. + case json(Components.Schemas.EmptyObject) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActionsCacheList { + public var json: Components.Schemas.EmptyObject { get throws { switch self { case let .json(body): @@ -21977,33 +27087,56 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsDeleteActionsCacheByKey.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.ActionsReRunJobForWorkflowRun.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsDeleteActionsCacheByKey.Output.Ok.Body) { + public init(body: Operations.ActionsReRunJobForWorkflowRun.Output.Created.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/delete(actions/delete-actions-cache-by-key)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsDeleteActionsCacheByKey.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.ActionsReRunJobForWorkflowRun.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsDeleteActionsCacheByKey.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ActionsReRunJobForWorkflowRun.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .ok(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "forbidden", response: self ) } @@ -22040,87 +27173,159 @@ public enum Operations { } } } - /// Delete a GitHub Actions cache for a repository (using a cache ID) + /// Get the customization template for an OIDC subject claim for a repository /// - /// Deletes a GitHub Actions cache for a repository, using a cache ID. + /// Gets the customization template for an OpenID Connect (OIDC) subject claim. /// /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)`. - public enum ActionsDeleteActionsCacheById { - public static let id: Swift.String = "actions/delete-actions-cache-by-id" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/oidc/customization/sub`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)`. + public enum ActionsGetCustomOidcSubClaimForRepo { + public static let id: Swift.String = "actions/get-custom-oidc-sub-claim-for-repo" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/{cache_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/{cache_id}/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/{cache_id}/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the GitHub Actions cache. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/caches/{cache_id}/DELETE/path/cache_id`. - public var cacheId: Components.Parameters.CacheId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - cacheId: The unique identifier of the GitHub Actions cache. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - cacheId: Components.Parameters.CacheId + repo: Components.Parameters.Repo ) { self.owner = owner self.repo = repo - self.cacheId = cacheId } } - public var path: Operations.ActionsDeleteActionsCacheById.Input.Path + public var path: Operations.ActionsGetCustomOidcSubClaimForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsGetCustomOidcSubClaimForRepo.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsDeleteActionsCacheById.Input.Path) { + /// - headers: + public init( + path: Operations.ActionsGetCustomOidcSubClaimForRepo.Input.Path, + headers: Operations.ActionsGetCustomOidcSubClaimForRepo.Input.Headers = .init() + ) { self.path = path + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/responses/200/content/application\/json`. + case json(Components.Schemas.OidcCustomSubRepo) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.OidcCustomSubRepo { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok.Body) { + self.body = body + } } - /// Response + /// Status response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)/responses/200`. /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsDeleteActionsCacheById.Output.NoContent) - /// Response + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/caches/{cache_id}/delete(actions/delete-actions-cache-by-id)/responses/204`. + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } } - /// The associated value of the enum case if `self` is `.noContent`. + /// Resource not found /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsDeleteActionsCacheById.Output.NoContent { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .noContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "notFound", response: self ) } @@ -22131,87 +27336,147 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } } - /// Get a job for a workflow run - /// - /// Gets a specific job in a workflow run. + /// Set the customization template for an OIDC subject claim for a repository /// - /// Anyone with read access to the repository can use this endpoint. + /// Sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository. /// - /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/get(actions/get-job-for-workflow-run)`. - public enum ActionsGetJobForWorkflowRun { - public static let id: Swift.String = "actions/get-job-for-workflow-run" + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/oidc/customization/sub`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)`. + public enum ActionsSetCustomOidcSubClaimForRepo { + public static let id: Swift.String = "actions/set-custom-oidc-sub-claim-for-repo" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the job. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/path/job_id`. - public var jobId: Components.Parameters.JobId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - jobId: The unique identifier of the job. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - jobId: Components.Parameters.JobId + repo: Components.Parameters.Repo ) { self.owner = owner self.repo = repo - self.jobId = jobId } } - public var path: Operations.ActionsGetJobForWorkflowRun.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/header`. + public var path: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetJobForWorkflowRun.Input.Headers + public var headers: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// Actions OIDC subject customization for a repository + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json/use_default`. + public var useDefault: Swift.Bool + /// Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json/include_claim_keys`. + public var includeClaimKeys: [Swift.String]? + /// 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. + public init( + useDefault: Swift.Bool, + includeClaimKeys: [Swift.String]? = nil + ) { + self.useDefault = useDefault + self.includeClaimKeys = includeClaimKeys + } + public enum CodingKeys: String, CodingKey { + case useDefault = "use_default" + case includeClaimKeys = "include_claim_keys" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Body.JsonPayload) + } + public var body: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.ActionsGetJobForWorkflowRun.Input.Path, - headers: Operations.ActionsGetJobForWorkflowRun.Input.Headers = .init() + path: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Path, + headers: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Headers = .init(), + body: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Job) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/responses/201/content/application\/json`. + case json(Components.Schemas.EmptyObject) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Job { + public var json: Components.Schemas.EmptyObject { get throws { switch self { case let .json(body): @@ -22221,33 +27486,102 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetJobForWorkflowRun.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetJobForWorkflowRun.Output.Ok.Body) { + public init(body: Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created.Body) { self.body = body } } - /// Response + /// Empty response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/get(actions/get-job-for-workflow-run)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetJobForWorkflowRun.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetJobForWorkflowRun.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", response: self ) } @@ -22260,11 +27594,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -22275,225 +27612,156 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Download job logs for a workflow run - /// - /// Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look - /// for `Location:` in the response header to find the URL for the download. - /// - /// Anyone with read access to the repository can use this endpoint. - /// - /// If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// List repository organization secrets /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/logs/get(actions/download-job-logs-for-workflow-run)`. - public enum ActionsDownloadJobLogsForWorkflowRun { - public static let id: Swift.String = "actions/download-job-logs-for-workflow-run" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/path`. - public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/path/repo`. - public var repo: Components.Parameters.Repo - /// The unique identifier of the job. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/path/job_id`. - public var jobId: Components.Parameters.JobId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - jobId: The unique identifier of the job. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - jobId: Components.Parameters.JobId - ) { - self.owner = owner - self.repo = repo - self.jobId = jobId - } - } - public var path: Operations.ActionsDownloadJobLogsForWorkflowRun.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.ActionsDownloadJobLogsForWorkflowRun.Input.Path) { - self.path = path - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Found: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/responses/302/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/logs/GET/responses/302/headers/Location`. - public var location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - location: - public init(location: Swift.String? = nil) { - self.location = location - } - } - /// Received HTTP response headers - public var headers: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found.Headers - /// Creates a new `Found`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - public init(headers: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found.Headers = .init()) { - self.headers = headers - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/logs/get(actions/download-job-logs-for-workflow-run)/responses/302`. - /// - /// HTTP response code: `302 found`. - case found(Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found) - /// The associated value of the enum case if `self` is `.found`. - /// - /// - Throws: An error if `self` is not `.found`. - /// - SeeAlso: `.found`. - public var found: Operations.ActionsDownloadJobLogsForWorkflowRun.Output.Found { - get throws { - switch self { - case let .found(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "found", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// Re-run a job from a workflow run + /// Lists all organization secrets shared with a repository without revealing their encrypted + /// values. /// - /// Re-run a job and its dependent jobs in a workflow run. + /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)`. - public enum ActionsReRunJobForWorkflowRun { - public static let id: Swift.String = "actions/re-run-job-for-workflow-run" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-secrets`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-secrets/get(actions/list-repo-organization-secrets)`. + public enum ActionsListRepoOrganizationSecrets { + public static let id: Swift.String = "actions/list-repo-organization-secrets" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/path/repo`. - public var repo: Components.Parameters.Repo - /// The unique identifier of the job. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/path/job_id`. - public var jobId: Components.Parameters.JobId + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/path/repo`. + public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - jobId: The unique identifier of the job. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - jobId: Components.Parameters.JobId + repo: Components.Parameters.Repo ) { self.owner = owner self.repo = repo - self.jobId = jobId } } - public var path: Operations.ActionsReRunJobForWorkflowRun.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/header`. + public var path: Operations.ActionsListRepoOrganizationSecrets.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ActionsListRepoOrganizationSecrets.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsReRunJobForWorkflowRun.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Whether to enable debug logging for the re-run. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody/json/enable_debug_logging`. - public var enableDebugLogging: Swift.Bool? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - enableDebugLogging: Whether to enable debug logging for the re-run. - public init(enableDebugLogging: Swift.Bool? = nil) { - self.enableDebugLogging = enableDebugLogging - } - public enum CodingKeys: String, CodingKey { - case enableDebugLogging = "enable_debug_logging" - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody/content/application\/json`. - case json(Operations.ActionsReRunJobForWorkflowRun.Input.Body.JsonPayload) - } - public var body: Operations.ActionsReRunJobForWorkflowRun.Input.Body? + public var headers: Operations.ActionsListRepoOrganizationSecrets.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.ActionsReRunJobForWorkflowRun.Input.Path, - headers: Operations.ActionsReRunJobForWorkflowRun.Input.Headers = .init(), - body: Operations.ActionsReRunJobForWorkflowRun.Input.Body? = nil + path: Operations.ActionsListRepoOrganizationSecrets.Input.Path, + query: Operations.ActionsListRepoOrganizationSecrets.Input.Query = .init(), + headers: Operations.ActionsListRepoOrganizationSecrets.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/responses/201/content/application\/json`. - case json(Components.Schemas.EmptyObject) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/json/secrets`. + public var secrets: [Components.Schemas.ActionsSecret] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - secrets: + public init( + totalCount: Swift.Int, + secrets: [Components.Schemas.ActionsSecret] + ) { + self.totalCount = totalCount + self.secrets = secrets + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case secrets + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.EmptyObject { + public var json: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -22503,56 +27771,38 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsReRunJobForWorkflowRun.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ActionsReRunJobForWorkflowRun.Output.Created.Body) { + public init( + headers: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Headers = .init(), + body: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ActionsReRunJobForWorkflowRun.Output.Created) - /// The associated value of the enum case if `self` is `.created`. - /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ActionsReRunJobForWorkflowRun.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/post(actions/re-run-job-for-workflow-run)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-secrets/get(actions/list-repo-organization-secrets)/responses/200`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListRepoOrganizationSecrets.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsListRepoOrganizationSecrets.Output.Ok { get throws { switch self { - case let .forbidden(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "ok", response: self ) } @@ -22589,26 +27839,28 @@ public enum Operations { } } } - /// Get the customization template for an OIDC subject claim for a repository + /// List repository organization variables /// - /// Gets the customization template for an OpenID Connect (OIDC) subject claim. + /// Lists all organization variables shared with a repository. /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// Authenticated users must have collaborator access to a repository to create, update, or read variables. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/oidc/customization/sub`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)`. - public enum ActionsGetCustomOidcSubClaimForRepo { - public static let id: Swift.String = "actions/get-custom-oidc-sub-claim-for-repo" + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-variables/get(actions/list-repo-organization-variables)`. + public enum ActionsListRepoOrganizationVariables { + public static let id: Swift.String = "actions/list-repo-organization-variables" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -22623,43 +27875,107 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsGetCustomOidcSubClaimForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/header`. + public var path: Operations.ActionsListRepoOrganizationVariables.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 30). 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)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/query/per_page`. + public var perPage: Components.Parameters.VariablesPerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 30). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.VariablesPerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ActionsListRepoOrganizationVariables.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetCustomOidcSubClaimForRepo.Input.Headers + public var headers: Operations.ActionsListRepoOrganizationVariables.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ActionsGetCustomOidcSubClaimForRepo.Input.Path, - headers: Operations.ActionsGetCustomOidcSubClaimForRepo.Input.Headers = .init() + path: Operations.ActionsListRepoOrganizationVariables.Input.Path, + query: Operations.ActionsListRepoOrganizationVariables.Input.Query = .init(), + headers: Operations.ActionsListRepoOrganizationVariables.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/GET/responses/200/content/application\/json`. - case json(Components.Schemas.OidcCustomSubRepo) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/json/variables`. + public var variables: [Components.Schemas.ActionsVariable] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - variables: + public init( + totalCount: Swift.Int, + variables: [Components.Schemas.ActionsVariable] + ) { + self.totalCount = totalCount + self.variables = variables + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case variables + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/application\/json`. + case json(Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.OidcCustomSubRepo { + public var json: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -22669,26 +27985,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok.Body + public var body: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok.Body) { + public init( + headers: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Headers = .init(), + body: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body + ) { + self.headers = headers self.body = body } } - /// Status response + /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-variables/get(actions/list-repo-organization-variables)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok) + case ok(Operations.ActionsListRepoOrganizationVariables.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetCustomOidcSubClaimForRepo.Output.Ok { + public var ok: Operations.ActionsListRepoOrganizationVariables.Output.Ok { get throws { switch self { case let .ok(response): @@ -22701,52 +28022,6 @@ public enum Operations { } } } - /// Bad Request - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)/responses/400`. - /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. - /// - /// - Throws: An error if `self` is not `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { - get throws { - switch self { - case let .badRequest(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/get(actions/get-custom-oidc-sub-claim-for-repo)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -22754,14 +28029,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .applicationScimJson default: self = .other(rawValue) } @@ -22772,38 +28044,35 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// Set the customization template for an OIDC subject claim for a repository + /// Get GitHub Actions permissions for a repository /// - /// Sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository. + /// Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/oidc/customization/sub`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)`. - public enum ActionsSetCustomOidcSubClaimForRepo { - public static let id: Swift.String = "actions/set-custom-oidc-sub-claim-for-repo" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/get(actions/get-github-actions-permissions-repository)`. + public enum ActionsGetGithubActionsPermissionsRepository { + public static let id: Swift.String = "actions/get-github-actions-permissions-repository" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -22818,81 +28087,43 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/header`. + public var path: Operations.ActionsGetGithubActionsPermissionsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// Actions OIDC subject customization for a repository - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json/use_default`. - public var useDefault: Swift.Bool - /// Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/json/include_claim_keys`. - public var includeClaimKeys: [Swift.String]? - /// 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. - public init( - useDefault: Swift.Bool, - includeClaimKeys: [Swift.String]? = nil - ) { - self.useDefault = useDefault - self.includeClaimKeys = includeClaimKeys - } - public enum CodingKeys: String, CodingKey { - case useDefault = "use_default" - case includeClaimKeys = "include_claim_keys" - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Body.JsonPayload) - } - public var body: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Body + public var headers: Operations.ActionsGetGithubActionsPermissionsRepository.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Path, - headers: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Headers = .init(), - body: Operations.ActionsSetCustomOidcSubClaimForRepo.Input.Body + path: Operations.ActionsGetGithubActionsPermissionsRepository.Input.Path, + headers: Operations.ActionsGetGithubActionsPermissionsRepository.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/oidc/customization/sub/PUT/responses/201/content/application\/json`. - case json(Components.Schemas.EmptyObject) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsRepositoryPermissions) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.EmptyObject { + public var json: Components.Schemas.ActionsRepositoryPermissions { get throws { switch self { case let .json(body): @@ -22902,102 +28133,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created.Body) { - self.body = body - } - } - /// Empty response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created) - /// The associated value of the enum case if `self` is `.created`. - /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ActionsSetCustomOidcSubClaimForRepo.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Bad Request - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/400`. - /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. - /// - /// - Throws: An error if `self` is not `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { - get throws { - switch self { - case let .badRequest(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", - response: self - ) - } + public var body: Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok.Body) { + self.body = body } } - /// Validation failed, or the endpoint has been spammed. + /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/oidc/customization/sub/put(actions/set-custom-oidc-sub-claim-for-repo)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/get(actions/get-github-actions-permissions-repository)/responses/200`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok { get throws { switch self { - case let .unprocessableContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "ok", response: self ) } @@ -23010,14 +28172,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .applicationScimJson default: self = .other(rawValue) } @@ -23028,41 +28187,35 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// List repository organization secrets - /// - /// Lists all organization secrets shared with a repository without revealing their encrypted - /// values. + /// Set GitHub Actions permissions for a repository /// - /// Authenticated users must have collaborator access to a repository to create, update, or read secrets. + /// Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-secrets`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-secrets/get(actions/list-repo-organization-secrets)`. - public enum ActionsListRepoOrganizationSecrets { - public static let id: Swift.String = "actions/list-repo-organization-secrets" + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)`. + public enum ActionsSetGithubActionsPermissionsRepository { + public static let id: Swift.String = "actions/set-github-actions-permissions-repository" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -23077,107 +28230,170 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsListRepoOrganizationSecrets.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." + public var path: Operations.ActionsSetGithubActionsPermissionsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/json/enabled`. + public var enabled: Components.Schemas.ActionsEnabled + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/json/allowed_actions`. + public var allowedActions: Components.Schemas.AllowedActions? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/json/sha_pinning_required`. + public var shaPinningRequired: Components.Schemas.ShaPinningRequired? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enabled: + /// - allowedActions: + /// - shaPinningRequired: + public init( + enabled: Components.Schemas.ActionsEnabled, + allowedActions: Components.Schemas.AllowedActions? = nil, + shaPinningRequired: Components.Schemas.ShaPinningRequired? = nil + ) { + self.enabled = enabled + self.allowedActions = allowedActions + self.shaPinningRequired = shaPinningRequired + } + public enum CodingKeys: String, CodingKey { + case enabled + case allowedActions = "allowed_actions" + case shaPinningRequired = "sha_pinning_required" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/content/application\/json`. + case json(Operations.ActionsSetGithubActionsPermissionsRepository.Input.Body.JsonPayload) + } + public var body: Operations.ActionsSetGithubActionsPermissionsRepository.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.ActionsSetGithubActionsPermissionsRepository.Input.Path, + body: Operations.ActionsSetGithubActionsPermissionsRepository.Input.Body + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetGithubActionsPermissionsRepository.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsSetGithubActionsPermissionsRepository.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Get the level of access for workflows outside of the repository + /// + /// Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. + /// This endpoint only applies to private repositories. + /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/access`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/get(actions/get-workflow-access-to-repository)`. + public enum ActionsGetWorkflowAccessToRepository { + public static let id: Swift.String = "actions/get-workflow-access-to-repository" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. /// /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo ) { - self.perPage = perPage - self.page = page + self.owner = owner + self.repo = repo } } - public var query: Operations.ActionsListRepoOrganizationSecrets.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/header`. + public var path: Operations.ActionsGetWorkflowAccessToRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsListRepoOrganizationSecrets.Input.Headers + public var headers: Operations.ActionsGetWorkflowAccessToRepository.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsListRepoOrganizationSecrets.Input.Path, - query: Operations.ActionsListRepoOrganizationSecrets.Input.Query = .init(), - headers: Operations.ActionsListRepoOrganizationSecrets.Input.Headers = .init() + path: Operations.ActionsGetWorkflowAccessToRepository.Input.Path, + headers: Operations.ActionsGetWorkflowAccessToRepository.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/json/secrets`. - public var secrets: [Components.Schemas.ActionsSecret] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - secrets: - public init( - totalCount: Swift.Int, - secrets: [Components.Schemas.ActionsSecret] - ) { - self.totalCount = totalCount - self.secrets = secrets - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case secrets - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-secrets/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsWorkflowAccessToRepository) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.ActionsWorkflowAccessToRepository { get throws { switch self { case let .json(body): @@ -23187,31 +28403,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body + public var body: Operations.ActionsGetWorkflowAccessToRepository.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Headers = .init(), - body: Operations.ActionsListRepoOrganizationSecrets.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ActionsGetWorkflowAccessToRepository.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-secrets/get(actions/list-repo-organization-secrets)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/get(actions/get-workflow-access-to-repository)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListRepoOrganizationSecrets.Output.Ok) + case ok(Operations.ActionsGetWorkflowAccessToRepository.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListRepoOrganizationSecrets.Output.Ok { + public var ok: Operations.ActionsGetWorkflowAccessToRepository.Output.Ok { get throws { switch self { case let .ok(response): @@ -23255,28 +28466,28 @@ public enum Operations { } } } - /// List repository organization variables - /// - /// Lists all organization variables shared with a repository. + /// Set the level of access for workflows outside of the repository /// - /// Authenticated users must have collaborator access to a repository to create, update, or read variables. + /// Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. + /// This endpoint only applies to private repositories. + /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)". /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/organization-variables`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-variables/get(actions/list-repo-organization-variables)`. - public enum ActionsListRepoOrganizationVariables { - public static let id: Swift.String = "actions/list-repo-organization-variables" + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/access`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)`. + public enum ActionsSetWorkflowAccessToRepository { + public static let id: Swift.String = "actions/set-workflow-access-to-repository" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -23291,107 +28502,139 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsListRepoOrganizationVariables.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 30). 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)." + public var path: Operations.ActionsSetWorkflowAccessToRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsWorkflowAccessToRepository) + } + public var body: Operations.ActionsSetWorkflowAccessToRepository.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.ActionsSetWorkflowAccessToRepository.Input.Path, + body: Operations.ActionsSetWorkflowAccessToRepository.Input.Body + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetWorkflowAccessToRepository.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsSetWorkflowAccessToRepository.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Get artifact and log retention settings for a repository + /// + /// Gets artifact and log retention settings for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-repository)`. + public enum ActionsGetArtifactAndLogRetentionSettingsRepository { + public static let id: Swift.String = "actions/get-artifact-and-log-retention-settings-repository" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/query/per_page`. - public var perPage: Components.Parameters.VariablesPerPage? - /// The page number of the results to fetch. 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)." + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. /// /// - Parameters: - /// - perPage: The number of results per page (max 30). 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)." - /// - page: The page number of the results to fetch. 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)." + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. public init( - perPage: Components.Parameters.VariablesPerPage? = nil, - page: Components.Parameters.Page? = nil + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo ) { - self.perPage = perPage - self.page = page + self.owner = owner + self.repo = repo } } - public var query: Operations.ActionsListRepoOrganizationVariables.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/header`. + public var path: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsListRepoOrganizationVariables.Input.Headers + public var headers: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ActionsListRepoOrganizationVariables.Input.Path, - query: Operations.ActionsListRepoOrganizationVariables.Input.Query = .init(), - headers: Operations.ActionsListRepoOrganizationVariables.Input.Headers = .init() + path: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input.Path, + headers: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/json/variables`. - public var variables: [Components.Schemas.ActionsVariable] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - variables: - public init( - totalCount: Swift.Int, - variables: [Components.Schemas.ActionsVariable] - ) { - self.totalCount = totalCount - self.variables = variables - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case variables - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/organization-variables/GET/responses/200/content/application\/json`. - case json(Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsArtifactAndLogRetentionResponse) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.ActionsArtifactAndLogRetentionResponse { get throws { switch self { case let .json(body): @@ -23401,38 +28644,238 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body + public var body: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-repository)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ActionsGetArtifactAndLogRetentionSettingsRepository.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/get(actions/get-artifact-and-log-retention-settings-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set artifact and log retention settings for a repository + /// + /// Sets artifact and log retention settings for a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)`. + public enum ActionsSetArtifactAndLogRetentionSettingsRepository { + public static let id: Swift.String = "actions/set-artifact-and-log-retention-settings-repository" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/PUT/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/PUT/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/PUT/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. public init( - headers: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Headers = .init(), - body: Operations.ActionsListRepoOrganizationVariables.Output.Ok.Body + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo ) { - self.headers = headers - self.body = body + self.owner = owner + self.repo = repo } } - /// Response + public var path: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsArtifactAndLogRetention) + } + public var body: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Body + /// Creates a new `Input`. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/organization-variables/get(actions/list-repo-organization-variables)/responses/200`. + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Path, + headers: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Headers = .init(), + body: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Empty response for successful settings update /// - /// HTTP response code: `200 ok`. - case ok(Operations.ActionsListRepoOrganizationVariables.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)/responses/204`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsListRepoOrganizationVariables.Output.Ok { + /// HTTP response code: `204 noContent`. + case noContent(Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Output.NoContent) + /// Empty response for successful settings update + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ActionsSetArtifactAndLogRetentionSettingsRepository.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention/put(actions/set-artifact-and-log-retention-settings-repository)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", response: self ) } @@ -23469,26 +28912,26 @@ public enum Operations { } } } - /// Get GitHub Actions permissions for a repository + /// Get fork PR contributor approval permissions for a repository /// - /// Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository. + /// Gets the fork PR contributor approval policy for a repository. /// - /// OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/get(actions/get-github-actions-permissions-repository)`. - public enum ActionsGetGithubActionsPermissionsRepository { - public static let id: Swift.String = "actions/get-github-actions-permissions-repository" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-repository)`. + public enum ActionsGetForkPrContributorApprovalPermissionsRepository { + public static let id: Swift.String = "actions/get-fork-pr-contributor-approval-permissions-repository" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/GET/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -23503,27 +28946,27 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsGetGithubActionsPermissionsRepository.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/header`. + public var path: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetGithubActionsPermissionsRepository.Input.Headers + public var headers: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetGithubActionsPermissionsRepository.Input.Path, - headers: Operations.ActionsGetGithubActionsPermissionsRepository.Input.Headers = .init() + path: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input.Path, + headers: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -23531,15 +28974,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsRepositoryPermissions) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsForkPrContributorApproval) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActionsRepositoryPermissions { + public var json: Components.Schemas.ActionsForkPrContributorApproval { get throws { switch self { case let .json(body): @@ -23549,26 +28992,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok.Body + public var body: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok.Body) { + public init(body: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/get(actions/get-github-actions-permissions-repository)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-repository)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok) + case ok(Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetGithubActionsPermissionsRepository.Output.Ok { + public var ok: Operations.ActionsGetForkPrContributorApprovalPermissionsRepository.Output.Ok { get throws { switch self { case let .ok(response): @@ -23581,6 +29024,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/get(actions/get-fork-pr-contributor-approval-permissions-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -23612,26 +29078,26 @@ public enum Operations { } } } - /// Set GitHub Actions permissions for a repository + /// Set fork PR contributor approval permissions for a repository /// - /// Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository. + /// Sets the fork PR contributor approval policy for a repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)`. - public enum ActionsSetGithubActionsPermissionsRepository { - public static let id: Swift.String = "actions/set-github-actions-permissions-repository" + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)`. + public enum ActionsSetForkPrContributorApprovalPermissionsRepository { + public static let id: Swift.String = "actions/set-fork-pr-contributor-approval-permissions-repository" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/PUT/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/PUT/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/PUT/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -23646,46 +29112,38 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsSetGithubActionsPermissionsRepository.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/json/enabled`. - public var enabled: Components.Schemas.ActionsEnabled - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/json/allowed_actions`. - public var allowedActions: Components.Schemas.AllowedActions? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - enabled: - /// - allowedActions: - public init( - enabled: Components.Schemas.ActionsEnabled, - allowedActions: Components.Schemas.AllowedActions? = nil - ) { - self.enabled = enabled - self.allowedActions = allowedActions - } - public enum CodingKeys: String, CodingKey { - case enabled - case allowedActions = "allowed_actions" - } + public var path: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/PUT/requestBody/content/application\/json`. - case json(Operations.ActionsSetGithubActionsPermissionsRepository.Input.Body.JsonPayload) } - public var body: Operations.ActionsSetGithubActionsPermissionsRepository.Input.Body + public var headers: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsForkPrContributorApproval) + } + public var body: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - headers: /// - body: public init( - path: Operations.ActionsSetGithubActionsPermissionsRepository.Input.Path, - body: Operations.ActionsSetGithubActionsPermissionsRepository.Input.Body + path: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Path, + headers: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Headers = .init(), + body: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Input.Body ) { self.path = path + self.headers = headers self.body = body } } @@ -23696,13 +29154,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetGithubActionsPermissionsRepository.Output.NoContent) + case noContent(Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/put(actions/set-github-actions-permissions-repository)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -23712,7 +29170,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetGithubActionsPermissionsRepository.Output.NoContent { + public var noContent: Operations.ActionsSetForkPrContributorApprovalPermissionsRepository.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -23725,34 +29183,103 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval/put(actions/set-fork-pr-contributor-approval-permissions-repository)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } - /// Get the level of access for workflows outside of the repository + /// Get private repo fork PR workflow settings for a repository /// - /// Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. - /// This endpoint only applies to private repositories. - /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)." + /// Gets the settings for whether workflows from fork pull requests can run on a private repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/access`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/get(actions/get-workflow-access-to-repository)`. - public enum ActionsGetWorkflowAccessToRepository { - public static let id: Swift.String = "actions/get-workflow-access-to-repository" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-repository)`. + public enum ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository { + public static let id: Swift.String = "actions/get-private-repo-fork-pr-workflows-settings-repository" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/GET/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -23767,27 +29294,27 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsGetWorkflowAccessToRepository.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/header`. + public var path: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ActionsGetWorkflowAccessToRepository.Input.Headers + public var headers: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ActionsGetWorkflowAccessToRepository.Input.Path, - headers: Operations.ActionsGetWorkflowAccessToRepository.Input.Headers = .init() + path: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Path, + headers: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -23795,15 +29322,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsWorkflowAccessToRepository) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsForkPrWorkflowsPrivateRepos) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActionsWorkflowAccessToRepository { + public var json: Components.Schemas.ActionsForkPrWorkflowsPrivateRepos { get throws { switch self { case let .json(body): @@ -23813,26 +29340,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ActionsGetWorkflowAccessToRepository.Output.Ok.Body + public var body: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ActionsGetWorkflowAccessToRepository.Output.Ok.Body) { + public init(body: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/get(actions/get-workflow-access-to-repository)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-repository)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ActionsGetWorkflowAccessToRepository.Output.Ok) + case ok(Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ActionsGetWorkflowAccessToRepository.Output.Ok { + public var ok: Operations.ActionsGetPrivateRepoForkPrWorkflowsSettingsRepository.Output.Ok { get throws { switch self { case let .ok(response): @@ -23845,6 +29372,52 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-repository)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/get(actions/get-private-repo-fork-pr-workflows-settings-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -23876,28 +29449,26 @@ public enum Operations { } } } - /// Set the level of access for workflows outside of the repository + /// Set private repo fork PR workflow settings for a repository /// - /// Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. - /// This endpoint only applies to private repositories. - /// For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)". + /// Sets the settings for whether workflows from fork pull requests can run on a private repository. /// /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/access`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)`. - public enum ActionsSetWorkflowAccessToRepository { - public static let id: Swift.String = "actions/set-workflow-access-to-repository" + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)`. + public enum ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository { + public static let id: Swift.String = "actions/set-private-repo-fork-pr-workflows-settings-repository" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/PUT/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/PUT/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/PUT/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -23912,23 +29483,38 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ActionsSetWorkflowAccessToRepository.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/requestBody`. + public var path: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/access/PUT/requestBody/content/application\/json`. - case json(Components.Schemas.ActionsWorkflowAccessToRepository) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.ActionsForkPrWorkflowsPrivateReposRequest) } - public var body: Operations.ActionsSetWorkflowAccessToRepository.Input.Body + public var body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - headers: /// - body: public init( - path: Operations.ActionsSetWorkflowAccessToRepository.Input.Path, - body: Operations.ActionsSetWorkflowAccessToRepository.Input.Body + path: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Path, + headers: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Headers = .init(), + body: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Input.Body ) { self.path = path + self.headers = headers self.body = body } } @@ -23937,15 +29523,15 @@ public enum Operations { /// Creates a new `NoContent`. public init() {} } - /// Response + /// Empty response for successful settings update /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ActionsSetWorkflowAccessToRepository.Output.NoContent) - /// Response + case noContent(Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Output.NoContent) + /// Empty response for successful settings update /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/access/put(actions/set-workflow-access-to-repository)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -23955,7 +29541,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ActionsSetWorkflowAccessToRepository.Output.NoContent { + public var noContent: Operations.ActionsSetPrivateRepoForkPrWorkflowsSettingsRepository.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -23968,11 +29554,82 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos/put(actions/set-private-repo-fork-pr-workflows-settings-repository)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } /// Get allowed actions and reusable workflows for a repository /// @@ -25593,12 +31250,29 @@ public enum Operations { } } public var path: Operations.ActionsDeleteSelfHostedRunnerFromRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/runners/{runner_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ActionsDeleteSelfHostedRunnerFromRepo.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ActionsDeleteSelfHostedRunnerFromRepo.Input.Path) { + /// - headers: + public init( + path: Operations.ActionsDeleteSelfHostedRunnerFromRepo.Input.Path, + headers: Operations.ActionsDeleteSelfHostedRunnerFromRepo.Input.Headers = .init() + ) { self.path = path + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { @@ -25637,11 +31311,59 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/runners/{runner_id}/delete(actions/delete-self-hosted-runner-from-repo)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } /// List labels for a self-hosted runner for a repository /// diff --git a/Sources/activity/Types.swift b/Sources/activity/Types.swift index 5a72d1db2af..40c706a7b48 100644 --- a/Sources/activity/Types.swift +++ b/Sources/activity/Types.swift @@ -1787,6 +1787,35 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/anonymous_access_enabled`. public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? /// Creates a new `Repository`. /// /// - Parameters: @@ -1885,6 +1914,7 @@ public enum Components { /// - masterBranch: /// - starredAt: /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository public init( id: Swift.Int64, nodeId: Swift.String, @@ -1980,7 +2010,8 @@ public enum Components { watchers: Swift.Int, masterBranch: Swift.String? = nil, starredAt: Swift.String? = nil, - anonymousAccessEnabled: Swift.Bool? = nil + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -2077,6 +2108,7 @@ public enum Components { self.masterBranch = masterBranch self.starredAt = starredAt self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus } public enum CodingKeys: String, CodingKey { case id @@ -2174,6 +2206,7 @@ public enum Components { case masterBranch = "master_branch" case starredAt = "starred_at" case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" } } /// Code Of Conduct @@ -2653,20 +2686,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. public var permissions: Components.Schemas.NullableIntegration.PermissionsPayload - /// The list of events for the GitHub app + /// The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. /// /// - Remark: Generated from `#/components/schemas/nullable-integration/events`. public var events: [Swift.String] - /// The number of installations associated with the GitHub app + /// The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. /// /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. public var installationsCount: Swift.Int? - /// - Remark: Generated from `#/components/schemas/nullable-integration/client_secret`. - public var clientSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/webhook_secret`. - public var webhookSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/pem`. - public var pem: Swift.String? /// Creates a new `NullableIntegration`. /// /// - Parameters: @@ -2682,11 +2709,8 @@ public enum Components { /// - createdAt: /// - updatedAt: /// - permissions: The set of permissions for the GitHub app - /// - events: The list of events for the GitHub app - /// - installationsCount: The number of installations associated with the GitHub app - /// - clientSecret: - /// - webhookSecret: - /// - pem: + /// - events: The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. + /// - installationsCount: The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. public init( id: Swift.Int, slug: Swift.String? = nil, @@ -2701,10 +2725,7 @@ public enum Components { updatedAt: Foundation.Date, permissions: Components.Schemas.NullableIntegration.PermissionsPayload, events: [Swift.String], - installationsCount: Swift.Int? = nil, - clientSecret: Swift.String? = nil, - webhookSecret: Swift.String? = nil, - pem: Swift.String? = nil + installationsCount: Swift.Int? = nil ) { self.id = id self.slug = slug @@ -2720,9 +2741,6 @@ public enum Components { self.permissions = permissions self.events = events self.installationsCount = installationsCount - self.clientSecret = clientSecret - self.webhookSecret = webhookSecret - self.pem = pem } public enum CodingKeys: String, CodingKey { case id @@ -2739,9 +2757,6 @@ public enum Components { case permissions case events case installationsCount = "installations_count" - case clientSecret = "client_secret" - case webhookSecret = "webhook_secret" - case pem } } /// How the author is associated with the repository. @@ -2857,6 +2872,199 @@ public enum Components { case percentCompleted = "percent_completed" } } + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary`. + public struct IssueDependenciesSummary: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocked_by`. + public var blockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocking`. + public var blocking: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocked_by`. + public var totalBlockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocking`. + public var totalBlocking: Swift.Int + /// Creates a new `IssueDependenciesSummary`. + /// + /// - Parameters: + /// - blockedBy: + /// - blocking: + /// - totalBlockedBy: + /// - totalBlocking: + public init( + blockedBy: Swift.Int, + blocking: Swift.Int, + totalBlockedBy: Swift.Int, + totalBlocking: Swift.Int + ) { + self.blockedBy = blockedBy + self.blocking = blocking + self.totalBlockedBy = totalBlockedBy + self.totalBlocking = totalBlocking + } + public enum CodingKeys: String, CodingKey { + case blockedBy = "blocked_by" + case blocking + case totalBlockedBy = "total_blocked_by" + case totalBlocking = "total_blocking" + } + } + /// A value assigned to an issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value`. + public struct IssueFieldValue: Codable, Hashable, Sendable { + /// Unique identifier for the issue field. + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/issue_field_id`. + public var issueFieldId: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/issue-field-value/node_id`. + public var nodeId: Swift.String + /// The data type of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case text = "text" + case singleSelect = "single_select" + case number = "number" + case date = "date" + } + /// The data type of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/data_type`. + public var dataType: Components.Schemas.IssueFieldValue.DataTypePayload + /// The value of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/value`. + public struct ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value1`. + public var value1: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value2`. + public var value2: Swift.Double? + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value3`. + public var value3: Swift.Int? + /// Creates a new `ValuePayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + /// - value3: + public init( + value1: Swift.String? = nil, + value2: Swift.Double? = nil, + value3: Swift.Int? = nil + ) { + self.value1 = value1 + self.value2 = value2 + self.value3 = value3 + } + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self.value1 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + do { + self.value2 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + do { + self.value3 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2, + self.value3 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeFirstNonNilValueToSingleValueContainer([ + self.value1, + self.value2, + self.value3 + ]) + } + } + /// The value of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/value`. + public var value: Components.Schemas.IssueFieldValue.ValuePayload? + /// Details about the selected option (only present for single_select fields) + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option`. + public struct SingleSelectOptionPayload: Codable, Hashable, Sendable { + /// Unique identifier for the option. + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option/id`. + public var id: Swift.Int64 + /// The name of the option + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option/name`. + public var name: Swift.String + /// The color of the option + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option/color`. + public var color: Swift.String + /// Creates a new `SingleSelectOptionPayload`. + /// + /// - Parameters: + /// - id: Unique identifier for the option. + /// - name: The name of the option + /// - color: The color of the option + public init( + id: Swift.Int64, + name: Swift.String, + color: Swift.String + ) { + self.id = id + self.name = name + self.color = color + } + public enum CodingKeys: String, CodingKey { + case id + case name + case color + } + } + /// Details about the selected option (only present for single_select fields) + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option`. + public var singleSelectOption: Components.Schemas.IssueFieldValue.SingleSelectOptionPayload? + /// Creates a new `IssueFieldValue`. + /// + /// - Parameters: + /// - issueFieldId: Unique identifier for the issue field. + /// - nodeId: + /// - dataType: The data type of the issue field + /// - value: The value of the issue field + /// - singleSelectOption: Details about the selected option (only present for single_select fields) + public init( + issueFieldId: Swift.Int64, + nodeId: Swift.String, + dataType: Components.Schemas.IssueFieldValue.DataTypePayload, + value: Components.Schemas.IssueFieldValue.ValuePayload? = nil, + singleSelectOption: Components.Schemas.IssueFieldValue.SingleSelectOptionPayload? = nil + ) { + self.issueFieldId = issueFieldId + self.nodeId = nodeId + self.dataType = dataType + self.value = value + self.singleSelectOption = singleSelectOption + } + public enum CodingKeys: String, CodingKey { + case issueFieldId = "issue_field_id" + case nodeId = "node_id" + case dataType = "data_type" + case value + case singleSelectOption = "single_select_option" + } + } /// Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. /// /// - Remark: Generated from `#/components/schemas/issue`. @@ -2894,6 +3102,7 @@ public enum Components { case completed = "completed" case reopened = "reopened" case notPlanned = "not_planned" + case duplicate = "duplicate" } /// The reason for the current state /// @@ -3083,11 +3292,19 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/issue/performed_via_github_app`. public var performedViaGithubApp: Components.Schemas.NullableIntegration? /// - Remark: Generated from `#/components/schemas/issue/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation + public var authorAssociation: Components.Schemas.AuthorAssociation? /// - Remark: Generated from `#/components/schemas/issue/reactions`. public var reactions: Components.Schemas.ReactionRollup? /// - Remark: Generated from `#/components/schemas/issue/sub_issues_summary`. public var subIssuesSummary: Components.Schemas.SubIssuesSummary? + /// URL to get the parent issue of this issue, if it is a sub-issue + /// + /// - Remark: Generated from `#/components/schemas/issue/parent_issue_url`. + public var parentIssueUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/issue_dependencies_summary`. + public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? + /// - Remark: Generated from `#/components/schemas/issue/issue_field_values`. + public var issueFieldValues: [Components.Schemas.IssueFieldValue]? /// Creates a new `Issue`. /// /// - Parameters: @@ -3127,6 +3344,9 @@ public enum Components { /// - authorAssociation: /// - reactions: /// - subIssuesSummary: + /// - parentIssueUrl: URL to get the parent issue of this issue, if it is a sub-issue + /// - issueDependenciesSummary: + /// - issueFieldValues: public init( id: Swift.Int64, nodeId: Swift.String, @@ -3161,9 +3381,12 @@ public enum Components { _type: Components.Schemas.IssueType? = nil, repository: Components.Schemas.Repository? = nil, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - authorAssociation: Components.Schemas.AuthorAssociation, + authorAssociation: Components.Schemas.AuthorAssociation? = nil, reactions: Components.Schemas.ReactionRollup? = nil, - subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil + subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, + parentIssueUrl: Swift.String? = nil, + issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil, + issueFieldValues: [Components.Schemas.IssueFieldValue]? = nil ) { self.id = id self.nodeId = nodeId @@ -3201,6 +3424,9 @@ public enum Components { self.authorAssociation = authorAssociation self.reactions = reactions self.subIssuesSummary = subIssuesSummary + self.parentIssueUrl = parentIssueUrl + self.issueDependenciesSummary = issueDependenciesSummary + self.issueFieldValues = issueFieldValues } public enum CodingKeys: String, CodingKey { case id @@ -3239,6 +3465,9 @@ public enum Components { case authorAssociation = "author_association" case reactions case subIssuesSummary = "sub_issues_summary" + case parentIssueUrl = "parent_issue_url" + case issueDependenciesSummary = "issue_dependencies_summary" + case issueFieldValues = "issue_field_values" } } /// Comments provide a way for people to collaborate on an issue. @@ -3699,6 +3928,11 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -3719,6 +3953,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -3864,7 +4103,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: @@ -4160,6 +4399,30 @@ public enum Components { public var webCommitSignoffRequired: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/security_and_analysis`. public var securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public struct CustomPropertiesPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CustomPropertiesPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public var customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? /// Creates a new `MinimalRepository`. /// /// - Parameters: @@ -4250,6 +4513,7 @@ public enum Components { /// - allowForking: /// - webCommitSignoffRequired: /// - securityAndAnalysis: + /// - customProperties: The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. public init( id: Swift.Int64, nodeId: Swift.String, @@ -4337,7 +4601,8 @@ public enum Components { watchers: Swift.Int? = nil, allowForking: Swift.Bool? = nil, webCommitSignoffRequired: Swift.Bool? = nil, - securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil + securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil, + customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -4426,6 +4691,7 @@ public enum Components { self.allowForking = allowForking self.webCommitSignoffRequired = webCommitSignoffRequired self.securityAndAnalysis = securityAndAnalysis + self.customProperties = customProperties } public enum CodingKeys: String, CodingKey { case id @@ -4515,6 +4781,7 @@ public enum Components { case allowForking = "allow_forking" case webCommitSignoffRequired = "web_commit_signoff_required" case securityAndAnalysis = "security_and_analysis" + case customProperties = "custom_properties" } } /// Thread @@ -4799,6 +5066,18 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/since`. public typealias Since = Foundation.Date + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/components/parameters/public-events-per-page`. + public typealias PublicEventsPerPage = Swift.Int /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -4823,14 +5102,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/thread-id`. public typealias ThreadId = Swift.Int - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String /// The property to sort the results by. `created` means when the repository was starred. `updated` means when the repository was last pushed to. /// /// - Remark: Generated from `#/components/parameters/sort-starred`. @@ -5069,7 +5340,7 @@ public enum Operations { /// The number of results per page (max 100). 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)." /// /// - Remark: Generated from `#/paths/events/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? + public var perPage: Components.Parameters.PublicEventsPerPage? /// The page number of the results to fetch. 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)." /// /// - Remark: Generated from `#/paths/events/GET/query/page`. @@ -5080,7 +5351,7 @@ public enum Operations { /// - perPage: The number of results per page (max 100). 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)." /// - page: The page number of the results to fetch. 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)." public init( - perPage: Components.Parameters.PerPage? = nil, + perPage: Components.Parameters.PublicEventsPerPage? = nil, page: Components.Parameters.Page? = nil ) { self.perPage = perPage diff --git a/Sources/apps/Client.swift b/Sources/apps/Client.swift index 5b84b15447f..16f3ae909aa 100644 --- a/Sources/apps/Client.swift +++ b/Sources/apps/Client.swift @@ -1006,7 +1006,7 @@ public struct Client: APIProtocol { } /// Delete an installation for the authenticated app /// - /// Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. + /// Uninstalls a GitHub App on a user, organization, or enterprise account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// @@ -1243,7 +1243,7 @@ public struct Client: APIProtocol { } /// Suspend an app installation /// - /// Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. + /// Suspends a GitHub App on a user, organization, or enterprise account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// diff --git a/Sources/apps/Types.swift b/Sources/apps/Types.swift index 1e35c9d7d90..5e7f4791ebf 100644 --- a/Sources/apps/Types.swift +++ b/Sources/apps/Types.swift @@ -99,7 +99,7 @@ public protocol APIProtocol: Sendable { func appsGetInstallation(_ input: Operations.AppsGetInstallation.Input) async throws -> Operations.AppsGetInstallation.Output /// Delete an installation for the authenticated app /// - /// Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. + /// Uninstalls a GitHub App on a user, organization, or enterprise account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// @@ -121,7 +121,7 @@ public protocol APIProtocol: Sendable { func appsCreateInstallationAccessToken(_ input: Operations.AppsCreateInstallationAccessToken.Input) async throws -> Operations.AppsCreateInstallationAccessToken.Output /// Suspend an app installation /// - /// Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. + /// Suspends a GitHub App on a user, organization, or enterprise account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// @@ -496,7 +496,7 @@ extension APIProtocol { } /// Delete an installation for the authenticated app /// - /// Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. + /// Uninstalls a GitHub App on a user, organization, or enterprise account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// @@ -536,7 +536,7 @@ extension APIProtocol { } /// Suspend an app installation /// - /// Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. + /// Suspends a GitHub App on a user, organization, or enterprise account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// @@ -1455,20 +1455,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/integration/permissions`. public var permissions: Components.Schemas.Integration.PermissionsPayload - /// The list of events for the GitHub app + /// The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. /// /// - Remark: Generated from `#/components/schemas/integration/events`. public var events: [Swift.String] - /// The number of installations associated with the GitHub app + /// The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. /// /// - Remark: Generated from `#/components/schemas/integration/installations_count`. public var installationsCount: Swift.Int? - /// - Remark: Generated from `#/components/schemas/integration/client_secret`. - public var clientSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/integration/webhook_secret`. - public var webhookSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/integration/pem`. - public var pem: Swift.String? /// Creates a new `Integration`. /// /// - Parameters: @@ -1484,11 +1478,8 @@ public enum Components { /// - createdAt: /// - updatedAt: /// - permissions: The set of permissions for the GitHub app - /// - events: The list of events for the GitHub app - /// - installationsCount: The number of installations associated with the GitHub app - /// - clientSecret: - /// - webhookSecret: - /// - pem: + /// - events: The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. + /// - installationsCount: The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. public init( id: Swift.Int, slug: Swift.String? = nil, @@ -1503,10 +1494,7 @@ public enum Components { updatedAt: Foundation.Date, permissions: Components.Schemas.Integration.PermissionsPayload, events: [Swift.String], - installationsCount: Swift.Int? = nil, - clientSecret: Swift.String? = nil, - webhookSecret: Swift.String? = nil, - pem: Swift.String? = nil + installationsCount: Swift.Int? = nil ) { self.id = id self.slug = slug @@ -1522,9 +1510,6 @@ public enum Components { self.permissions = permissions self.events = events self.installationsCount = installationsCount - self.clientSecret = clientSecret - self.webhookSecret = webhookSecret - self.pem = pem } public enum CodingKeys: String, CodingKey { case id @@ -1541,9 +1526,6 @@ public enum Components { case permissions case events case installationsCount = "installations_count" - case clientSecret = "client_secret" - case webhookSecret = "webhook_secret" - case pem } } /// The URL to which the payloads will be delivered. @@ -2505,6 +2487,17 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/workflows`. public var workflows: Components.Schemas.AppPermissions.WorkflowsPayload? + /// The level of permission to grant the access token to view and edit custom properties for an organization, when allowed by the property. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/custom_properties_for_organizations`. + @frozen public enum CustomPropertiesForOrganizationsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + } + /// The level of permission to grant the access token to view and edit custom properties for an organization, when allowed by the property. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/custom_properties_for_organizations`. + public var customPropertiesForOrganizations: Components.Schemas.AppPermissions.CustomPropertiesForOrganizationsPayload? /// The level of permission to grant the access token for organization teams and members. /// /// - Remark: Generated from `#/components/schemas/app-permissions/members`. @@ -2549,7 +2542,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_custom_org_roles`. public var organizationCustomOrgRoles: Components.Schemas.AppPermissions.OrganizationCustomOrgRolesPayload? - /// The level of permission to grant the access token for custom property management. + /// The level of permission to grant the access token for repository custom properties management at the organization level. /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_custom_properties`. @frozen public enum OrganizationCustomPropertiesPayload: String, Codable, Hashable, Sendable, CaseIterable { @@ -2557,7 +2550,7 @@ public enum Components { case write = "write" case admin = "admin" } - /// The level of permission to grant the access token for custom property management. + /// The level of permission to grant the access token for repository custom properties management at the organization level. /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_custom_properties`. public var organizationCustomProperties: Components.Schemas.AppPermissions.OrganizationCustomPropertiesPayload? @@ -2778,6 +2771,18 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/starring`. public var starring: Components.Schemas.AppPermissions.StarringPayload? + /// The level of permission to grant the access token for organization custom properties management at the enterprise level. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/enterprise_custom_properties_for_organizations`. + @frozen public enum EnterpriseCustomPropertiesForOrganizationsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + case admin = "admin" + } + /// The level of permission to grant the access token for organization custom properties management at the enterprise level. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/enterprise_custom_properties_for_organizations`. + public var enterpriseCustomPropertiesForOrganizations: Components.Schemas.AppPermissions.EnterpriseCustomPropertiesForOrganizationsPayload? /// Creates a new `AppPermissions`. /// /// - Parameters: @@ -2804,11 +2809,12 @@ public enum Components { /// - statuses: The level of permission to grant the access token for commit statuses. /// - vulnerabilityAlerts: The level of permission to grant the access token to manage Dependabot alerts. /// - workflows: The level of permission to grant the access token to update GitHub Actions workflow files. + /// - customPropertiesForOrganizations: The level of permission to grant the access token to view and edit custom properties for an organization, when allowed by the property. /// - members: The level of permission to grant the access token for organization teams and members. /// - organizationAdministration: The level of permission to grant the access token to manage access to an organization. /// - organizationCustomRoles: The level of permission to grant the access token for custom repository roles management. /// - organizationCustomOrgRoles: The level of permission to grant the access token for custom organization roles management. - /// - organizationCustomProperties: The level of permission to grant the access token for custom property management. + /// - organizationCustomProperties: The level of permission to grant the access token for repository custom properties management at the organization level. /// - organizationCopilotSeatManagement: The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in public preview and is subject to change. /// - organizationAnnouncementBanners: The level of permission to grant the access token to view and manage announcement banners for an organization. /// - organizationEvents: The level of permission to grant the access token to view events triggered by an activity in an organization. @@ -2829,6 +2835,7 @@ public enum Components { /// - interactionLimits: The level of permission to grant the access token to view and manage interaction limits on a repository. /// - profile: The level of permission to grant the access token to manage the profile settings belonging to a user. /// - starring: The level of permission to grant the access token to list and manage repositories a user is starring. + /// - enterpriseCustomPropertiesForOrganizations: The level of permission to grant the access token for organization custom properties management at the enterprise level. public init( actions: Components.Schemas.AppPermissions.ActionsPayload? = nil, administration: Components.Schemas.AppPermissions.AdministrationPayload? = nil, @@ -2853,6 +2860,7 @@ public enum Components { statuses: Components.Schemas.AppPermissions.StatusesPayload? = nil, vulnerabilityAlerts: Components.Schemas.AppPermissions.VulnerabilityAlertsPayload? = nil, workflows: Components.Schemas.AppPermissions.WorkflowsPayload? = nil, + customPropertiesForOrganizations: Components.Schemas.AppPermissions.CustomPropertiesForOrganizationsPayload? = nil, members: Components.Schemas.AppPermissions.MembersPayload? = nil, organizationAdministration: Components.Schemas.AppPermissions.OrganizationAdministrationPayload? = nil, organizationCustomRoles: Components.Schemas.AppPermissions.OrganizationCustomRolesPayload? = nil, @@ -2877,7 +2885,8 @@ public enum Components { gpgKeys: Components.Schemas.AppPermissions.GpgKeysPayload? = nil, interactionLimits: Components.Schemas.AppPermissions.InteractionLimitsPayload? = nil, profile: Components.Schemas.AppPermissions.ProfilePayload? = nil, - starring: Components.Schemas.AppPermissions.StarringPayload? = nil + starring: Components.Schemas.AppPermissions.StarringPayload? = nil, + enterpriseCustomPropertiesForOrganizations: Components.Schemas.AppPermissions.EnterpriseCustomPropertiesForOrganizationsPayload? = nil ) { self.actions = actions self.administration = administration @@ -2902,6 +2911,7 @@ public enum Components { self.statuses = statuses self.vulnerabilityAlerts = vulnerabilityAlerts self.workflows = workflows + self.customPropertiesForOrganizations = customPropertiesForOrganizations self.members = members self.organizationAdministration = organizationAdministration self.organizationCustomRoles = organizationCustomRoles @@ -2927,6 +2937,7 @@ public enum Components { self.interactionLimits = interactionLimits self.profile = profile self.starring = starring + self.enterpriseCustomPropertiesForOrganizations = enterpriseCustomPropertiesForOrganizations } public enum CodingKeys: String, CodingKey { case actions @@ -2952,6 +2963,7 @@ public enum Components { case statuses case vulnerabilityAlerts = "vulnerability_alerts" case workflows + case customPropertiesForOrganizations = "custom_properties_for_organizations" case members case organizationAdministration = "organization_administration" case organizationCustomRoles = "organization_custom_roles" @@ -2977,6 +2989,7 @@ public enum Components { case interactionLimits = "interaction_limits" case profile case starring + case enterpriseCustomPropertiesForOrganizations = "enterprise_custom_properties_for_organizations" } } /// A GitHub user. @@ -3198,6 +3211,8 @@ public enum Components { public var htmlUrl: Swift.String /// - Remark: Generated from `#/components/schemas/installation/app_id`. public var appId: Swift.Int + /// - Remark: Generated from `#/components/schemas/installation/client_id`. + public var clientId: Swift.String? /// The ID of the user or organization this token is being scoped to. /// /// - Remark: Generated from `#/components/schemas/installation/target_id`. @@ -3236,6 +3251,7 @@ public enum Components { /// - repositoriesUrl: /// - htmlUrl: /// - appId: + /// - clientId: /// - targetId: The ID of the user or organization this token is being scoped to. /// - targetType: /// - permissions: @@ -3257,6 +3273,7 @@ public enum Components { repositoriesUrl: Swift.String, htmlUrl: Swift.String, appId: Swift.Int, + clientId: Swift.String? = nil, targetId: Swift.Int, targetType: Swift.String, permissions: Components.Schemas.AppPermissions, @@ -3278,6 +3295,7 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.htmlUrl = htmlUrl self.appId = appId + self.clientId = clientId self.targetId = targetId self.targetType = targetType self.permissions = permissions @@ -3300,6 +3318,7 @@ public enum Components { case repositoriesUrl = "repositories_url" case htmlUrl = "html_url" case appId = "app_id" + case clientId = "client_id" case targetId = "target_id" case targetType = "target_type" case permissions @@ -3715,6 +3734,35 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/anonymous_access_enabled`. public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? /// Creates a new `Repository`. /// /// - Parameters: @@ -3813,6 +3861,7 @@ public enum Components { /// - masterBranch: /// - starredAt: /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository public init( id: Swift.Int64, nodeId: Swift.String, @@ -3908,7 +3957,8 @@ public enum Components { watchers: Swift.Int, masterBranch: Swift.String? = nil, starredAt: Swift.String? = nil, - anonymousAccessEnabled: Swift.Bool? = nil + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -4005,6 +4055,7 @@ public enum Components { self.masterBranch = masterBranch self.starredAt = starredAt self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus } public enum CodingKeys: String, CodingKey { case id @@ -4102,6 +4153,7 @@ public enum Components { case masterBranch = "master_branch" case starredAt = "starred_at" case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" } } /// Authentication token for a GitHub App installed on a user or org. @@ -4769,6 +4821,14 @@ public enum Components { public typealias ClientId = Swift.String /// - Remark: Generated from `#/components/parameters/app-slug`. public typealias AppSlug = Swift.String + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// account_id parameter /// /// - Remark: Generated from `#/components/parameters/account-id`. @@ -4792,18 +4852,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repo`. public typealias Repo = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String /// The unique identifier of the repository. /// /// - Remark: Generated from `#/components/parameters/repository-id`. public typealias RepositoryId = Swift.Int - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} @@ -6810,7 +6862,7 @@ public enum Operations { } /// Delete an installation for the authenticated app /// - /// Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. + /// Uninstalls a GitHub App on a user, organization, or enterprise account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// @@ -7223,7 +7275,7 @@ public enum Operations { } /// Suspend an app installation /// - /// Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. + /// Suspends a GitHub App on a user, organization, or enterprise account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. /// /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. /// diff --git a/Sources/billing/Client.swift b/Sources/billing/Client.swift index fdabab8fdfd..1db7191eeb2 100644 --- a/Sources/billing/Client.swift +++ b/Sources/billing/Client.swift @@ -38,6 +38,233 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } + /// Get billing premium request usage report for an organization + /// + /// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// + /// **Note:** Only data from the past 24 months is accessible via this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`. + public func billingGetGithubBillingPremiumRequestUsageReportOrg(_ input: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Output { + try await client.send( + input: input, + forOperation: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/organizations/{}/settings/billing/premium_request/usage", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "year", + value: input.query.year + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "month", + value: input.query.month + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "day", + value: input.query.day + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "user", + value: input.query.user + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "model", + value: input.query.model + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "product", + value: input.query.product + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BillingPremiumRequestUsageReportOrg.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BillingPremiumRequestUsageReportOrg.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get billing usage report for an organization /// /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. @@ -569,23 +796,21 @@ public struct Client: APIProtocol { } ) } - /// Get shared storage billing for a user - /// - /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. + /// Get billing premium request usage report for a user /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + /// Gets a report of premium request usage for a user. /// - /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. + /// **Note:** Only data from the past 24 months is accessible via this endpoint. /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/shared-storage`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-user)`. - public func billingGetSharedStorageBillingUser(_ input: Operations.BillingGetSharedStorageBillingUser.Input) async throws -> Operations.BillingGetSharedStorageBillingUser.Output { + /// - Remark: HTTP `GET /users/{username}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)`. + public func billingGetGithubBillingPremiumRequestUsageReportUser(_ input: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Output { try await client.send( input: input, - forOperation: Operations.BillingGetSharedStorageBillingUser.id, + forOperation: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/users/{}/settings/billing/shared-storage", + template: "/users/{}/settings/billing/premium_request/usage", parameters: [ input.path.username ] @@ -595,6 +820,41 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "year", + value: input.query.year + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "month", + value: input.query.month + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "day", + value: input.query.day + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "model", + value: input.query.model + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "product", + value: input.query.product + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -605,7 +865,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.BillingGetSharedStorageBillingUser.Output.Ok.Body + let body: Components.Responses.BillingPremiumRequestUsageReportUser.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -615,7 +875,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.CombinedBillingUsage.self, + Components.Schemas.BillingPremiumRequestUsageReportUser.self, from: responseBody, transforming: { value in .json(value) @@ -625,6 +885,384 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get shared storage billing for a user + /// + /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. + /// + /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /users/{username}/settings/billing/shared-storage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-user)`. + public func billingGetSharedStorageBillingUser(_ input: Operations.BillingGetSharedStorageBillingUser.Input) async throws -> Operations.BillingGetSharedStorageBillingUser.Output { + try await client.send( + input: input, + forOperation: Operations.BillingGetSharedStorageBillingUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/settings/billing/shared-storage", + parameters: [ + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.BillingGetSharedStorageBillingUser.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.CombinedBillingUsage.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get billing usage report for a user + /// + /// Gets a report of the total usage for a user. + /// + /// **Note:** This endpoint is only available to users with access to the enhanced billing platform. + /// + /// - Remark: HTTP `GET /users/{username}/settings/billing/usage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)`. + public func billingGetGithubBillingUsageReportUser(_ input: Operations.BillingGetGithubBillingUsageReportUser.Input) async throws -> Operations.BillingGetGithubBillingUsageReportUser.Output { + try await client.send( + input: input, + forOperation: Operations.BillingGetGithubBillingUsageReportUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/settings/billing/usage", + parameters: [ + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "year", + value: input.query.year + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "month", + value: input.query.month + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "day", + value: input.query.day + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "hour", + value: input.query.hour + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BillingUsageReportUser.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BillingUsageReportUser.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/billing/Types.swift b/Sources/billing/Types.swift index 549411ba677..8fca4b3df40 100644 --- a/Sources/billing/Types.swift +++ b/Sources/billing/Types.swift @@ -11,6 +11,15 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { + /// Get billing premium request usage report for an organization + /// + /// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// + /// **Note:** Only data from the past 24 months is accessible via this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`. + func billingGetGithubBillingPremiumRequestUsageReportOrg(_ input: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Output /// Get billing usage report for an organization /// /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. @@ -75,6 +84,15 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /users/{username}/settings/billing/packages`. /// - Remark: Generated from `#/paths//users/{username}/settings/billing/packages/get(billing/get-github-packages-billing-user)`. func billingGetGithubPackagesBillingUser(_ input: Operations.BillingGetGithubPackagesBillingUser.Input) async throws -> Operations.BillingGetGithubPackagesBillingUser.Output + /// Get billing premium request usage report for a user + /// + /// Gets a report of premium request usage for a user. + /// + /// **Note:** Only data from the past 24 months is accessible via this endpoint. + /// + /// - Remark: HTTP `GET /users/{username}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)`. + func billingGetGithubBillingPremiumRequestUsageReportUser(_ input: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Output /// Get shared storage billing for a user /// /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. @@ -86,10 +104,38 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /users/{username}/settings/billing/shared-storage`. /// - Remark: Generated from `#/paths//users/{username}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-user)`. func billingGetSharedStorageBillingUser(_ input: Operations.BillingGetSharedStorageBillingUser.Input) async throws -> Operations.BillingGetSharedStorageBillingUser.Output + /// Get billing usage report for a user + /// + /// Gets a report of the total usage for a user. + /// + /// **Note:** This endpoint is only available to users with access to the enhanced billing platform. + /// + /// - Remark: HTTP `GET /users/{username}/settings/billing/usage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)`. + func billingGetGithubBillingUsageReportUser(_ input: Operations.BillingGetGithubBillingUsageReportUser.Input) async throws -> Operations.BillingGetGithubBillingUsageReportUser.Output } /// Convenience overloads for operation inputs. extension APIProtocol { + /// Get billing premium request usage report for an organization + /// + /// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// + /// **Note:** Only data from the past 24 months is accessible via this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`. + public func billingGetGithubBillingPremiumRequestUsageReportOrg( + path: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Path, + query: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Headers = .init() + ) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Output { + try await billingGetGithubBillingPremiumRequestUsageReportOrg(Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input( + path: path, + query: query, + headers: headers + )) + } /// Get billing usage report for an organization /// /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. @@ -204,6 +250,25 @@ extension APIProtocol { headers: headers )) } + /// Get billing premium request usage report for a user + /// + /// Gets a report of premium request usage for a user. + /// + /// **Note:** Only data from the past 24 months is accessible via this endpoint. + /// + /// - Remark: HTTP `GET /users/{username}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)`. + public func billingGetGithubBillingPremiumRequestUsageReportUser( + path: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Path, + query: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Headers = .init() + ) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Output { + try await billingGetGithubBillingPremiumRequestUsageReportUser(Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input( + path: path, + query: query, + headers: headers + )) + } /// Get shared storage billing for a user /// /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. @@ -223,6 +288,25 @@ extension APIProtocol { headers: headers )) } + /// Get billing usage report for a user + /// + /// Gets a report of the total usage for a user. + /// + /// **Note:** This endpoint is only available to users with access to the enhanced billing platform. + /// + /// - Remark: HTTP `GET /users/{username}/settings/billing/usage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)`. + public func billingGetGithubBillingUsageReportUser( + path: Operations.BillingGetGithubBillingUsageReportUser.Input.Path, + query: Operations.BillingGetGithubBillingUsageReportUser.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingUsageReportUser.Input.Headers = .init() + ) async throws -> Operations.BillingGetGithubBillingUsageReportUser.Output { + try await billingGetGithubBillingUsageReportUser(Operations.BillingGetGithubBillingUsageReportUser.Input( + path: path, + query: query, + headers: headers + )) + } } /// Server URLs defined in the OpenAPI document. @@ -334,6 +418,197 @@ public enum Components { case schemas } } + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org`. + public struct BillingPremiumRequestUsageReportOrg: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod`. + public struct TimePeriodPayload: Codable, Hashable, Sendable { + /// The year for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod/year`. + public var year: Swift.Int + /// The month for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod/month`. + public var month: Swift.Int? + /// The day for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod/day`. + public var day: Swift.Int? + /// Creates a new `TimePeriodPayload`. + /// + /// - Parameters: + /// - year: The year for the usage report. + /// - month: The month for the usage report. + /// - day: The day for the usage report. + public init( + year: Swift.Int, + month: Swift.Int? = nil, + day: Swift.Int? = nil + ) { + self.year = year + self.month = month + self.day = day + } + public enum CodingKeys: String, CodingKey { + case year + case month + case day + } + } + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod`. + public var timePeriod: Components.Schemas.BillingPremiumRequestUsageReportOrg.TimePeriodPayload + /// The unique identifier of the organization. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/organization`. + public var organization: Swift.String + /// The name of the user for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/user`. + public var user: Swift.String? + /// The product for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/product`. + public var product: Swift.String? + /// The model for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/model`. + public var model: Swift.String? + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload`. + public struct UsageItemsPayloadPayload: Codable, Hashable, Sendable { + /// Product name. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/product`. + public var product: Swift.String + /// SKU name. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/sku`. + public var sku: Swift.String + /// Model name. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/model`. + public var model: Swift.String + /// Unit type of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/unitType`. + public var unitType: Swift.String + /// Price per unit of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/pricePerUnit`. + public var pricePerUnit: Swift.Double + /// Gross quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/grossQuantity`. + public var grossQuantity: Swift.Double + /// Gross amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/grossAmount`. + public var grossAmount: Swift.Double + /// Discount quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/discountQuantity`. + public var discountQuantity: Swift.Double + /// Discount amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/discountAmount`. + public var discountAmount: Swift.Double + /// Net quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/netQuantity`. + public var netQuantity: Swift.Double + /// Net amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/netAmount`. + public var netAmount: Swift.Double + /// Creates a new `UsageItemsPayloadPayload`. + /// + /// - Parameters: + /// - product: Product name. + /// - sku: SKU name. + /// - model: Model name. + /// - unitType: Unit type of the usage line item. + /// - pricePerUnit: Price per unit of the usage line item. + /// - grossQuantity: Gross quantity of the usage line item. + /// - grossAmount: Gross amount of the usage line item. + /// - discountQuantity: Discount quantity of the usage line item. + /// - discountAmount: Discount amount of the usage line item. + /// - netQuantity: Net quantity of the usage line item. + /// - netAmount: Net amount of the usage line item. + public init( + product: Swift.String, + sku: Swift.String, + model: Swift.String, + unitType: Swift.String, + pricePerUnit: Swift.Double, + grossQuantity: Swift.Double, + grossAmount: Swift.Double, + discountQuantity: Swift.Double, + discountAmount: Swift.Double, + netQuantity: Swift.Double, + netAmount: Swift.Double + ) { + self.product = product + self.sku = sku + self.model = model + self.unitType = unitType + self.pricePerUnit = pricePerUnit + self.grossQuantity = grossQuantity + self.grossAmount = grossAmount + self.discountQuantity = discountQuantity + self.discountAmount = discountAmount + self.netQuantity = netQuantity + self.netAmount = netAmount + } + public enum CodingKeys: String, CodingKey { + case product + case sku + case model + case unitType + case pricePerUnit + case grossQuantity + case grossAmount + case discountQuantity + case discountAmount + case netQuantity + case netAmount + } + } + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/usageItems`. + public typealias UsageItemsPayload = [Components.Schemas.BillingPremiumRequestUsageReportOrg.UsageItemsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/usageItems`. + public var usageItems: Components.Schemas.BillingPremiumRequestUsageReportOrg.UsageItemsPayload + /// Creates a new `BillingPremiumRequestUsageReportOrg`. + /// + /// - Parameters: + /// - timePeriod: + /// - organization: The unique identifier of the organization. + /// - user: The name of the user for the usage report. + /// - product: The product for the usage report. + /// - model: The model for the usage report. + /// - usageItems: + public init( + timePeriod: Components.Schemas.BillingPremiumRequestUsageReportOrg.TimePeriodPayload, + organization: Swift.String, + user: Swift.String? = nil, + product: Swift.String? = nil, + model: Swift.String? = nil, + usageItems: Components.Schemas.BillingPremiumRequestUsageReportOrg.UsageItemsPayload + ) { + self.timePeriod = timePeriod + self.organization = organization + self.user = user + self.product = product + self.model = model + self.usageItems = usageItems + } + public enum CodingKeys: String, CodingKey { + case timePeriod + case organization + case user + case product + case model + case usageItems + } + } /// - Remark: Generated from `#/components/schemas/billing-usage-report`. public struct BillingUsageReport: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/billing-usage-report/UsageItemsPayload`. @@ -692,185 +967,355 @@ public enum Components { case estimatedStorageForMonth = "estimated_storage_for_month" } } - } - /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String - /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. - /// - /// - Remark: Generated from `#/components/parameters/billing-usage-report-year`. - public typealias BillingUsageReportYear = Swift.Int - /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. - /// - /// - Remark: Generated from `#/components/parameters/billing-usage-report-month`. - public typealias BillingUsageReportMonth = Swift.Int - /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. - /// - /// - Remark: Generated from `#/components/parameters/billing-usage-report-day`. - public typealias BillingUsageReportDay = Swift.Int - /// If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. - /// - /// - Remark: Generated from `#/components/parameters/billing-usage-report-hour`. - public typealias BillingUsageReportHour = Swift.Int - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String - } - /// 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 { - public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/bad_request/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/bad_request/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user`. + public struct BillingPremiumRequestUsageReportUser: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/timePeriod`. + public struct TimePeriodPayload: Codable, Hashable, Sendable { + /// The year for the usage report. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) - } - } - } - /// - Remark: Generated from `#/components/responses/bad_request/content/application\/scim+json`. - case applicationScimJson(Components.Schemas.ScimError) - /// The associated value of the enum case if `self` is `.applicationScimJson`. + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/timePeriod/year`. + public var year: Swift.Int + /// The month for the usage report. /// - /// - Throws: An error if `self` is not `.applicationScimJson`. - /// - SeeAlso: `.applicationScimJson`. - public var applicationScimJson: Components.Schemas.ScimError { - get throws { - switch self { - case let .applicationScimJson(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/scim+json", - body: self - ) - } - } - } - } - /// Received HTTP response body - public var body: Components.Responses.BadRequest.Body - /// Creates a new `BadRequest`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.BadRequest.Body) { - self.body = body - } - } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/timePeriod/month`. + public var month: Swift.Int? + /// The day for the usage report. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/timePeriod/day`. + public var day: Swift.Int? + /// Creates a new `TimePeriodPayload`. + /// + /// - Parameters: + /// - year: The year for the usage report. + /// - month: The month for the usage report. + /// - day: The day for the usage report. + public init( + year: Swift.Int, + month: Swift.Int? = nil, + day: Swift.Int? = nil + ) { + self.year = year + self.month = month + self.day = day + } + public enum CodingKeys: String, CodingKey { + case year + case month + case day } } - /// Received HTTP response body - public var body: Components.Responses.Forbidden.Body - /// Creates a new `Forbidden`. + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/timePeriod`. + public var timePeriod: Components.Schemas.BillingPremiumRequestUsageReportUser.TimePeriodPayload + /// The unique identifier of the user. /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.Forbidden.Body) { - self.body = body - } - } - public struct InternalError: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/internal_error/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/internal_error/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/user`. + public var user: Swift.String + /// The product for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/product`. + public var product: Swift.String? + /// The model for the usage report. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/model`. + public var model: Swift.String? + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload`. + public struct UsageItemsPayloadPayload: Codable, Hashable, Sendable { + /// Product name. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/product`. + public var product: Swift.String + /// SKU name. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/sku`. + public var sku: Swift.String + /// Model name. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/model`. + public var model: Swift.String + /// Unit type of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/unitType`. + public var unitType: Swift.String + /// Price per unit of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/pricePerUnit`. + public var pricePerUnit: Swift.Double + /// Gross quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/grossQuantity`. + public var grossQuantity: Swift.Double + /// Gross amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/grossAmount`. + public var grossAmount: Swift.Double + /// Discount quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/discountQuantity`. + public var discountQuantity: Swift.Double + /// Discount amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/discountAmount`. + public var discountAmount: Swift.Double + /// Net quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/netQuantity`. + public var netQuantity: Swift.Double + /// Net amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/UsageItemsPayload/netAmount`. + public var netAmount: Swift.Double + /// Creates a new `UsageItemsPayloadPayload`. + /// + /// - Parameters: + /// - product: Product name. + /// - sku: SKU name. + /// - model: Model name. + /// - unitType: Unit type of the usage line item. + /// - pricePerUnit: Price per unit of the usage line item. + /// - grossQuantity: Gross quantity of the usage line item. + /// - grossAmount: Gross amount of the usage line item. + /// - discountQuantity: Discount quantity of the usage line item. + /// - discountAmount: Discount amount of the usage line item. + /// - netQuantity: Net quantity of the usage line item. + /// - netAmount: Net amount of the usage line item. + public init( + product: Swift.String, + sku: Swift.String, + model: Swift.String, + unitType: Swift.String, + pricePerUnit: Swift.Double, + grossQuantity: Swift.Double, + grossAmount: Swift.Double, + discountQuantity: Swift.Double, + discountAmount: Swift.Double, + netQuantity: Swift.Double, + netAmount: Swift.Double + ) { + self.product = product + self.sku = sku + self.model = model + self.unitType = unitType + self.pricePerUnit = pricePerUnit + self.grossQuantity = grossQuantity + self.grossAmount = grossAmount + self.discountQuantity = discountQuantity + self.discountAmount = discountAmount + self.netQuantity = netQuantity + self.netAmount = netAmount + } + public enum CodingKeys: String, CodingKey { + case product + case sku + case model + case unitType + case pricePerUnit + case grossQuantity + case grossAmount + case discountQuantity + case discountAmount + case netQuantity + case netAmount } } - /// Received HTTP response body - public var body: Components.Responses.InternalError.Body - /// Creates a new `InternalError`. + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/usageItems`. + public typealias UsageItemsPayload = [Components.Schemas.BillingPremiumRequestUsageReportUser.UsageItemsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-user/usageItems`. + public var usageItems: Components.Schemas.BillingPremiumRequestUsageReportUser.UsageItemsPayload + /// Creates a new `BillingPremiumRequestUsageReportUser`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.InternalError.Body) { - self.body = body + /// - timePeriod: + /// - user: The unique identifier of the user. + /// - product: The product for the usage report. + /// - model: The model for the usage report. + /// - usageItems: + public init( + timePeriod: Components.Schemas.BillingPremiumRequestUsageReportUser.TimePeriodPayload, + user: Swift.String, + product: Swift.String? = nil, + model: Swift.String? = nil, + usageItems: Components.Schemas.BillingPremiumRequestUsageReportUser.UsageItemsPayload + ) { + self.timePeriod = timePeriod + self.user = user + self.product = product + self.model = model + self.usageItems = usageItems + } + public enum CodingKeys: String, CodingKey { + case timePeriod + case user + case product + case model + case usageItems } } - public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/service_unavailable/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/service_unavailable/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/responses/service_unavailable/content/json/code`. - public var code: Swift.String? - /// - Remark: Generated from `#/components/responses/service_unavailable/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/components/responses/service_unavailable/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - code: - /// - message: - /// - documentationUrl: - public init( - code: Swift.String? = nil, - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil - ) { - self.code = code - self.message = message - self.documentationUrl = documentationUrl - } - public enum CodingKeys: String, CodingKey { - case code - case message - case documentationUrl = "documentation_url" - } + /// - Remark: Generated from `#/components/schemas/billing-usage-report-user`. + public struct BillingUsageReportUser: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/billing-usage-report-user/UsageItemsPayload`. + public struct UsageItemsPayloadPayload: Codable, Hashable, Sendable { + /// Date of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report-user/UsageItemsPayload/date`. + public var date: Swift.String + /// Product name. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report-user/UsageItemsPayload/product`. + public var product: Swift.String + /// SKU name. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report-user/UsageItemsPayload/sku`. + public var sku: Swift.String + /// Quantity of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report-user/UsageItemsPayload/quantity`. + public var quantity: Swift.Int + /// Unit type of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report-user/UsageItemsPayload/unitType`. + public var unitType: Swift.String + /// Price per unit of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report-user/UsageItemsPayload/pricePerUnit`. + public var pricePerUnit: Swift.Double + /// Gross amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report-user/UsageItemsPayload/grossAmount`. + public var grossAmount: Swift.Double + /// Discount amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report-user/UsageItemsPayload/discountAmount`. + public var discountAmount: Swift.Double + /// Net amount of the usage line item. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report-user/UsageItemsPayload/netAmount`. + public var netAmount: Swift.Double + /// Name of the repository. + /// + /// - Remark: Generated from `#/components/schemas/billing-usage-report-user/UsageItemsPayload/repositoryName`. + public var repositoryName: Swift.String? + /// Creates a new `UsageItemsPayloadPayload`. + /// + /// - Parameters: + /// - date: Date of the usage line item. + /// - product: Product name. + /// - sku: SKU name. + /// - quantity: Quantity of the usage line item. + /// - unitType: Unit type of the usage line item. + /// - pricePerUnit: Price per unit of the usage line item. + /// - grossAmount: Gross amount of the usage line item. + /// - discountAmount: Discount amount of the usage line item. + /// - netAmount: Net amount of the usage line item. + /// - repositoryName: Name of the repository. + public init( + date: Swift.String, + product: Swift.String, + sku: Swift.String, + quantity: Swift.Int, + unitType: Swift.String, + pricePerUnit: Swift.Double, + grossAmount: Swift.Double, + discountAmount: Swift.Double, + netAmount: Swift.Double, + repositoryName: Swift.String? = nil + ) { + self.date = date + self.product = product + self.sku = sku + self.quantity = quantity + self.unitType = unitType + self.pricePerUnit = pricePerUnit + self.grossAmount = grossAmount + self.discountAmount = discountAmount + self.netAmount = netAmount + self.repositoryName = repositoryName } - /// - Remark: Generated from `#/components/responses/service_unavailable/content/application\/json`. - case json(Components.Responses.ServiceUnavailable.Body.JsonPayload) + public enum CodingKeys: String, CodingKey { + case date + case product + case sku + case quantity + case unitType + case pricePerUnit + case grossAmount + case discountAmount + case netAmount + case repositoryName + } + } + /// - Remark: Generated from `#/components/schemas/billing-usage-report-user/usageItems`. + public typealias UsageItemsPayload = [Components.Schemas.BillingUsageReportUser.UsageItemsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/billing-usage-report-user/usageItems`. + public var usageItems: Components.Schemas.BillingUsageReportUser.UsageItemsPayload? + /// Creates a new `BillingUsageReportUser`. + /// + /// - Parameters: + /// - usageItems: + public init(usageItems: Components.Schemas.BillingUsageReportUser.UsageItemsPayload? = nil) { + self.usageItems = usageItems + } + public enum CodingKeys: String, CodingKey { + case usageItems + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String + /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-year`. + public typealias BillingUsageReportYear = Swift.Int + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-month-default`. + public typealias BillingUsageReportMonthDefault = Swift.Int + /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-day`. + public typealias BillingUsageReportDay = Swift.Int + /// The user name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-user`. + public typealias BillingUsageReportUser = Swift.String + /// The model name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-model`. + public typealias BillingUsageReportModel = Swift.String + /// The product name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-product`. + public typealias BillingUsageReportProduct = Swift.String + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-month`. + public typealias BillingUsageReportMonth = Swift.Int + /// If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. + /// + /// - Remark: Generated from `#/components/parameters/billing-usage-report-hour`. + public typealias BillingUsageReportHour = Swift.Int + } + /// 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 { + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + case json(Components.Schemas.BasicError) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Responses.ServiceUnavailable.Body.JsonPayload { + public var json: Components.Schemas.BasicError { get throws { switch self { case let .json(body): @@ -880,43 +1325,292 @@ public enum Components { } } /// Received HTTP response body - public var body: Components.Responses.ServiceUnavailable.Body - /// Creates a new `ServiceUnavailable`. + public var body: Components.Responses.NotFound.Body + /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Components.Responses.ServiceUnavailable.Body) { + public init(body: Components.Responses.NotFound.Body) { self.body = body } } - public struct BillingUsageReportOrg: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/billing_usage_report_org/content`. + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/bad_request/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/billing_usage_report_org/content/application\/json`. - case json(Components.Schemas.BillingUsageReport) + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/json`. + case json(Components.Schemas.BasicError) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.BillingUsageReport { + public var json: Components.Schemas.BasicError { get throws { switch self { case let .json(body): return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/json", + body: self + ) } } } - } - /// Received HTTP response body - public var body: Components.Responses.BillingUsageReportOrg.Body - /// Creates a new `BillingUsageReportOrg`. - /// + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/scim+json`. + case applicationScimJson(Components.Schemas.ScimError) + /// The associated value of the enum case if `self` is `.applicationScimJson`. + /// + /// - Throws: An error if `self` is not `.applicationScimJson`. + /// - SeeAlso: `.applicationScimJson`. + public var applicationScimJson: Components.Schemas.ScimError { + get throws { + switch self { + case let .applicationScimJson(body): + return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/scim+json", + body: self + ) + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.BadRequest.Body) { + self.body = body + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Forbidden.Body) { + self.body = body + } + } + public struct InternalError: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.InternalError.Body + /// Creates a new `InternalError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.InternalError.Body) { + self.body = body + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/service_unavailable/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/service_unavailable/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/responses/service_unavailable/content/json/code`. + public var code: Swift.String? + /// - Remark: Generated from `#/components/responses/service_unavailable/content/json/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/responses/service_unavailable/content/json/documentation_url`. + public var documentationUrl: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - code: + /// - message: + /// - documentationUrl: + public init( + code: Swift.String? = nil, + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil + ) { + self.code = code + self.message = message + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case code + case message + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/components/responses/service_unavailable/content/application\/json`. + case json(Components.Responses.ServiceUnavailable.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Responses.ServiceUnavailable.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ServiceUnavailable.Body) { + self.body = body + } + } + public struct BillingPremiumRequestUsageReportOrg: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_premium_request_usage_report_org/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_premium_request_usage_report_org/content/application\/json`. + case json(Components.Schemas.BillingPremiumRequestUsageReportOrg) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BillingPremiumRequestUsageReportOrg { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.BillingPremiumRequestUsageReportOrg.Body + /// Creates a new `BillingPremiumRequestUsageReportOrg`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.BillingPremiumRequestUsageReportOrg.Body) { + self.body = body + } + } + public struct BillingUsageReportOrg: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_usage_report_org/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_usage_report_org/content/application\/json`. + case json(Components.Schemas.BillingUsageReport) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BillingUsageReport { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.BillingUsageReportOrg.Body + /// Creates a new `BillingUsageReportOrg`. + /// /// - Parameters: /// - body: Received HTTP response body public init(body: Components.Responses.BillingUsageReportOrg.Body) { self.body = body } } + public struct BillingPremiumRequestUsageReportUser: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_premium_request_usage_report_user/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_premium_request_usage_report_user/content/application\/json`. + case json(Components.Schemas.BillingPremiumRequestUsageReportUser) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BillingPremiumRequestUsageReportUser { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.BillingPremiumRequestUsageReportUser.Body + /// Creates a new `BillingPremiumRequestUsageReportUser`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.BillingPremiumRequestUsageReportUser.Body) { + self.body = body + } + } + public struct BillingUsageReportUser: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_usage_report_user/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/billing_usage_report_user/content/application\/json`. + case json(Components.Schemas.BillingUsageReportUser) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BillingUsageReportUser { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.BillingUsageReportUser.Body + /// Creates a new `BillingUsageReportUser`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.BillingUsageReportUser.Body) { + self.body = body + } + } } /// Types generated from the `#/components/headers` section of the OpenAPI document. public enum Headers {} @@ -924,22 +1618,22 @@ public enum Components { /// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. public enum Operations { - /// Get billing usage report for an organization + /// Get billing premium request usage report for an organization /// - /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. /// - /// **Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform)." + /// **Note:** Only data from the past 24 months is accessible via this endpoint. /// - /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage`. - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)`. - public enum BillingGetGithubBillingUsageReportOrg { - public static let id: Swift.String = "billing/get-github-billing-usage-report-org" + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`. + public enum BillingGetGithubBillingPremiumRequestUsageReportOrg { + public static let id: Swift.String = "billing/get-github-billing-premium-request-usage-report-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/path/org`. + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -949,85 +1643,737 @@ public enum Operations { self.org = org } } - public var path: Operations.BillingGetGithubBillingUsageReportOrg.Input.Path - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query`. + public var path: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query`. public struct Query: Sendable, Hashable { /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/year`. + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/year`. public var year: Components.Parameters.BillingUsageReportYear? - /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/month`. - public var month: Components.Parameters.BillingUsageReportMonth? + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/month`. + public var month: Components.Parameters.BillingUsageReportMonthDefault? /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/day`. + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/day`. public var day: Components.Parameters.BillingUsageReportDay? - /// If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. + /// The user name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/user`. + public var user: Components.Parameters.BillingUsageReportUser? + /// The model name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/model`. + public var model: Components.Parameters.BillingUsageReportModel? + /// The product name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/query/product`. + public var product: Components.Parameters.BillingUsageReportProduct? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - year: If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. + /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// - user: The user name to query usage for. The name is not case sensitive. + /// - model: The model name to query usage for. The name is not case sensitive. + /// - product: The product name to query usage for. The name is not case sensitive. + public init( + year: Components.Parameters.BillingUsageReportYear? = nil, + month: Components.Parameters.BillingUsageReportMonthDefault? = nil, + day: Components.Parameters.BillingUsageReportDay? = nil, + user: Components.Parameters.BillingUsageReportUser? = nil, + model: Components.Parameters.BillingUsageReportModel? = nil, + product: Components.Parameters.BillingUsageReportProduct? = nil + ) { + self.year = year + self.month = month + self.day = day + self.user = user + self.model = model + self.product = product + } + } + public var query: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Query + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/premium_request/usage/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Path, + query: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// Response when getting a billing premium request usage report + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Components.Responses.BillingPremiumRequestUsageReportOrg) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.BillingPremiumRequestUsageReportOrg { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } + /// Get billing usage report for an organization + /// + /// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account. + /// + /// **Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform)." + /// + /// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage`. + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)`. + public enum BillingGetGithubBillingUsageReportOrg { + public static let id: Swift.String = "billing/get-github-billing-usage-report-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.BillingGetGithubBillingUsageReportOrg.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query`. + public struct Query: Sendable, Hashable { + /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/year`. + public var year: Components.Parameters.BillingUsageReportYear? + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/month`. + public var month: Components.Parameters.BillingUsageReportMonth? + /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/day`. + public var day: Components.Parameters.BillingUsageReportDay? + /// If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/hour`. + public var hour: Components.Parameters.BillingUsageReportHour? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - year: If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. + /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// - hour: If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. + public init( + year: Components.Parameters.BillingUsageReportYear? = nil, + month: Components.Parameters.BillingUsageReportMonth? = nil, + day: Components.Parameters.BillingUsageReportDay? = nil, + hour: Components.Parameters.BillingUsageReportHour? = nil + ) { + self.year = year + self.month = month + self.day = day + self.hour = hour + } + } + public var query: Operations.BillingGetGithubBillingUsageReportOrg.Input.Query + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.BillingGetGithubBillingUsageReportOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.BillingGetGithubBillingUsageReportOrg.Input.Path, + query: Operations.BillingGetGithubBillingUsageReportOrg.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingUsageReportOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// Billing usage report response for an organization + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Components.Responses.BillingUsageReportOrg) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.BillingUsageReportOrg { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } + /// Get GitHub Actions billing for an organization + /// + /// Gets the summary of the free and paid GitHub Actions minutes used. + /// + /// Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/billing/actions`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/actions/get(billing/get-github-actions-billing-org)`. + public enum BillingGetGithubActionsBillingOrg { + public static let id: Swift.String = "billing/get-github-actions-billing-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/actions/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/actions/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.BillingGetGithubActionsBillingOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/actions/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.BillingGetGithubActionsBillingOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.BillingGetGithubActionsBillingOrg.Input.Path, + headers: Operations.BillingGetGithubActionsBillingOrg.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/actions/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/actions/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsBillingUsage) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ActionsBillingUsage { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.BillingGetGithubActionsBillingOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.BillingGetGithubActionsBillingOrg.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/actions/get(billing/get-github-actions-billing-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.BillingGetGithubActionsBillingOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.BillingGetGithubActionsBillingOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get GitHub Packages billing for an organization + /// + /// Gets the free and paid storage used for GitHub Packages in gigabytes. + /// + /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/billing/packages`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/packages/get(billing/get-github-packages-billing-org)`. + public enum BillingGetGithubPackagesBillingOrg { + public static let id: Swift.String = "billing/get-github-packages-billing-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/packages/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/query/hour`. - public var hour: Components.Parameters.BillingUsageReportHour? - /// Creates a new `Query`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/packages/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. /// /// - Parameters: - /// - year: If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. - /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. - /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. - /// - hour: If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. - public init( - year: Components.Parameters.BillingUsageReportYear? = nil, - month: Components.Parameters.BillingUsageReportMonth? = nil, - day: Components.Parameters.BillingUsageReportDay? = nil, - hour: Components.Parameters.BillingUsageReportHour? = nil - ) { - self.year = year - self.month = month - self.day = day - self.hour = hour + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org } } - public var query: Operations.BillingGetGithubBillingUsageReportOrg.Input.Query - /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/usage/GET/header`. + public var path: Operations.BillingGetGithubPackagesBillingOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/packages/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.BillingGetGithubBillingUsageReportOrg.Input.Headers + public var headers: Operations.BillingGetGithubPackagesBillingOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.BillingGetGithubBillingUsageReportOrg.Input.Path, - query: Operations.BillingGetGithubBillingUsageReportOrg.Input.Query = .init(), - headers: Operations.BillingGetGithubBillingUsageReportOrg.Input.Headers = .init() + path: Operations.BillingGetGithubPackagesBillingOrg.Input.Path, + headers: Operations.BillingGetGithubPackagesBillingOrg.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - /// Billing usage report response for an organization + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/packages/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/packages/GET/responses/200/content/application\/json`. + case json(Components.Schemas.PackagesBillingUsage) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.PackagesBillingUsage { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.BillingGetGithubPackagesBillingOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.BillingGetGithubPackagesBillingOrg.Output.Ok.Body) { + self.body = body + } + } + /// Response /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/packages/get(billing/get-github-packages-billing-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Components.Responses.BillingUsageReportOrg) + case ok(Operations.BillingGetGithubPackagesBillingOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Components.Responses.BillingUsageReportOrg { + public var ok: Operations.BillingGetGithubPackagesBillingOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -1040,98 +2386,6 @@ public enum Operations { } } } - /// Bad Request - /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/400`. - /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. - /// - /// - Throws: An error if `self` is not `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { - get throws { - switch self { - case let .badRequest(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Internal Error - /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/500`. - /// - /// HTTP response code: `500 internalServerError`. - case internalServerError(Components.Responses.InternalError) - /// The associated value of the enum case if `self` is `.internalServerError`. - /// - /// - Throws: An error if `self` is not `.internalServerError`. - /// - SeeAlso: `.internalServerError`. - public var internalServerError: Components.Responses.InternalError { - get throws { - switch self { - case let .internalServerError(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "internalServerError", - response: self - ) - } - } - } - /// Service unavailable - /// - /// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)/responses/503`. - /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. - /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { - get throws { - switch self { - case let .serviceUnavailable(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -1139,14 +2393,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .applicationScimJson default: self = .other(rawValue) } @@ -1157,36 +2408,33 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// Get GitHub Actions billing for an organization + /// Get shared storage billing for an organization /// - /// Gets the summary of the free and paid GitHub Actions minutes used. + /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. /// - /// Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." /// /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/settings/billing/actions`. - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/actions/get(billing/get-github-actions-billing-org)`. - public enum BillingGetGithubActionsBillingOrg { - public static let id: Swift.String = "billing/get-github-actions-billing-org" + /// - Remark: HTTP `GET /orgs/{org}/settings/billing/shared-storage`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-org)`. + public enum BillingGetSharedStorageBillingOrg { + public static let id: Swift.String = "billing/get-shared-storage-billing-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/actions/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/shared-storage/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/actions/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/shared-storage/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -1196,27 +2444,27 @@ public enum Operations { self.org = org } } - public var path: Operations.BillingGetGithubActionsBillingOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/actions/GET/header`. + public var path: Operations.BillingGetSharedStorageBillingOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/shared-storage/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.BillingGetGithubActionsBillingOrg.Input.Headers + public var headers: Operations.BillingGetSharedStorageBillingOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.BillingGetGithubActionsBillingOrg.Input.Path, - headers: Operations.BillingGetGithubActionsBillingOrg.Input.Headers = .init() + path: Operations.BillingGetSharedStorageBillingOrg.Input.Path, + headers: Operations.BillingGetSharedStorageBillingOrg.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -1224,15 +2472,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/actions/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/shared-storage/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/actions/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsBillingUsage) + /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/shared-storage/GET/responses/200/content/application\/json`. + case json(Components.Schemas.CombinedBillingUsage) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActionsBillingUsage { + public var json: Components.Schemas.CombinedBillingUsage { get throws { switch self { case let .json(body): @@ -1242,26 +2490,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.BillingGetGithubActionsBillingOrg.Output.Ok.Body + public var body: Operations.BillingGetSharedStorageBillingOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.BillingGetGithubActionsBillingOrg.Output.Ok.Body) { + public init(body: Operations.BillingGetSharedStorageBillingOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/actions/get(billing/get-github-actions-billing-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.BillingGetGithubActionsBillingOrg.Output.Ok) + case ok(Operations.BillingGetSharedStorageBillingOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.BillingGetGithubActionsBillingOrg.Output.Ok { + public var ok: Operations.BillingGetSharedStorageBillingOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -1305,54 +2553,54 @@ public enum Operations { } } } - /// Get GitHub Packages billing for an organization + /// Get GitHub Actions billing for a user /// - /// Gets the free and paid storage used for GitHub Packages in gigabytes. + /// Gets the summary of the free and paid GitHub Actions minutes used. /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + /// Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/settings/billing/packages`. - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/packages/get(billing/get-github-packages-billing-org)`. - public enum BillingGetGithubPackagesBillingOrg { - public static let id: Swift.String = "billing/get-github-packages-billing-org" + /// - Remark: HTTP `GET /users/{username}/settings/billing/actions`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/actions/get(billing/get-github-actions-billing-user)`. + public enum BillingGetGithubActionsBillingUser { + public static let id: Swift.String = "billing/get-github-actions-billing-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/packages/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/actions/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/packages/GET/path/org`. - public var org: Components.Parameters.Org + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/actions/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org + /// - username: The handle for the GitHub user account. + public init(username: Components.Parameters.Username) { + self.username = username } } - public var path: Operations.BillingGetGithubPackagesBillingOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/packages/GET/header`. + public var path: Operations.BillingGetGithubActionsBillingUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/actions/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.BillingGetGithubPackagesBillingOrg.Input.Headers + public var headers: Operations.BillingGetGithubActionsBillingUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.BillingGetGithubPackagesBillingOrg.Input.Path, - headers: Operations.BillingGetGithubPackagesBillingOrg.Input.Headers = .init() + path: Operations.BillingGetGithubActionsBillingUser.Input.Path, + headers: Operations.BillingGetGithubActionsBillingUser.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -1360,15 +2608,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/packages/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/actions/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/packages/GET/responses/200/content/application\/json`. - case json(Components.Schemas.PackagesBillingUsage) + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/actions/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsBillingUsage) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.PackagesBillingUsage { + public var json: Components.Schemas.ActionsBillingUsage { get throws { switch self { case let .json(body): @@ -1378,26 +2626,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.BillingGetGithubPackagesBillingOrg.Output.Ok.Body + public var body: Operations.BillingGetGithubActionsBillingUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.BillingGetGithubPackagesBillingOrg.Output.Ok.Body) { + public init(body: Operations.BillingGetGithubActionsBillingUser.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/packages/get(billing/get-github-packages-billing-org)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/actions/get(billing/get-github-actions-billing-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.BillingGetGithubPackagesBillingOrg.Output.Ok) + case ok(Operations.BillingGetGithubActionsBillingUser.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.BillingGetGithubPackagesBillingOrg.Output.Ok { + public var ok: Operations.BillingGetGithubActionsBillingUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -1441,54 +2689,54 @@ public enum Operations { } } } - /// Get shared storage billing for an organization + /// Get GitHub Packages billing for a user /// - /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. + /// Gets the free and paid storage used for GitHub Packages in gigabytes. /// /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/settings/billing/shared-storage`. - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-org)`. - public enum BillingGetSharedStorageBillingOrg { - public static let id: Swift.String = "billing/get-shared-storage-billing-org" + /// - Remark: HTTP `GET /users/{username}/settings/billing/packages`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/packages/get(billing/get-github-packages-billing-user)`. + public enum BillingGetGithubPackagesBillingUser { + public static let id: Swift.String = "billing/get-github-packages-billing-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/shared-storage/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/packages/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/shared-storage/GET/path/org`. - public var org: Components.Parameters.Org + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/packages/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org + /// - username: The handle for the GitHub user account. + public init(username: Components.Parameters.Username) { + self.username = username } } - public var path: Operations.BillingGetSharedStorageBillingOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/shared-storage/GET/header`. + public var path: Operations.BillingGetGithubPackagesBillingUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/packages/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.BillingGetSharedStorageBillingOrg.Input.Headers + public var headers: Operations.BillingGetGithubPackagesBillingUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.BillingGetSharedStorageBillingOrg.Input.Path, - headers: Operations.BillingGetSharedStorageBillingOrg.Input.Headers = .init() + path: Operations.BillingGetGithubPackagesBillingUser.Input.Path, + headers: Operations.BillingGetGithubPackagesBillingUser.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -1496,15 +2744,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/shared-storage/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/packages/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/settings/billing/shared-storage/GET/responses/200/content/application\/json`. - case json(Components.Schemas.CombinedBillingUsage) + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/packages/GET/responses/200/content/application\/json`. + case json(Components.Schemas.PackagesBillingUsage) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.CombinedBillingUsage { + public var json: Components.Schemas.PackagesBillingUsage { get throws { switch self { case let .json(body): @@ -1514,26 +2762,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.BillingGetSharedStorageBillingOrg.Output.Ok.Body + public var body: Operations.BillingGetGithubPackagesBillingUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.BillingGetSharedStorageBillingOrg.Output.Ok.Body) { + public init(body: Operations.BillingGetGithubPackagesBillingUser.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-org)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/packages/get(billing/get-github-packages-billing-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.BillingGetSharedStorageBillingOrg.Output.Ok) + case ok(Operations.BillingGetGithubPackagesBillingUser.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.BillingGetSharedStorageBillingOrg.Output.Ok { + public var ok: Operations.BillingGetGithubPackagesBillingUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -1577,24 +2825,22 @@ public enum Operations { } } } - /// Get GitHub Actions billing for a user - /// - /// Gets the summary of the free and paid GitHub Actions minutes used. + /// Get billing premium request usage report for a user /// - /// Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + /// Gets a report of premium request usage for a user. /// - /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. + /// **Note:** Only data from the past 24 months is accessible via this endpoint. /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/actions`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/actions/get(billing/get-github-actions-billing-user)`. - public enum BillingGetGithubActionsBillingUser { - public static let id: Swift.String = "billing/get-github-actions-billing-user" + /// - Remark: HTTP `GET /users/{username}/settings/billing/premium_request/usage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)`. + public enum BillingGetGithubBillingPremiumRequestUsageReportUser { + public static let id: Swift.String = "billing/get-github-billing-premium-request-usage-report-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/actions/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/path`. public struct Path: Sendable, Hashable { /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/actions/GET/path/username`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/path/username`. public var username: Components.Parameters.Username /// Creates a new `Path`. /// @@ -1604,79 +2850,214 @@ public enum Operations { self.username = username } } - public var path: Operations.BillingGetGithubActionsBillingUser.Input.Path - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/actions/GET/header`. + public var path: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/query`. + public struct Query: Sendable, Hashable { + /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/query/year`. + public var year: Components.Parameters.BillingUsageReportYear? + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/query/month`. + public var month: Components.Parameters.BillingUsageReportMonthDefault? + /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/query/day`. + public var day: Components.Parameters.BillingUsageReportDay? + /// The model name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/query/model`. + public var model: Components.Parameters.BillingUsageReportModel? + /// The product name to query usage for. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/query/product`. + public var product: Components.Parameters.BillingUsageReportProduct? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - year: If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used. + /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// - model: The model name to query usage for. The name is not case sensitive. + /// - product: The product name to query usage for. The name is not case sensitive. + public init( + year: Components.Parameters.BillingUsageReportYear? = nil, + month: Components.Parameters.BillingUsageReportMonthDefault? = nil, + day: Components.Parameters.BillingUsageReportDay? = nil, + model: Components.Parameters.BillingUsageReportModel? = nil, + product: Components.Parameters.BillingUsageReportProduct? = nil + ) { + self.year = year + self.month = month + self.day = day + self.model = model + self.product = product + } + } + public var query: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/premium_request/usage/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.BillingGetGithubActionsBillingUser.Input.Headers + public var headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.BillingGetGithubActionsBillingUser.Input.Path, - headers: Operations.BillingGetGithubActionsBillingUser.Input.Headers = .init() + path: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Path, + query: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/actions/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/actions/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ActionsBillingUsage) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ActionsBillingUsage { - get throws { - switch self { - case let .json(body): - return body - } - } + /// Response when getting a billing premium request usage report + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Components.Responses.BillingPremiumRequestUsageReportUser) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Components.Responses.BillingPremiumRequestUsageReportUser { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.BillingGetGithubActionsBillingUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.BillingGetGithubActionsBillingUser.Output.Ok.Body) { - self.body = body + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } } } - /// Response + /// Service unavailable /// - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/actions/get(billing/get-github-actions-billing-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)/responses/503`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.BillingGetGithubActionsBillingUser.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.BillingGetGithubActionsBillingUser.Output.Ok { + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { get throws { switch self { - case let .ok(response): + case let .serviceUnavailable(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "serviceUnavailable", response: self ) } @@ -1689,11 +3070,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -1704,33 +3088,36 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Get GitHub Packages billing for a user + /// Get shared storage billing for a user /// - /// Gets the free and paid storage used for GitHub Packages in gigabytes. + /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. /// /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." /// /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/packages`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/packages/get(billing/get-github-packages-billing-user)`. - public enum BillingGetGithubPackagesBillingUser { - public static let id: Swift.String = "billing/get-github-packages-billing-user" + /// - Remark: HTTP `GET /users/{username}/settings/billing/shared-storage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-user)`. + public enum BillingGetSharedStorageBillingUser { + public static let id: Swift.String = "billing/get-shared-storage-billing-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/packages/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/shared-storage/GET/path`. public struct Path: Sendable, Hashable { /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/packages/GET/path/username`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/shared-storage/GET/path/username`. public var username: Components.Parameters.Username /// Creates a new `Path`. /// @@ -1740,27 +3127,27 @@ public enum Operations { self.username = username } } - public var path: Operations.BillingGetGithubPackagesBillingUser.Input.Path - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/packages/GET/header`. + public var path: Operations.BillingGetSharedStorageBillingUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/shared-storage/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.BillingGetGithubPackagesBillingUser.Input.Headers + public var headers: Operations.BillingGetSharedStorageBillingUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.BillingGetGithubPackagesBillingUser.Input.Path, - headers: Operations.BillingGetGithubPackagesBillingUser.Input.Headers = .init() + path: Operations.BillingGetSharedStorageBillingUser.Input.Path, + headers: Operations.BillingGetSharedStorageBillingUser.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -1768,15 +3155,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/packages/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/shared-storage/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/packages/GET/responses/200/content/application\/json`. - case json(Components.Schemas.PackagesBillingUsage) + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/shared-storage/GET/responses/200/content/application\/json`. + case json(Components.Schemas.CombinedBillingUsage) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.PackagesBillingUsage { + public var json: Components.Schemas.CombinedBillingUsage { get throws { switch self { case let .json(body): @@ -1786,26 +3173,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.BillingGetGithubPackagesBillingUser.Output.Ok.Body + public var body: Operations.BillingGetSharedStorageBillingUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.BillingGetGithubPackagesBillingUser.Output.Ok.Body) { + public init(body: Operations.BillingGetSharedStorageBillingUser.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/packages/get(billing/get-github-packages-billing-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.BillingGetGithubPackagesBillingUser.Output.Ok) + case ok(Operations.BillingGetSharedStorageBillingUser.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.BillingGetGithubPackagesBillingUser.Output.Ok { + public var ok: Operations.BillingGetSharedStorageBillingUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -1849,24 +3236,22 @@ public enum Operations { } } } - /// Get shared storage billing for a user - /// - /// Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. + /// Get billing usage report for a user /// - /// Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + /// Gets a report of the total usage for a user. /// - /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. + /// **Note:** This endpoint is only available to users with access to the enhanced billing platform. /// - /// - Remark: HTTP `GET /users/{username}/settings/billing/shared-storage`. - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-user)`. - public enum BillingGetSharedStorageBillingUser { - public static let id: Swift.String = "billing/get-shared-storage-billing-user" + /// - Remark: HTTP `GET /users/{username}/settings/billing/usage`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)`. + public enum BillingGetGithubBillingUsageReportUser { + public static let id: Swift.String = "billing/get-github-billing-usage-report-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/shared-storage/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/path`. public struct Path: Sendable, Hashable { /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/shared-storage/GET/path/username`. + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/path/username`. public var username: Components.Parameters.Username /// Creates a new `Path`. /// @@ -1876,72 +3261,85 @@ public enum Operations { self.username = username } } - public var path: Operations.BillingGetSharedStorageBillingUser.Input.Path - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/shared-storage/GET/header`. + public var path: Operations.BillingGetGithubBillingUsageReportUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/query`. + public struct Query: Sendable, Hashable { + /// If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/query/year`. + public var year: Components.Parameters.BillingUsageReportYear? + /// If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/query/month`. + public var month: Components.Parameters.BillingUsageReportMonth? + /// If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/query/day`. + public var day: Components.Parameters.BillingUsageReportDay? + /// If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. + /// + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/query/hour`. + public var hour: Components.Parameters.BillingUsageReportHour? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - year: If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year. + /// - month: If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. If no year is specified the default `year` is used. + /// - day: If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used. + /// - hour: If specified, only return results for a single hour. The value of `hour` is an integer between `0` and `23`. If no `year`, `month`, or `day` is specified, the default `year`, `month`, and `day` are used. + public init( + year: Components.Parameters.BillingUsageReportYear? = nil, + month: Components.Parameters.BillingUsageReportMonth? = nil, + day: Components.Parameters.BillingUsageReportDay? = nil, + hour: Components.Parameters.BillingUsageReportHour? = nil + ) { + self.year = year + self.month = month + self.day = day + self.hour = hour + } + } + public var query: Operations.BillingGetGithubBillingUsageReportUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/settings/billing/usage/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.BillingGetSharedStorageBillingUser.Input.Headers + public var headers: Operations.BillingGetGithubBillingUsageReportUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.BillingGetSharedStorageBillingUser.Input.Path, - headers: Operations.BillingGetSharedStorageBillingUser.Input.Headers = .init() + path: Operations.BillingGetGithubBillingUsageReportUser.Input.Path, + query: Operations.BillingGetGithubBillingUsageReportUser.Input.Query = .init(), + headers: Operations.BillingGetGithubBillingUsageReportUser.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/shared-storage/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/settings/billing/shared-storage/GET/responses/200/content/application\/json`. - case json(Components.Schemas.CombinedBillingUsage) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.CombinedBillingUsage { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.BillingGetSharedStorageBillingUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.BillingGetSharedStorageBillingUser.Output.Ok.Body) { - self.body = body - } - } - /// Response + /// Response when getting a billing usage report /// - /// - Remark: Generated from `#/paths//users/{username}/settings/billing/shared-storage/get(billing/get-shared-storage-billing-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.BillingGetSharedStorageBillingUser.Output.Ok) + case ok(Components.Responses.BillingUsageReportUser) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.BillingGetSharedStorageBillingUser.Output.Ok { + public var ok: Components.Responses.BillingUsageReportUser { get throws { switch self { case let .ok(response): @@ -1954,6 +3352,98 @@ public enum Operations { } } } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -1961,11 +3451,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -1976,11 +3469,14 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } diff --git a/Sources/campaigns/Types.swift b/Sources/campaigns/Types.swift index b8c21295b93..ef5004dacfb 100644 --- a/Sources/campaigns/Types.swift +++ b/Sources/campaigns/Types.swift @@ -437,6 +437,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -453,6 +472,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -466,7 +488,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -481,6 +506,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -496,6 +524,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -569,6 +600,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -587,6 +637,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -602,6 +655,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -617,6 +673,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -633,6 +692,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -1233,169 +1295,48 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The name of the campaign - /// - /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/name`. - public var name: Swift.String - /// A description for the campaign - /// - /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/description`. - public var description: Swift.String - /// The logins of the users to set as the campaign managers. At this time, only a single manager can be supplied. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/managers`. - public var managers: [Swift.String]? - /// The slugs of the teams to set as the campaign managers. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/team_managers`. - public var teamManagers: [Swift.String]? - /// The end date and time of the campaign. The date must be in the future. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/ends_at`. - public var endsAt: Foundation.Date - /// The contact link of the campaign. Must be a URI. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/contact_link`. - public var contactLink: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/CodeScanningAlertsPayload`. - public struct CodeScanningAlertsPayloadPayload: Codable, Hashable, Sendable { - /// The repository id - /// - /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/CodeScanningAlertsPayload/repository_id`. - public var repositoryId: Swift.Int - /// The alert numbers - /// - /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/CodeScanningAlertsPayload/alert_numbers`. - public var alertNumbers: [Swift.Int] - /// Creates a new `CodeScanningAlertsPayloadPayload`. - /// - /// - Parameters: - /// - repositoryId: The repository id - /// - alertNumbers: The alert numbers - public init( - repositoryId: Swift.Int, - alertNumbers: [Swift.Int] - ) { - self.repositoryId = repositoryId - self.alertNumbers = alertNumbers - } - public enum CodingKeys: String, CodingKey { - case repositoryId = "repository_id" - case alertNumbers = "alert_numbers" - } - public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.repositoryId = try container.decode( - Swift.Int.self, - forKey: .repositoryId - ) - self.alertNumbers = try container.decode( - [Swift.Int].self, - forKey: .alertNumbers - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "repository_id", - "alert_numbers" - ]) - } - } - /// The code scanning alerts to include in this campaign - /// - /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/code_scanning_alerts`. - public typealias CodeScanningAlertsPayload = [Operations.CampaignsCreateCampaign.Input.Body.JsonPayload.CodeScanningAlertsPayloadPayload] - /// The code scanning alerts to include in this campaign - /// - /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/code_scanning_alerts`. - public var codeScanningAlerts: Operations.CampaignsCreateCampaign.Input.Body.JsonPayload.CodeScanningAlertsPayload - /// If true, will automatically generate issues for the campaign. The default is false. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/generate_issues`. - public var generateIssues: Swift.Bool? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: The name of the campaign - /// - description: A description for the campaign - /// - managers: The logins of the users to set as the campaign managers. At this time, only a single manager can be supplied. - /// - teamManagers: The slugs of the teams to set as the campaign managers. - /// - endsAt: The end date and time of the campaign. The date must be in the future. - /// - contactLink: The contact link of the campaign. Must be a URI. - /// - codeScanningAlerts: The code scanning alerts to include in this campaign - /// - generateIssues: If true, will automatically generate issues for the campaign. The default is false. - public init( - name: Swift.String, - description: Swift.String, - managers: [Swift.String]? = nil, - teamManagers: [Swift.String]? = nil, - endsAt: Foundation.Date, - contactLink: Swift.String? = nil, - codeScanningAlerts: Operations.CampaignsCreateCampaign.Input.Body.JsonPayload.CodeScanningAlertsPayload, - generateIssues: Swift.Bool? = nil - ) { - self.name = name - self.description = description - self.managers = managers - self.teamManagers = teamManagers - self.endsAt = endsAt - self.contactLink = contactLink - self.codeScanningAlerts = codeScanningAlerts - self.generateIssues = generateIssues + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// Creates a new `Case1Payload`. + public init() {} } - public enum CodingKeys: String, CodingKey { - case name - case description - case managers - case teamManagers = "team_managers" - case endsAt = "ends_at" - case contactLink = "contact_link" - case codeScanningAlerts = "code_scanning_alerts" - case generateIssues = "generate_issues" + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/case1`. + case case1(Operations.CampaignsCreateCampaign.Input.Body.JsonPayload.Case1Payload) + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// Creates a new `Case2Payload`. + public init() {} } + /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/json/case2`. + case case2(Operations.CampaignsCreateCampaign.Input.Body.JsonPayload.Case2Payload) public init(from decoder: any Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.name = try container.decode( - Swift.String.self, - forKey: .name - ) - self.description = try container.decode( - Swift.String.self, - forKey: .description - ) - self.managers = try container.decodeIfPresent( - [Swift.String].self, - forKey: .managers - ) - self.teamManagers = try container.decodeIfPresent( - [Swift.String].self, - forKey: .teamManagers - ) - self.endsAt = try container.decode( - Foundation.Date.self, - forKey: .endsAt - ) - self.contactLink = try container.decodeIfPresent( - Swift.String.self, - forKey: .contactLink - ) - self.codeScanningAlerts = try container.decode( - Operations.CampaignsCreateCampaign.Input.Body.JsonPayload.CodeScanningAlertsPayload.self, - forKey: .codeScanningAlerts - ) - self.generateIssues = try container.decodeIfPresent( - Swift.Bool.self, - forKey: .generateIssues + var errors: [any Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "name", - "description", - "managers", - "team_managers", - "ends_at", - "contact_link", - "code_scanning_alerts", - "generate_issues" - ]) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } } } /// - Remark: Generated from `#/paths/orgs/{org}/campaigns/POST/requestBody/content/application\/json`. diff --git a/Sources/checks/Types.swift b/Sources/checks/Types.swift index c1ed8a03d06..8d870a6c470 100644 --- a/Sources/checks/Types.swift +++ b/Sources/checks/Types.swift @@ -899,20 +899,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. public var permissions: Components.Schemas.NullableIntegration.PermissionsPayload - /// The list of events for the GitHub app + /// The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. /// /// - Remark: Generated from `#/components/schemas/nullable-integration/events`. public var events: [Swift.String] - /// The number of installations associated with the GitHub app + /// The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. /// /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. public var installationsCount: Swift.Int? - /// - Remark: Generated from `#/components/schemas/nullable-integration/client_secret`. - public var clientSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/webhook_secret`. - public var webhookSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/pem`. - public var pem: Swift.String? /// Creates a new `NullableIntegration`. /// /// - Parameters: @@ -928,11 +922,8 @@ public enum Components { /// - createdAt: /// - updatedAt: /// - permissions: The set of permissions for the GitHub app - /// - events: The list of events for the GitHub app - /// - installationsCount: The number of installations associated with the GitHub app - /// - clientSecret: - /// - webhookSecret: - /// - pem: + /// - events: The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. + /// - installationsCount: The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. public init( id: Swift.Int, slug: Swift.String? = nil, @@ -947,10 +938,7 @@ public enum Components { updatedAt: Foundation.Date, permissions: Components.Schemas.NullableIntegration.PermissionsPayload, events: [Swift.String], - installationsCount: Swift.Int? = nil, - clientSecret: Swift.String? = nil, - webhookSecret: Swift.String? = nil, - pem: Swift.String? = nil + installationsCount: Swift.Int? = nil ) { self.id = id self.slug = slug @@ -966,9 +954,6 @@ public enum Components { self.permissions = permissions self.events = events self.installationsCount = installationsCount - self.clientSecret = clientSecret - self.webhookSecret = webhookSecret - self.pem = pem } public enum CodingKeys: String, CodingKey { case id @@ -985,13 +970,15 @@ public enum Components { case permissions case events case installationsCount = "installations_count" - case clientSecret = "client_secret" - case webhookSecret = "webhook_secret" - case pem } } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -1012,6 +999,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -1157,7 +1149,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: @@ -1453,6 +1445,30 @@ public enum Components { public var webCommitSignoffRequired: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/security_and_analysis`. public var securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public struct CustomPropertiesPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CustomPropertiesPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public var customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? /// Creates a new `MinimalRepository`. /// /// - Parameters: @@ -1543,6 +1559,7 @@ public enum Components { /// - allowForking: /// - webCommitSignoffRequired: /// - securityAndAnalysis: + /// - customProperties: The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. public init( id: Swift.Int64, nodeId: Swift.String, @@ -1630,7 +1647,8 @@ public enum Components { watchers: Swift.Int? = nil, allowForking: Swift.Bool? = nil, webCommitSignoffRequired: Swift.Bool? = nil, - securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil + securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil, + customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -1719,6 +1737,7 @@ public enum Components { self.allowForking = allowForking self.webCommitSignoffRequired = webCommitSignoffRequired self.securityAndAnalysis = securityAndAnalysis + self.customProperties = customProperties } public enum CodingKeys: String, CodingKey { case id @@ -1808,6 +1827,7 @@ public enum Components { case allowForking = "allow_forking" case webCommitSignoffRequired = "web_commit_signoff_required" case securityAndAnalysis = "security_and_analysis" + case customProperties = "custom_properties" } } /// An object without any properties. diff --git a/Sources/code-scanning/Client.swift b/Sources/code-scanning/Client.swift index 039a6617abd..9ff3b2c90f9 100644 --- a/Sources/code-scanning/Client.swift +++ b/Sources/code-scanning/Client.swift @@ -3100,6 +3100,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.CodeScanningInvalidState.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.ServiceUnavailable.Body diff --git a/Sources/code-scanning/Types.swift b/Sources/code-scanning/Types.swift index ecede7b5d2d..4328222bbcb 100644 --- a/Sources/code-scanning/Types.swift +++ b/Sources/code-scanning/Types.swift @@ -2058,6 +2058,8 @@ public enum Components { public var repository: Components.Schemas.SimpleRepository /// - Remark: Generated from `#/components/schemas/code-scanning-organization-alert-items/dismissal_approved_by`. public var dismissalApprovedBy: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/code-scanning-organization-alert-items/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? /// Creates a new `CodeScanningOrganizationAlertItems`. /// /// - Parameters: @@ -2078,6 +2080,7 @@ public enum Components { /// - mostRecentInstance: /// - repository: /// - dismissalApprovedBy: + /// - assignees: public init( number: Components.Schemas.AlertNumber, createdAt: Components.Schemas.AlertCreatedAt, @@ -2095,7 +2098,8 @@ public enum Components { tool: Components.Schemas.CodeScanningAnalysisTool, mostRecentInstance: Components.Schemas.CodeScanningAlertInstance, repository: Components.Schemas.SimpleRepository, - dismissalApprovedBy: Components.Schemas.NullableSimpleUser? = nil + dismissalApprovedBy: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil ) { self.number = number self.createdAt = createdAt @@ -2114,6 +2118,7 @@ public enum Components { self.mostRecentInstance = mostRecentInstance self.repository = repository self.dismissalApprovedBy = dismissalApprovedBy + self.assignees = assignees } public enum CodingKeys: String, CodingKey { case number @@ -2133,6 +2138,7 @@ public enum Components { case mostRecentInstance = "most_recent_instance" case repository case dismissalApprovedBy = "dismissal_approved_by" + case assignees } } /// - Remark: Generated from `#/components/schemas/code-scanning-alert-items`. @@ -2169,6 +2175,8 @@ public enum Components { public var mostRecentInstance: Components.Schemas.CodeScanningAlertInstance /// - Remark: Generated from `#/components/schemas/code-scanning-alert-items/dismissal_approved_by`. public var dismissalApprovedBy: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-items/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? /// Creates a new `CodeScanningAlertItems`. /// /// - Parameters: @@ -2188,6 +2196,7 @@ public enum Components { /// - tool: /// - mostRecentInstance: /// - dismissalApprovedBy: + /// - assignees: public init( number: Components.Schemas.AlertNumber, createdAt: Components.Schemas.AlertCreatedAt, @@ -2204,7 +2213,8 @@ public enum Components { rule: Components.Schemas.CodeScanningAlertRuleSummary, tool: Components.Schemas.CodeScanningAnalysisTool, mostRecentInstance: Components.Schemas.CodeScanningAlertInstance, - dismissalApprovedBy: Components.Schemas.NullableSimpleUser? = nil + dismissalApprovedBy: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil ) { self.number = number self.createdAt = createdAt @@ -2222,6 +2232,7 @@ public enum Components { self.tool = tool self.mostRecentInstance = mostRecentInstance self.dismissalApprovedBy = dismissalApprovedBy + self.assignees = assignees } public enum CodingKeys: String, CodingKey { case number @@ -2240,6 +2251,7 @@ public enum Components { case tool case mostRecentInstance = "most_recent_instance" case dismissalApprovedBy = "dismissal_approved_by" + case assignees } } /// - Remark: Generated from `#/components/schemas/code-scanning-alert-rule`. @@ -2377,6 +2389,8 @@ public enum Components { public var mostRecentInstance: Components.Schemas.CodeScanningAlertInstance /// - Remark: Generated from `#/components/schemas/code-scanning-alert/dismissal_approved_by`. public var dismissalApprovedBy: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/code-scanning-alert/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? /// Creates a new `CodeScanningAlert`. /// /// - Parameters: @@ -2396,6 +2410,7 @@ public enum Components { /// - tool: /// - mostRecentInstance: /// - dismissalApprovedBy: + /// - assignees: public init( number: Components.Schemas.AlertNumber, createdAt: Components.Schemas.AlertCreatedAt, @@ -2412,7 +2427,8 @@ public enum Components { rule: Components.Schemas.CodeScanningAlertRule, tool: Components.Schemas.CodeScanningAnalysisTool, mostRecentInstance: Components.Schemas.CodeScanningAlertInstance, - dismissalApprovedBy: Components.Schemas.NullableSimpleUser? = nil + dismissalApprovedBy: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil ) { self.number = number self.createdAt = createdAt @@ -2430,6 +2446,7 @@ public enum Components { self.tool = tool self.mostRecentInstance = mostRecentInstance self.dismissalApprovedBy = dismissalApprovedBy + self.assignees = assignees } public enum CodingKeys: String, CodingKey { case number @@ -2448,6 +2465,7 @@ public enum Components { case tool case mostRecentInstance = "most_recent_instance" case dismissalApprovedBy = "dismissal_approved_by" + case assignees } } /// Sets the state of the code scanning alert. You must provide `dismissed_reason` when you set the state to `dismissed`. @@ -3290,6 +3308,17 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup/query_suite`. public var querySuite: Components.Schemas.CodeScanningDefaultSetup.QuerySuitePayload? + /// Threat model to be used for code scanning analysis. Use `remote` to analyze only network sources and `remote_and_local` to include local sources like filesystem access, command-line arguments, database reads, environment variable and standard input. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup/threat_model`. + @frozen public enum ThreatModelPayload: String, Codable, Hashable, Sendable, CaseIterable { + case remote = "remote" + case remoteAndLocal = "remote_and_local" + } + /// Threat model to be used for code scanning analysis. Use `remote` to analyze only network sources and `remote_and_local` to include local sources like filesystem access, command-line arguments, database reads, environment variable and standard input. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup/threat_model`. + public var threatModel: Components.Schemas.CodeScanningDefaultSetup.ThreatModelPayload? /// Timestamp of latest configuration update. /// /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup/updated_at`. @@ -3312,6 +3341,7 @@ public enum Components { /// - runnerType: Runner type to be used. /// - runnerLabel: Runner label to be used if the runner type is labeled. /// - querySuite: CodeQL query suite to be used. + /// - threatModel: Threat model to be used for code scanning analysis. Use `remote` to analyze only network sources and `remote_and_local` to include local sources like filesystem access, command-line arguments, database reads, environment variable and standard input. /// - updatedAt: Timestamp of latest configuration update. /// - schedule: The frequency of the periodic analysis. public init( @@ -3320,6 +3350,7 @@ public enum Components { runnerType: Components.Schemas.CodeScanningDefaultSetup.RunnerTypePayload? = nil, runnerLabel: Swift.String? = nil, querySuite: Components.Schemas.CodeScanningDefaultSetup.QuerySuitePayload? = nil, + threatModel: Components.Schemas.CodeScanningDefaultSetup.ThreatModelPayload? = nil, updatedAt: Foundation.Date? = nil, schedule: Components.Schemas.CodeScanningDefaultSetup.SchedulePayload? = nil ) { @@ -3328,6 +3359,7 @@ public enum Components { self.runnerType = runnerType self.runnerLabel = runnerLabel self.querySuite = querySuite + self.threatModel = threatModel self.updatedAt = updatedAt self.schedule = schedule } @@ -3337,6 +3369,7 @@ public enum Components { case runnerType = "runner_type" case runnerLabel = "runner_label" case querySuite = "query_suite" + case threatModel = "threat_model" case updatedAt = "updated_at" case schedule } @@ -3382,6 +3415,17 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup-update/query_suite`. public var querySuite: Components.Schemas.CodeScanningDefaultSetupUpdate.QuerySuitePayload? + /// Threat model to be used for code scanning analysis. Use `remote` to analyze only network sources and `remote_and_local` to include local sources like filesystem access, command-line arguments, database reads, environment variable and standard input. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup-update/threat_model`. + @frozen public enum ThreatModelPayload: String, Codable, Hashable, Sendable, CaseIterable { + case remote = "remote" + case remoteAndLocal = "remote_and_local" + } + /// Threat model to be used for code scanning analysis. Use `remote` to analyze only network sources and `remote_and_local` to include local sources like filesystem access, command-line arguments, database reads, environment variable and standard input. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup-update/threat_model`. + public var threatModel: Components.Schemas.CodeScanningDefaultSetupUpdate.ThreatModelPayload? /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup-update/LanguagesPayload`. @frozen public enum LanguagesPayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { case actions = "actions" @@ -3409,18 +3453,21 @@ public enum Components { /// - runnerType: Runner type to be used. /// - runnerLabel: Runner label to be used if the runner type is labeled. /// - querySuite: CodeQL query suite to be used. + /// - threatModel: Threat model to be used for code scanning analysis. Use `remote` to analyze only network sources and `remote_and_local` to include local sources like filesystem access, command-line arguments, database reads, environment variable and standard input. /// - languages: CodeQL languages to be analyzed. public init( state: Components.Schemas.CodeScanningDefaultSetupUpdate.StatePayload? = nil, runnerType: Components.Schemas.CodeScanningDefaultSetupUpdate.RunnerTypePayload? = nil, runnerLabel: Swift.String? = nil, querySuite: Components.Schemas.CodeScanningDefaultSetupUpdate.QuerySuitePayload? = nil, + threatModel: Components.Schemas.CodeScanningDefaultSetupUpdate.ThreatModelPayload? = nil, languages: Components.Schemas.CodeScanningDefaultSetupUpdate.LanguagesPayload? = nil ) { self.state = state self.runnerType = runnerType self.runnerLabel = runnerLabel self.querySuite = querySuite + self.threatModel = threatModel self.languages = languages } public enum CodingKeys: String, CodingKey { @@ -3428,6 +3475,7 @@ public enum Components { case runnerType = "runner_type" case runnerLabel = "runner_label" case querySuite = "query_suite" + case threatModel = "threat_model" case languages } public init(from decoder: any Decoder) throws { @@ -3448,6 +3496,10 @@ public enum Components { Components.Schemas.CodeScanningDefaultSetupUpdate.QuerySuitePayload.self, forKey: .querySuite ) + self.threatModel = try container.decodeIfPresent( + Components.Schemas.CodeScanningDefaultSetupUpdate.ThreatModelPayload.self, + forKey: .threatModel + ) self.languages = try container.decodeIfPresent( Components.Schemas.CodeScanningDefaultSetupUpdate.LanguagesPayload.self, forKey: .languages @@ -3457,6 +3509,7 @@ public enum Components { "runner_type", "runner_label", "query_suite", + "threat_model", "languages" ]) } @@ -3594,6 +3647,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -3602,10 +3659,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repo`. public typealias Repo = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String /// The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. /// /// - Remark: Generated from `#/components/parameters/tool-name`. @@ -3944,6 +3997,34 @@ public enum Components { self.body = body } } + public struct CodeScanningInvalidState: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/code_scanning_invalid_state/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/code_scanning_invalid_state/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.CodeScanningInvalidState.Body + /// Creates a new `CodeScanningInvalidState`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.CodeScanningInvalidState.Body) { + self.body = body + } + } } /// Types generated from the `#/components/headers` section of the OpenAPI document. public enum Headers { @@ -9031,6 +9112,29 @@ public enum Operations { } } } + /// Response if the configuration change cannot be made because the repository is not in the required state + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/default-setup/patch(code-scanning/update-default-setup)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.CodeScanningInvalidState) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.CodeScanningInvalidState { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } /// Service unavailable /// /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/default-setup/patch(code-scanning/update-default-setup)/responses/503`. diff --git a/Sources/code-security/Client.swift b/Sources/code-security/Client.swift index a6b1e090315..7bfccdf2bc9 100644 --- a/Sources/code-security/Client.swift +++ b/Sources/code-security/Client.swift @@ -1217,7 +1217,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/get(code-security/get-configurations-for-org)`. @@ -1434,7 +1434,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/defaults`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/defaults/get(code-security/get-default-configurations)`. @@ -2250,7 +2250,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-configuration)`. diff --git a/Sources/code-security/Types.swift b/Sources/code-security/Types.swift index d6eb34a4641..11922d7b0f9 100644 --- a/Sources/code-security/Types.swift +++ b/Sources/code-security/Types.swift @@ -122,7 +122,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/get(code-security/get-configurations-for-org)`. @@ -144,7 +144,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/defaults`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/defaults/get(code-security/get-default-configurations)`. @@ -228,7 +228,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-configuration)`. @@ -443,7 +443,7 @@ extension APIProtocol { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/get(code-security/get-configurations-for-org)`. @@ -485,7 +485,7 @@ extension APIProtocol { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/defaults`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/defaults/get(code-security/get-default-configurations)`. @@ -633,7 +633,7 @@ extension APIProtocol { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-configuration)`. @@ -1035,6 +1035,29 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_security_updates`. public var dependabotSecurityUpdates: Components.Schemas.CodeSecurityConfiguration.DependabotSecurityUpdatesPayload? + /// Feature options for code scanning + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_options`. + public struct CodeScanningOptionsPayload: Codable, Hashable, Sendable { + /// Whether to allow repos which use advanced setup + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_options/allow_advanced`. + public var allowAdvanced: Swift.Bool? + /// Creates a new `CodeScanningOptionsPayload`. + /// + /// - Parameters: + /// - allowAdvanced: Whether to allow repos which use advanced setup + public init(allowAdvanced: Swift.Bool? = nil) { + self.allowAdvanced = allowAdvanced + } + public enum CodingKeys: String, CodingKey { + case allowAdvanced = "allow_advanced" + } + } + /// Feature options for code scanning + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_options`. + public var codeScanningOptions: Components.Schemas.CodeSecurityConfiguration.CodeScanningOptionsPayload? /// The enablement status of code scanning default setup /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup`. @@ -1293,6 +1316,7 @@ public enum Components { /// - dependencyGraphAutosubmitActionOptions: Feature options for Automatic dependency submission /// - dependabotAlerts: The enablement status of Dependabot alerts /// - dependabotSecurityUpdates: The enablement status of Dependabot security updates + /// - codeScanningOptions: Feature options for code scanning /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: Feature options for code scanning default setup /// - codeScanningDelegatedAlertDismissal: The enablement status of code scanning delegated alert dismissal @@ -1321,6 +1345,7 @@ public enum Components { dependencyGraphAutosubmitActionOptions: Components.Schemas.CodeSecurityConfiguration.DependencyGraphAutosubmitActionOptionsPayload? = nil, dependabotAlerts: Components.Schemas.CodeSecurityConfiguration.DependabotAlertsPayload? = nil, dependabotSecurityUpdates: Components.Schemas.CodeSecurityConfiguration.DependabotSecurityUpdatesPayload? = nil, + codeScanningOptions: Components.Schemas.CodeSecurityConfiguration.CodeScanningOptionsPayload? = nil, codeScanningDefaultSetup: Components.Schemas.CodeSecurityConfiguration.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeSecurityConfiguration.CodeScanningDefaultSetupOptionsPayload? = nil, codeScanningDelegatedAlertDismissal: Components.Schemas.CodeSecurityConfiguration.CodeScanningDelegatedAlertDismissalPayload? = nil, @@ -1349,6 +1374,7 @@ public enum Components { self.dependencyGraphAutosubmitActionOptions = dependencyGraphAutosubmitActionOptions self.dependabotAlerts = dependabotAlerts self.dependabotSecurityUpdates = dependabotSecurityUpdates + self.codeScanningOptions = codeScanningOptions self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions self.codeScanningDelegatedAlertDismissal = codeScanningDelegatedAlertDismissal @@ -1378,6 +1404,7 @@ public enum Components { case dependencyGraphAutosubmitActionOptions = "dependency_graph_autosubmit_action_options" case dependabotAlerts = "dependabot_alerts" case dependabotSecurityUpdates = "dependabot_security_updates" + case codeScanningOptions = "code_scanning_options" case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" case codeScanningDelegatedAlertDismissal = "code_scanning_delegated_alert_dismissal" @@ -1397,6 +1424,25 @@ public enum Components { case updatedAt = "updated_at" } } + /// Security Configuration feature options for code scanning + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-options`. + public struct CodeScanningOptions: Codable, Hashable, Sendable { + /// Whether to allow repos which use advanced setup + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-options/allow_advanced`. + public var allowAdvanced: Swift.Bool? + /// Creates a new `CodeScanningOptions`. + /// + /// - Parameters: + /// - allowAdvanced: Whether to allow repos which use advanced setup + public init(allowAdvanced: Swift.Bool? = nil) { + self.allowAdvanced = allowAdvanced + } + public enum CodingKeys: String, CodingKey { + case allowAdvanced = "allow_advanced" + } + } /// Feature options for code scanning default setup /// /// - Remark: Generated from `#/components/schemas/code-scanning-default-setup-options`. @@ -1933,7 +1979,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/pagination-after`. public typealias PaginationAfter = Swift.String - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/components/parameters/enterprise`. public typealias Enterprise = Swift.String @@ -1941,6 +1987,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/configuration-id`. public typealias ConfigurationId = Swift.Int + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -1949,10 +1999,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repo`. public typealias Repo = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} @@ -2152,14 +2198,14 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/GET/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/GET/path/enterprise`. public var enterprise: Components.Parameters.Enterprise /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. public init(enterprise: Components.Parameters.Enterprise) { self.enterprise = enterprise } @@ -2368,14 +2414,14 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/path/enterprise`. public var enterprise: Components.Parameters.Enterprise /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. public init(enterprise: Components.Parameters.Enterprise) { self.enterprise = enterprise } @@ -2407,6 +2453,10 @@ public enum Operations { public var description: Swift.String /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/advanced_security`. @frozen public enum AdvancedSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { case enabled = "enabled" @@ -2416,8 +2466,24 @@ public enum Operations { } /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/advanced_security`. public var advancedSecurity: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.AdvancedSecurityPayload? + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_security`. + @frozen public enum CodeSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_security`. + public var codeSecurity: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeSecurityPayload? /// The enablement status of Dependency Graph /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependency_graph`. @@ -2489,6 +2555,8 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/dependabot_security_updates`. public var dependabotSecurityUpdates: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_scanning_options`. + public var codeScanningOptions: Components.Schemas.CodeScanningOptions? /// The enablement status of code scanning default setup /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_scanning_default_setup`. @@ -2515,6 +2583,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/code_scanning_delegated_alert_dismissal`. public var codeScanningDelegatedAlertDismissal: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_protection`. + @frozen public enum SecretProtectionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_protection`. + public var secretProtection: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretProtectionPayload? /// The enablement status of secret scanning /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/POST/requestBody/json/secret_scanning`. @@ -2616,14 +2696,17 @@ public enum Operations { /// - name: The name of the code security configuration. Must be unique within the enterprise. /// - description: A description of the code security configuration /// - advancedSecurity: The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. + /// - codeSecurity: The enablement status of GitHub Code Security features. /// - dependencyGraph: The enablement status of Dependency Graph /// - dependencyGraphAutosubmitAction: The enablement status of Automatic dependency submission /// - dependencyGraphAutosubmitActionOptions: Feature options for Automatic dependency submission /// - dependabotAlerts: The enablement status of Dependabot alerts /// - dependabotSecurityUpdates: The enablement status of Dependabot security updates + /// - codeScanningOptions: /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: /// - codeScanningDelegatedAlertDismissal: The enablement status of code scanning delegated alert dismissal + /// - secretProtection: The enablement status of GitHub Secret Protection features. /// - secretScanning: The enablement status of secret scanning /// - secretScanningPushProtection: The enablement status of secret scanning push protection /// - secretScanningValidityChecks: The enablement status of secret scanning validity checks @@ -2636,14 +2719,17 @@ public enum Operations { name: Swift.String, description: Swift.String, advancedSecurity: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.AdvancedSecurityPayload? = nil, + codeSecurity: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeSecurityPayload? = nil, dependencyGraph: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependencyGraphPayload? = nil, dependencyGraphAutosubmitAction: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependencyGraphAutosubmitActionPayload? = nil, dependencyGraphAutosubmitActionOptions: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependencyGraphAutosubmitActionOptionsPayload? = nil, dependabotAlerts: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependabotAlertsPayload? = nil, dependabotSecurityUpdates: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? = nil, + codeScanningOptions: Components.Schemas.CodeScanningOptions? = nil, codeScanningDefaultSetup: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeScanningDefaultSetupOptions? = nil, codeScanningDelegatedAlertDismissal: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? = nil, + secretProtection: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretProtectionPayload? = nil, secretScanning: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningPayload? = nil, secretScanningPushProtection: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningPushProtectionPayload? = nil, secretScanningValidityChecks: Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningValidityChecksPayload? = nil, @@ -2656,14 +2742,17 @@ public enum Operations { self.name = name self.description = description self.advancedSecurity = advancedSecurity + self.codeSecurity = codeSecurity self.dependencyGraph = dependencyGraph self.dependencyGraphAutosubmitAction = dependencyGraphAutosubmitAction self.dependencyGraphAutosubmitActionOptions = dependencyGraphAutosubmitActionOptions self.dependabotAlerts = dependabotAlerts self.dependabotSecurityUpdates = dependabotSecurityUpdates + self.codeScanningOptions = codeScanningOptions self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions self.codeScanningDelegatedAlertDismissal = codeScanningDelegatedAlertDismissal + self.secretProtection = secretProtection self.secretScanning = secretScanning self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningValidityChecks = secretScanningValidityChecks @@ -2677,14 +2766,17 @@ public enum Operations { case name case description case advancedSecurity = "advanced_security" + case codeSecurity = "code_security" case dependencyGraph = "dependency_graph" case dependencyGraphAutosubmitAction = "dependency_graph_autosubmit_action" case dependencyGraphAutosubmitActionOptions = "dependency_graph_autosubmit_action_options" case dependabotAlerts = "dependabot_alerts" case dependabotSecurityUpdates = "dependabot_security_updates" + case codeScanningOptions = "code_scanning_options" case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" case codeScanningDelegatedAlertDismissal = "code_scanning_delegated_alert_dismissal" + case secretProtection = "secret_protection" case secretScanning = "secret_scanning" case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningValidityChecks = "secret_scanning_validity_checks" @@ -2708,6 +2800,10 @@ public enum Operations { Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.AdvancedSecurityPayload.self, forKey: .advancedSecurity ) + self.codeSecurity = try container.decodeIfPresent( + Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeSecurityPayload.self, + forKey: .codeSecurity + ) self.dependencyGraph = try container.decodeIfPresent( Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependencyGraphPayload.self, forKey: .dependencyGraph @@ -2728,6 +2824,10 @@ public enum Operations { Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload.self, forKey: .dependabotSecurityUpdates ) + self.codeScanningOptions = try container.decodeIfPresent( + Components.Schemas.CodeScanningOptions.self, + forKey: .codeScanningOptions + ) self.codeScanningDefaultSetup = try container.decodeIfPresent( Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload.self, forKey: .codeScanningDefaultSetup @@ -2740,6 +2840,10 @@ public enum Operations { Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload.self, forKey: .codeScanningDelegatedAlertDismissal ) + self.secretProtection = try container.decodeIfPresent( + Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretProtectionPayload.self, + forKey: .secretProtection + ) self.secretScanning = try container.decodeIfPresent( Operations.CodeSecurityCreateConfigurationForEnterprise.Input.Body.JsonPayload.SecretScanningPayload.self, forKey: .secretScanning @@ -2776,14 +2880,17 @@ public enum Operations { "name", "description", "advanced_security", + "code_security", "dependency_graph", "dependency_graph_autosubmit_action", "dependency_graph_autosubmit_action_options", "dependabot_alerts", "dependabot_security_updates", + "code_scanning_options", "code_scanning_default_setup", "code_scanning_default_setup_options", "code_scanning_delegated_alert_dismissal", + "secret_protection", "secret_scanning", "secret_scanning_push_protection", "secret_scanning_validity_checks", @@ -2988,14 +3095,14 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/defaults/GET/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/defaults/GET/path/enterprise`. public var enterprise: Components.Parameters.Enterprise /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. public init(enterprise: Components.Parameters.Enterprise) { self.enterprise = enterprise } @@ -3124,7 +3231,7 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/GET/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/GET/path/enterprise`. public var enterprise: Components.Parameters.Enterprise @@ -3135,7 +3242,7 @@ public enum Operations { /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. /// - configurationId: The unique identifier of the code security configuration. public init( enterprise: Components.Parameters.Enterprise, @@ -3346,7 +3453,7 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/path/enterprise`. public var enterprise: Components.Parameters.Enterprise @@ -3357,7 +3464,7 @@ public enum Operations { /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. /// - configurationId: The unique identifier of the code security configuration. public init( enterprise: Components.Parameters.Enterprise, @@ -3394,6 +3501,10 @@ public enum Operations { public var description: Swift.String? /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/advanced_security`. @frozen public enum AdvancedSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { case enabled = "enabled" @@ -3403,8 +3514,24 @@ public enum Operations { } /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/advanced_security`. public var advancedSecurity: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload? + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_security`. + @frozen public enum CodeSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_security`. + public var codeSecurity: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeSecurityPayload? /// The enablement status of Dependency Graph /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph`. @@ -3502,6 +3629,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_delegated_alert_dismissal`. public var codeScanningDelegatedAlertDismissal: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_protection`. + @frozen public enum SecretProtectionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_protection`. + public var secretProtection: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretProtectionPayload? /// The enablement status of secret scanning /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning`. @@ -3603,6 +3742,7 @@ public enum Operations { /// - name: The name of the code security configuration. Must be unique across the enterprise. /// - description: A description of the code security configuration /// - advancedSecurity: The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. + /// - codeSecurity: The enablement status of GitHub Code Security features. /// - dependencyGraph: The enablement status of Dependency Graph /// - dependencyGraphAutosubmitAction: The enablement status of Automatic dependency submission /// - dependencyGraphAutosubmitActionOptions: Feature options for Automatic dependency submission @@ -3611,6 +3751,7 @@ public enum Operations { /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: /// - codeScanningDelegatedAlertDismissal: The enablement status of code scanning delegated alert dismissal + /// - secretProtection: The enablement status of GitHub Secret Protection features. /// - secretScanning: The enablement status of secret scanning /// - secretScanningPushProtection: The enablement status of secret scanning push protection /// - secretScanningValidityChecks: The enablement status of secret scanning validity checks @@ -3623,6 +3764,7 @@ public enum Operations { name: Swift.String? = nil, description: Swift.String? = nil, advancedSecurity: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload? = nil, + codeSecurity: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeSecurityPayload? = nil, dependencyGraph: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.DependencyGraphPayload? = nil, dependencyGraphAutosubmitAction: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.DependencyGraphAutosubmitActionPayload? = nil, dependencyGraphAutosubmitActionOptions: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.DependencyGraphAutosubmitActionOptionsPayload? = nil, @@ -3631,6 +3773,7 @@ public enum Operations { codeScanningDefaultSetup: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeScanningDefaultSetupOptions? = nil, codeScanningDelegatedAlertDismissal: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? = nil, + secretProtection: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretProtectionPayload? = nil, secretScanning: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningPayload? = nil, secretScanningPushProtection: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningPushProtectionPayload? = nil, secretScanningValidityChecks: Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningValidityChecksPayload? = nil, @@ -3643,6 +3786,7 @@ public enum Operations { self.name = name self.description = description self.advancedSecurity = advancedSecurity + self.codeSecurity = codeSecurity self.dependencyGraph = dependencyGraph self.dependencyGraphAutosubmitAction = dependencyGraphAutosubmitAction self.dependencyGraphAutosubmitActionOptions = dependencyGraphAutosubmitActionOptions @@ -3651,6 +3795,7 @@ public enum Operations { self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions self.codeScanningDelegatedAlertDismissal = codeScanningDelegatedAlertDismissal + self.secretProtection = secretProtection self.secretScanning = secretScanning self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningValidityChecks = secretScanningValidityChecks @@ -3664,6 +3809,7 @@ public enum Operations { case name case description case advancedSecurity = "advanced_security" + case codeSecurity = "code_security" case dependencyGraph = "dependency_graph" case dependencyGraphAutosubmitAction = "dependency_graph_autosubmit_action" case dependencyGraphAutosubmitActionOptions = "dependency_graph_autosubmit_action_options" @@ -3672,6 +3818,7 @@ public enum Operations { case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" case codeScanningDelegatedAlertDismissal = "code_scanning_delegated_alert_dismissal" + case secretProtection = "secret_protection" case secretScanning = "secret_scanning" case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningValidityChecks = "secret_scanning_validity_checks" @@ -3695,6 +3842,10 @@ public enum Operations { Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload.self, forKey: .advancedSecurity ) + self.codeSecurity = try container.decodeIfPresent( + Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeSecurityPayload.self, + forKey: .codeSecurity + ) self.dependencyGraph = try container.decodeIfPresent( Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.DependencyGraphPayload.self, forKey: .dependencyGraph @@ -3727,6 +3878,10 @@ public enum Operations { Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload.self, forKey: .codeScanningDelegatedAlertDismissal ) + self.secretProtection = try container.decodeIfPresent( + Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretProtectionPayload.self, + forKey: .secretProtection + ) self.secretScanning = try container.decodeIfPresent( Operations.CodeSecurityUpdateEnterpriseConfiguration.Input.Body.JsonPayload.SecretScanningPayload.self, forKey: .secretScanning @@ -3763,6 +3918,7 @@ public enum Operations { "name", "description", "advanced_security", + "code_security", "dependency_graph", "dependency_graph_autosubmit_action", "dependency_graph_autosubmit_action_options", @@ -3771,6 +3927,7 @@ public enum Operations { "code_scanning_default_setup", "code_scanning_default_setup_options", "code_scanning_delegated_alert_dismissal", + "secret_protection", "secret_scanning", "secret_scanning_push_protection", "secret_scanning_validity_checks", @@ -4002,7 +4159,7 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/DELETE/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/DELETE/path/enterprise`. public var enterprise: Components.Parameters.Enterprise @@ -4013,7 +4170,7 @@ public enum Operations { /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. /// - configurationId: The unique identifier of the code security configuration. public init( enterprise: Components.Parameters.Enterprise, @@ -4227,7 +4384,7 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/POST/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach/POST/path/enterprise`. public var enterprise: Components.Parameters.Enterprise @@ -4238,7 +4395,7 @@ public enum Operations { /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. /// - configurationId: The unique identifier of the code security configuration. public init( enterprise: Components.Parameters.Enterprise, @@ -4458,7 +4615,7 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults/PUT/path/enterprise`. public var enterprise: Components.Parameters.Enterprise @@ -4469,7 +4626,7 @@ public enum Operations { /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. /// - configurationId: The unique identifier of the code security configuration. public init( enterprise: Components.Parameters.Enterprise, @@ -4718,7 +4875,7 @@ public enum Operations { public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/GET/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The slug version of the enterprise name. /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories/GET/path/enterprise`. public var enterprise: Components.Parameters.Enterprise @@ -4729,7 +4886,7 @@ public enum Operations { /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// - enterprise: The slug version of the enterprise name. /// - configurationId: The unique identifier of the code security configuration. public init( enterprise: Components.Parameters.Enterprise, @@ -4943,7 +5100,7 @@ public enum Operations { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/get(code-security/get-configurations-for-org)`. @@ -5219,6 +5376,10 @@ public enum Operations { public var description: Swift.String /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/advanced_security`. @frozen public enum AdvancedSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { case enabled = "enabled" @@ -5228,8 +5389,24 @@ public enum Operations { } /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/advanced_security`. public var advancedSecurity: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload? + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_security`. + @frozen public enum CodeSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_security`. + public var codeSecurity: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeSecurityPayload? /// The enablement status of Dependency Graph /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependency_graph`. @@ -5301,6 +5478,8 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/dependabot_security_updates`. public var dependabotSecurityUpdates: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_scanning_options`. + public var codeScanningOptions: Components.Schemas.CodeScanningOptions? /// The enablement status of code scanning default setup /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_scanning_default_setup`. @@ -5327,6 +5506,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/code_scanning_delegated_alert_dismissal`. public var codeScanningDelegatedAlertDismissal: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_protection`. + @frozen public enum SecretProtectionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_protection`. + public var secretProtection: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretProtectionPayload? /// The enablement status of secret scanning /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/POST/requestBody/json/secret_scanning`. @@ -5501,14 +5692,17 @@ public enum Operations { /// - name: The name of the code security configuration. Must be unique within the organization. /// - description: A description of the code security configuration /// - advancedSecurity: The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. + /// - codeSecurity: The enablement status of GitHub Code Security features. /// - dependencyGraph: The enablement status of Dependency Graph /// - dependencyGraphAutosubmitAction: The enablement status of Automatic dependency submission /// - dependencyGraphAutosubmitActionOptions: Feature options for Automatic dependency submission /// - dependabotAlerts: The enablement status of Dependabot alerts /// - dependabotSecurityUpdates: The enablement status of Dependabot security updates + /// - codeScanningOptions: /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: /// - codeScanningDelegatedAlertDismissal: The enablement status of code scanning delegated alert dismissal + /// - secretProtection: The enablement status of GitHub Secret Protection features. /// - secretScanning: The enablement status of secret scanning /// - secretScanningPushProtection: The enablement status of secret scanning push protection /// - secretScanningDelegatedBypass: The enablement status of secret scanning delegated bypass @@ -5523,14 +5717,17 @@ public enum Operations { name: Swift.String, description: Swift.String, advancedSecurity: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload? = nil, + codeSecurity: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeSecurityPayload? = nil, dependencyGraph: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependencyGraphPayload? = nil, dependencyGraphAutosubmitAction: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependencyGraphAutosubmitActionPayload? = nil, dependencyGraphAutosubmitActionOptions: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependencyGraphAutosubmitActionOptionsPayload? = nil, dependabotAlerts: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotAlertsPayload? = nil, dependabotSecurityUpdates: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload? = nil, + codeScanningOptions: Components.Schemas.CodeScanningOptions? = nil, codeScanningDefaultSetup: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeScanningDefaultSetupOptions? = nil, codeScanningDelegatedAlertDismissal: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? = nil, + secretProtection: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretProtectionPayload? = nil, secretScanning: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningPayload? = nil, secretScanningPushProtection: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningPushProtectionPayload? = nil, secretScanningDelegatedBypass: Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningDelegatedBypassPayload? = nil, @@ -5545,14 +5742,17 @@ public enum Operations { self.name = name self.description = description self.advancedSecurity = advancedSecurity + self.codeSecurity = codeSecurity self.dependencyGraph = dependencyGraph self.dependencyGraphAutosubmitAction = dependencyGraphAutosubmitAction self.dependencyGraphAutosubmitActionOptions = dependencyGraphAutosubmitActionOptions self.dependabotAlerts = dependabotAlerts self.dependabotSecurityUpdates = dependabotSecurityUpdates + self.codeScanningOptions = codeScanningOptions self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions self.codeScanningDelegatedAlertDismissal = codeScanningDelegatedAlertDismissal + self.secretProtection = secretProtection self.secretScanning = secretScanning self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningDelegatedBypass = secretScanningDelegatedBypass @@ -5568,14 +5768,17 @@ public enum Operations { case name case description case advancedSecurity = "advanced_security" + case codeSecurity = "code_security" case dependencyGraph = "dependency_graph" case dependencyGraphAutosubmitAction = "dependency_graph_autosubmit_action" case dependencyGraphAutosubmitActionOptions = "dependency_graph_autosubmit_action_options" case dependabotAlerts = "dependabot_alerts" case dependabotSecurityUpdates = "dependabot_security_updates" + case codeScanningOptions = "code_scanning_options" case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" case codeScanningDelegatedAlertDismissal = "code_scanning_delegated_alert_dismissal" + case secretProtection = "secret_protection" case secretScanning = "secret_scanning" case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" @@ -5601,6 +5804,10 @@ public enum Operations { Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload.self, forKey: .advancedSecurity ) + self.codeSecurity = try container.decodeIfPresent( + Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeSecurityPayload.self, + forKey: .codeSecurity + ) self.dependencyGraph = try container.decodeIfPresent( Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependencyGraphPayload.self, forKey: .dependencyGraph @@ -5621,6 +5828,10 @@ public enum Operations { Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.DependabotSecurityUpdatesPayload.self, forKey: .dependabotSecurityUpdates ) + self.codeScanningOptions = try container.decodeIfPresent( + Components.Schemas.CodeScanningOptions.self, + forKey: .codeScanningOptions + ) self.codeScanningDefaultSetup = try container.decodeIfPresent( Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload.self, forKey: .codeScanningDefaultSetup @@ -5633,6 +5844,10 @@ public enum Operations { Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload.self, forKey: .codeScanningDelegatedAlertDismissal ) + self.secretProtection = try container.decodeIfPresent( + Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretProtectionPayload.self, + forKey: .secretProtection + ) self.secretScanning = try container.decodeIfPresent( Operations.CodeSecurityCreateConfiguration.Input.Body.JsonPayload.SecretScanningPayload.self, forKey: .secretScanning @@ -5677,14 +5892,17 @@ public enum Operations { "name", "description", "advanced_security", + "code_security", "dependency_graph", "dependency_graph_autosubmit_action", "dependency_graph_autosubmit_action_options", "dependabot_alerts", "dependabot_security_updates", + "code_scanning_options", "code_scanning_default_setup", "code_scanning_default_setup_options", "code_scanning_delegated_alert_dismissal", + "secret_protection", "secret_scanning", "secret_scanning_push_protection", "secret_scanning_delegated_bypass", @@ -5807,7 +6025,7 @@ public enum Operations { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/defaults`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/defaults/get(code-security/get-default-configurations)`. @@ -6059,14 +6277,14 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/detach/DELETE/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// An array of repository IDs to detach from configurations. + /// 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]? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - selectedRepositoryIds: An array of repository IDs to detach from configurations. + /// - selectedRepositoryIds: An array of repository IDs to detach from configurations. Up to 250 IDs can be provided. public init(selectedRepositoryIds: [Swift.Int]? = nil) { self.selectedRepositoryIds = selectedRepositoryIds } @@ -6550,6 +6768,10 @@ public enum Operations { public var description: Swift.String? /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/advanced_security`. @frozen public enum AdvancedSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { case enabled = "enabled" @@ -6559,8 +6781,24 @@ public enum Operations { } /// The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. /// + /// > [!WARNING] + /// > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features. + /// + /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/advanced_security`. public var advancedSecurity: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload? + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_security`. + @frozen public enum CodeSecurityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Code Security features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_security`. + public var codeSecurity: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeSecurityPayload? /// The enablement status of Dependency Graph /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/dependency_graph`. @@ -6658,6 +6896,18 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/code_scanning_delegated_alert_dismissal`. public var codeScanningDelegatedAlertDismissal: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_protection`. + @frozen public enum SecretProtectionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + case notSet = "not_set" + } + /// The enablement status of GitHub Secret Protection features. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_protection`. + public var secretProtection: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretProtectionPayload? /// The enablement status of secret scanning /// /// - Remark: Generated from `#/paths/orgs/{org}/code-security/configurations/{configuration_id}/PATCH/requestBody/json/secret_scanning`. @@ -6832,6 +7082,7 @@ public enum Operations { /// - name: The name of the code security configuration. Must be unique within the organization. /// - description: A description of the code security configuration /// - advancedSecurity: The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. + /// - codeSecurity: The enablement status of GitHub Code Security features. /// - dependencyGraph: The enablement status of Dependency Graph /// - dependencyGraphAutosubmitAction: The enablement status of Automatic dependency submission /// - dependencyGraphAutosubmitActionOptions: Feature options for Automatic dependency submission @@ -6840,6 +7091,7 @@ public enum Operations { /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: /// - codeScanningDelegatedAlertDismissal: The enablement status of code scanning delegated alert dismissal + /// - secretProtection: The enablement status of GitHub Secret Protection features. /// - secretScanning: The enablement status of secret scanning /// - secretScanningPushProtection: The enablement status of secret scanning push protection /// - secretScanningDelegatedBypass: The enablement status of secret scanning delegated bypass @@ -6854,6 +7106,7 @@ public enum Operations { name: Swift.String? = nil, description: Swift.String? = nil, advancedSecurity: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload? = nil, + codeSecurity: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeSecurityPayload? = nil, dependencyGraph: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependencyGraphPayload? = nil, dependencyGraphAutosubmitAction: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependencyGraphAutosubmitActionPayload? = nil, dependencyGraphAutosubmitActionOptions: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependencyGraphAutosubmitActionOptionsPayload? = nil, @@ -6862,6 +7115,7 @@ public enum Operations { codeScanningDefaultSetup: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeScanningDefaultSetupOptions? = nil, codeScanningDelegatedAlertDismissal: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload? = nil, + secretProtection: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretProtectionPayload? = nil, secretScanning: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningPayload? = nil, secretScanningPushProtection: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningPushProtectionPayload? = nil, secretScanningDelegatedBypass: Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningDelegatedBypassPayload? = nil, @@ -6876,6 +7130,7 @@ public enum Operations { self.name = name self.description = description self.advancedSecurity = advancedSecurity + self.codeSecurity = codeSecurity self.dependencyGraph = dependencyGraph self.dependencyGraphAutosubmitAction = dependencyGraphAutosubmitAction self.dependencyGraphAutosubmitActionOptions = dependencyGraphAutosubmitActionOptions @@ -6884,6 +7139,7 @@ public enum Operations { self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions self.codeScanningDelegatedAlertDismissal = codeScanningDelegatedAlertDismissal + self.secretProtection = secretProtection self.secretScanning = secretScanning self.secretScanningPushProtection = secretScanningPushProtection self.secretScanningDelegatedBypass = secretScanningDelegatedBypass @@ -6899,6 +7155,7 @@ public enum Operations { case name case description case advancedSecurity = "advanced_security" + case codeSecurity = "code_security" case dependencyGraph = "dependency_graph" case dependencyGraphAutosubmitAction = "dependency_graph_autosubmit_action" case dependencyGraphAutosubmitActionOptions = "dependency_graph_autosubmit_action_options" @@ -6907,6 +7164,7 @@ public enum Operations { case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" case codeScanningDelegatedAlertDismissal = "code_scanning_delegated_alert_dismissal" + case secretProtection = "secret_protection" case secretScanning = "secret_scanning" case secretScanningPushProtection = "secret_scanning_push_protection" case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" @@ -6932,6 +7190,10 @@ public enum Operations { Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.AdvancedSecurityPayload.self, forKey: .advancedSecurity ) + self.codeSecurity = try container.decodeIfPresent( + Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeSecurityPayload.self, + forKey: .codeSecurity + ) self.dependencyGraph = try container.decodeIfPresent( Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.DependencyGraphPayload.self, forKey: .dependencyGraph @@ -6964,6 +7226,10 @@ public enum Operations { Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.CodeScanningDelegatedAlertDismissalPayload.self, forKey: .codeScanningDelegatedAlertDismissal ) + self.secretProtection = try container.decodeIfPresent( + Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretProtectionPayload.self, + forKey: .secretProtection + ) self.secretScanning = try container.decodeIfPresent( Operations.CodeSecurityUpdateConfiguration.Input.Body.JsonPayload.SecretScanningPayload.self, forKey: .secretScanning @@ -7008,6 +7274,7 @@ public enum Operations { "name", "description", "advanced_security", + "code_security", "dependency_graph", "dependency_graph_autosubmit_action", "dependency_graph_autosubmit_action_options", @@ -7016,6 +7283,7 @@ public enum Operations { "code_scanning_default_setup", "code_scanning_default_setup_options", "code_scanning_delegated_alert_dismissal", + "secret_protection", "secret_scanning", "secret_scanning_push_protection", "secret_scanning_delegated_bypass", @@ -7840,7 +8108,7 @@ public enum Operations { /// /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. /// /// - Remark: HTTP `GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories`. /// - Remark: Generated from `#/paths//orgs/{org}/code-security/configurations/{configuration_id}/repositories/get(code-security/get-repositories-for-configuration)`. diff --git a/Sources/codespaces/Types.swift b/Sources/codespaces/Types.swift index 186bdd0aacc..9b8a0de7c81 100644 --- a/Sources/codespaces/Types.swift +++ b/Sources/codespaces/Types.swift @@ -2309,6 +2309,35 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/anonymous_access_enabled`. public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? /// Creates a new `Repository`. /// /// - Parameters: @@ -2407,6 +2436,7 @@ public enum Components { /// - masterBranch: /// - starredAt: /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository public init( id: Swift.Int64, nodeId: Swift.String, @@ -2502,7 +2532,8 @@ public enum Components { watchers: Swift.Int, masterBranch: Swift.String? = nil, starredAt: Swift.String? = nil, - anonymousAccessEnabled: Swift.Bool? = nil + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -2599,6 +2630,7 @@ public enum Components { self.masterBranch = masterBranch self.starredAt = starredAt self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus } public enum CodingKeys: String, CodingKey { case id @@ -2696,6 +2728,7 @@ public enum Components { case masterBranch = "master_branch" case starredAt = "starred_at" case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" } } /// Code Of Conduct @@ -2743,6 +2776,11 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -2763,6 +2801,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -2908,7 +2951,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: @@ -3204,6 +3247,30 @@ public enum Components { public var webCommitSignoffRequired: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/security_and_analysis`. public var securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public struct CustomPropertiesPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CustomPropertiesPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public var customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? /// Creates a new `MinimalRepository`. /// /// - Parameters: @@ -3294,6 +3361,7 @@ public enum Components { /// - allowForking: /// - webCommitSignoffRequired: /// - securityAndAnalysis: + /// - customProperties: The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. public init( id: Swift.Int64, nodeId: Swift.String, @@ -3381,7 +3449,8 @@ public enum Components { watchers: Swift.Int? = nil, allowForking: Swift.Bool? = nil, webCommitSignoffRequired: Swift.Bool? = nil, - securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil + securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil, + customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -3470,6 +3539,7 @@ public enum Components { self.allowForking = allowForking self.webCommitSignoffRequired = webCommitSignoffRequired self.securityAndAnalysis = securityAndAnalysis + self.customProperties = customProperties } public enum CodingKeys: String, CodingKey { case id @@ -3559,6 +3629,7 @@ public enum Components { case allowForking = "allow_forking" case webCommitSignoffRequired = "web_commit_signoff_required" case securityAndAnalysis = "security_and_analysis" + case customProperties = "custom_properties" } } /// An object without any properties. @@ -4465,6 +4536,35 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-repository/anonymous_access_enabled`. public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.NullableRepository.CodeSearchIndexStatusPayload? /// Creates a new `NullableRepository`. /// /// - Parameters: @@ -4563,6 +4663,7 @@ public enum Components { /// - masterBranch: /// - starredAt: /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository public init( id: Swift.Int64, nodeId: Swift.String, @@ -4658,7 +4759,8 @@ public enum Components { watchers: Swift.Int, masterBranch: Swift.String? = nil, starredAt: Swift.String? = nil, - anonymousAccessEnabled: Swift.Bool? = nil + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.NullableRepository.CodeSearchIndexStatusPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -4755,6 +4857,7 @@ public enum Components { self.masterBranch = masterBranch self.starredAt = starredAt self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus } public enum CodingKeys: String, CodingKey { case id @@ -4852,6 +4955,7 @@ public enum Components { case masterBranch = "master_branch" case starredAt = "starred_at" case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" } } /// Code of Conduct Simple @@ -6302,6 +6406,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -6310,18 +6422,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repo`. public typealias Repo = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String /// The name of the secret. /// /// - Remark: Generated from `#/components/parameters/secret-name`. public typealias SecretName = Swift.String - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String /// The name of the codespace. /// /// - Remark: Generated from `#/components/parameters/codespace-name`. diff --git a/Sources/copilot/Client.swift b/Sources/copilot/Client.swift index 14777b85615..99521ac3fdf 100644 --- a/Sources/copilot/Client.swift +++ b/Sources/copilot/Client.swift @@ -210,7 +210,7 @@ public struct Client: APIProtocol { /// Only organization owners can view assigned seats. /// /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// @@ -1089,7 +1089,7 @@ public struct Client: APIProtocol { /// > [!NOTE] /// > This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, /// they must have telemetry enabled in their IDE. /// @@ -1282,7 +1282,7 @@ public struct Client: APIProtocol { /// Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot. /// /// The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// Only organization owners can view Copilot seat assignment details for members of their organization. /// @@ -1446,7 +1446,7 @@ public struct Client: APIProtocol { /// > [!NOTE] /// > This endpoint will only return results for a given day if the team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, /// they must have telemetry enabled in their IDE. /// diff --git a/Sources/copilot/Types.swift b/Sources/copilot/Types.swift index 887e63c6249..8c432ff2133 100644 --- a/Sources/copilot/Types.swift +++ b/Sources/copilot/Types.swift @@ -36,7 +36,7 @@ public protocol APIProtocol: Sendable { /// Only organization owners can view assigned seats. /// /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// @@ -124,7 +124,7 @@ public protocol APIProtocol: Sendable { /// > [!NOTE] /// > This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, /// they must have telemetry enabled in their IDE. /// @@ -144,7 +144,7 @@ public protocol APIProtocol: Sendable { /// Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot. /// /// The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// Only organization owners can view Copilot seat assignment details for members of their organization. /// @@ -160,7 +160,7 @@ public protocol APIProtocol: Sendable { /// > [!NOTE] /// > This endpoint will only return results for a given day if the team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, /// they must have telemetry enabled in their IDE. /// @@ -209,7 +209,7 @@ extension APIProtocol { /// Only organization owners can view assigned seats. /// /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// @@ -347,7 +347,7 @@ extension APIProtocol { /// > [!NOTE] /// > This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, /// they must have telemetry enabled in their IDE. /// @@ -377,7 +377,7 @@ extension APIProtocol { /// Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot. /// /// The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// Only organization owners can view Copilot seat assignment details for members of their organization. /// @@ -401,7 +401,7 @@ extension APIProtocol { /// > [!NOTE] /// > This endpoint will only return results for a given day if the team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, /// they must have telemetry enabled in their IDE. /// @@ -630,6 +630,101 @@ public enum Components { case userViewType = "user_view_type" } } + /// Group of enterprise owners and/or members + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team`. + public struct EnterpriseTeam: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/enterprise-team/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/enterprise-team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/url`. + public var url: Swift.String + /// Retired: this field will not be returned with GHEC enterprise teams. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/sync_to_organizations`. + public var syncToOrganizations: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/organization_selection_type`. + public var organizationSelectionType: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_id`. + public var groupId: Swift.String? + /// Retired: this field will not be returned with GHEC enterprise teams. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_name`. + public var groupName: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/members_url`. + public var membersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `EnterpriseTeam`. + /// + /// - Parameters: + /// - id: + /// - name: + /// - description: + /// - slug: + /// - url: + /// - syncToOrganizations: Retired: this field will not be returned with GHEC enterprise teams. + /// - organizationSelectionType: + /// - groupId: + /// - groupName: Retired: this field will not be returned with GHEC enterprise teams. + /// - htmlUrl: + /// - membersUrl: + /// - createdAt: + /// - updatedAt: + public init( + id: Swift.Int64, + name: Swift.String, + description: Swift.String? = nil, + slug: Swift.String, + url: Swift.String, + syncToOrganizations: Swift.String? = nil, + organizationSelectionType: Swift.String? = nil, + groupId: Swift.String? = nil, + groupName: Swift.String? = nil, + htmlUrl: Swift.String, + membersUrl: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.id = id + self.name = name + self.description = description + self.slug = slug + self.url = url + self.syncToOrganizations = syncToOrganizations + self.organizationSelectionType = organizationSelectionType + self.groupId = groupId + self.groupName = groupName + self.htmlUrl = htmlUrl + self.membersUrl = membersUrl + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case name + case description + case slug + case url + case syncToOrganizations = "sync_to_organizations" + case organizationSelectionType = "organization_selection_type" + case groupId = "group_id" + case groupName = "group_name" + case htmlUrl = "html_url" + case membersUrl = "members_url" + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } /// Groups of organization members that gives permissions on specified repositories. /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. @@ -676,6 +771,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -692,6 +806,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -705,7 +822,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -720,6 +840,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -735,6 +858,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -808,6 +934,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -826,6 +971,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -841,6 +989,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -856,6 +1007,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -872,6 +1026,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -1213,85 +1370,6 @@ public enum Components { case description } } - /// Group of enterprise owners and/or members - /// - /// - Remark: Generated from `#/components/schemas/enterprise-team`. - public struct EnterpriseTeam: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/enterprise-team/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/enterprise-team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/sync_to_organizations`. - public var syncToOrganizations: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/group_id`. - public var groupId: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise-team/group_name`. - public var groupName: Swift.String? - /// - Remark: Generated from `#/components/schemas/enterprise-team/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/members_url`. - public var membersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/enterprise-team/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. - public var updatedAt: Foundation.Date - /// Creates a new `EnterpriseTeam`. - /// - /// - Parameters: - /// - id: - /// - name: - /// - slug: - /// - url: - /// - syncToOrganizations: - /// - groupId: - /// - groupName: - /// - htmlUrl: - /// - membersUrl: - /// - createdAt: - /// - updatedAt: - public init( - id: Swift.Int64, - name: Swift.String, - slug: Swift.String, - url: Swift.String, - syncToOrganizations: Swift.String, - groupId: Swift.String? = nil, - groupName: Swift.String? = nil, - htmlUrl: Swift.String, - membersUrl: Swift.String, - createdAt: Foundation.Date, - updatedAt: Foundation.Date - ) { - self.id = id - self.name = name - self.slug = slug - self.url = url - self.syncToOrganizations = syncToOrganizations - self.groupId = groupId - self.groupName = groupName - self.htmlUrl = htmlUrl - self.membersUrl = membersUrl - self.createdAt = createdAt - self.updatedAt = updatedAt - } - public enum CodingKeys: String, CodingKey { - case id - case name - case slug - case url - case syncToOrganizations = "sync_to_organizations" - case groupId = "group_id" - case groupName = "group_name" - case htmlUrl = "html_url" - case membersUrl = "members_url" - case createdAt = "created_at" - case updatedAt = "updated_at" - } - } /// Information about a Copilot Business seat assignment for a user, team, or organization. /// /// - Remark: Generated from `#/components/schemas/copilot-seat-details`. @@ -1353,6 +1431,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_activity_editor`. public var lastActivityEditor: Swift.String? + /// Timestamp of the last time the user authenticated with GitHub Copilot, in ISO 8601 format. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-details/last_authenticated_at`. + public var lastAuthenticatedAt: Foundation.Date? /// Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. /// /// - Remark: Generated from `#/components/schemas/copilot-seat-details/created_at`. @@ -1383,6 +1465,7 @@ public enum Components { /// - pendingCancellationDate: The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle. /// - lastActivityAt: Timestamp of user's last GitHub Copilot activity, in ISO 8601 format. /// - lastActivityEditor: Last editor that was used by the user for a GitHub Copilot completion. + /// - lastAuthenticatedAt: Timestamp of the last time the user authenticated with GitHub Copilot, in ISO 8601 format. /// - createdAt: Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format. /// - updatedAt: **Closing down notice:** This field is no longer relevant and is closing down. Use the `created_at` field to determine when the assignee was last granted access to GitHub Copilot. Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format. /// - planType: The Copilot plan of the organization, or the parent enterprise, when applicable. @@ -1393,6 +1476,7 @@ public enum Components { pendingCancellationDate: Swift.String? = nil, lastActivityAt: Foundation.Date? = nil, lastActivityEditor: Swift.String? = nil, + lastAuthenticatedAt: Foundation.Date? = nil, createdAt: Foundation.Date, updatedAt: Foundation.Date? = nil, planType: Components.Schemas.CopilotSeatDetails.PlanTypePayload? = nil @@ -1403,6 +1487,7 @@ public enum Components { self.pendingCancellationDate = pendingCancellationDate self.lastActivityAt = lastActivityAt self.lastActivityEditor = lastActivityEditor + self.lastAuthenticatedAt = lastAuthenticatedAt self.createdAt = createdAt self.updatedAt = updatedAt self.planType = planType @@ -1414,6 +1499,7 @@ public enum Components { case pendingCancellationDate = "pending_cancellation_date" case lastActivityAt = "last_activity_at" case lastActivityEditor = "last_activity_editor" + case lastAuthenticatedAt = "last_authenticated_at" case createdAt = "created_at" case updatedAt = "updated_at" case planType = "plan_type" @@ -1444,6 +1530,10 @@ public enum Components { Swift.String.self, forKey: .lastActivityEditor ) + self.lastAuthenticatedAt = try container.decodeIfPresent( + Foundation.Date.self, + forKey: .lastAuthenticatedAt + ) self.createdAt = try container.decode( Foundation.Date.self, forKey: .createdAt @@ -1463,6 +1553,7 @@ public enum Components { "pending_cancellation_date", "last_activity_at", "last_activity_editor", + "last_authenticated_at", "created_at", "updated_at", "plan_type" @@ -2363,14 +2454,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String /// The handle for the GitHub user account. /// /// - Remark: Generated from `#/components/parameters/username`. public typealias Username = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// The slug of the team name. /// /// - Remark: Generated from `#/components/parameters/team-slug`. @@ -2807,7 +2898,7 @@ public enum Operations { /// Only organization owners can view assigned seats. /// /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// @@ -4363,7 +4454,7 @@ public enum Operations { /// > [!NOTE] /// > This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, /// they must have telemetry enabled in their IDE. /// @@ -4394,7 +4485,7 @@ public enum Operations { public var path: Operations.CopilotCopilotMetricsForOrganization.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/query`. public struct Query: Sendable, Hashable { - /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 100 days ago. /// /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/query/since`. public var since: Swift.String? @@ -4406,17 +4497,17 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/query/page`. public var page: Components.Parameters.Page? - /// The number of days of metrics to display per page (max 28). 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)." + /// The number of days of metrics to display per page (max 100). 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)." /// /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/query/per_page`. public var perPage: Swift.Int? /// Creates a new `Query`. /// /// - Parameters: - /// - since: Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + /// - since: Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 100 days ago. /// - until: Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. /// - page: The page number of the results to fetch. 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)." - /// - perPage: The number of days of metrics to display per page (max 28). 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)." + /// - perPage: The number of days of metrics to display per page (max 100). 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)." public init( since: Swift.String? = nil, until: Swift.String? = nil, @@ -4641,7 +4732,7 @@ public enum Operations { /// Gets the GitHub Copilot seat details for a member of an organization who currently has access to GitHub Copilot. /// /// The seat object contains information about the user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)." + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// /// Only organization owners can view Copilot seat assignment details for members of their organization. /// @@ -4918,7 +5009,7 @@ public enum Operations { /// > [!NOTE] /// > This endpoint will only return results for a given day if the team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day, + /// The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, /// they must have telemetry enabled in their IDE. /// @@ -4958,7 +5049,7 @@ public enum Operations { public var path: Operations.CopilotCopilotMetricsForTeam.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/query`. public struct Query: Sendable, Hashable { - /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 100 days ago. /// /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/query/since`. public var since: Swift.String? @@ -4970,17 +5061,17 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/query/page`. public var page: Components.Parameters.Page? - /// The number of days of metrics to display per page (max 28). 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)." + /// The number of days of metrics to display per page (max 100). 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)." /// /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/query/per_page`. public var perPage: Swift.Int? /// Creates a new `Query`. /// /// - Parameters: - /// - since: Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. + /// - since: Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 100 days ago. /// - until: Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. /// - page: The page number of the results to fetch. 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)." - /// - perPage: The number of days of metrics to display per page (max 28). 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)." + /// - perPage: The number of days of metrics to display per page (max 100). 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)." public init( since: Swift.String? = nil, until: Swift.String? = nil, diff --git a/Sources/credentials/Client.swift b/Sources/credentials/Client.swift new file mode 100644 index 00000000000..5b24d4971c1 --- /dev/null +++ b/Sources/credentials/Client.swift @@ -0,0 +1,168 @@ +// 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 + } + /// Revoke a list of credentials + /// + /// Submit a list of credentials to be revoked. This endpoint is intended to revoke credentials the caller does not own and may have found exposed on GitHub.com or elsewhere. It can also be used for credentials associated with an old user account that you no longer have access to. Credential owners will be notified of the revocation. + /// + /// This endpoint currently accepts the following credential types: + /// - Personal access tokens (classic) + /// - Fine-grained personal access tokens + /// + /// Revoked credentials may impact users on GitHub Free, Pro, & Team and GitHub Enterprise Cloud, and GitHub Enterprise Cloud with Enterprise Managed Users. + /// GitHub cannot reactivate any credentials that have been revoked; new credentials will need to be generated. + /// + /// To prevent abuse, this API is limited to only 60 unauthenticated requests per hour and a max of 1000 tokens per API request. + /// + /// > [!NOTE] + /// > Any authenticated requests will return a 403. + /// + /// - Remark: HTTP `POST /credentials/revoke`. + /// - Remark: Generated from `#/paths//credentials/revoke/post(credentials/revoke)`. + public func credentialsRevoke(_ input: Operations.CredentialsRevoke.Input) async throws -> Operations.CredentialsRevoke.Output { + try await client.send( + input: input, + forOperation: Operations.CredentialsRevoke.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/credentials/revoke", + parameters: [] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 202: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Accepted.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + OpenAPIRuntime.OpenAPIObjectContainer.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .accepted(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } +} diff --git a/Sources/credentials/Types.swift b/Sources/credentials/Types.swift new file mode 100644 index 00000000000..d4cad8dd0b2 --- /dev/null +++ b/Sources/credentials/Types.swift @@ -0,0 +1,425 @@ +// 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 { + /// Revoke a list of credentials + /// + /// Submit a list of credentials to be revoked. This endpoint is intended to revoke credentials the caller does not own and may have found exposed on GitHub.com or elsewhere. It can also be used for credentials associated with an old user account that you no longer have access to. Credential owners will be notified of the revocation. + /// + /// This endpoint currently accepts the following credential types: + /// - Personal access tokens (classic) + /// - Fine-grained personal access tokens + /// + /// Revoked credentials may impact users on GitHub Free, Pro, & Team and GitHub Enterprise Cloud, and GitHub Enterprise Cloud with Enterprise Managed Users. + /// GitHub cannot reactivate any credentials that have been revoked; new credentials will need to be generated. + /// + /// To prevent abuse, this API is limited to only 60 unauthenticated requests per hour and a max of 1000 tokens per API request. + /// + /// > [!NOTE] + /// > Any authenticated requests will return a 403. + /// + /// - Remark: HTTP `POST /credentials/revoke`. + /// - Remark: Generated from `#/paths//credentials/revoke/post(credentials/revoke)`. + func credentialsRevoke(_ input: Operations.CredentialsRevoke.Input) async throws -> Operations.CredentialsRevoke.Output +} + +/// Convenience overloads for operation inputs. +extension APIProtocol { + /// Revoke a list of credentials + /// + /// Submit a list of credentials to be revoked. This endpoint is intended to revoke credentials the caller does not own and may have found exposed on GitHub.com or elsewhere. It can also be used for credentials associated with an old user account that you no longer have access to. Credential owners will be notified of the revocation. + /// + /// This endpoint currently accepts the following credential types: + /// - Personal access tokens (classic) + /// - Fine-grained personal access tokens + /// + /// Revoked credentials may impact users on GitHub Free, Pro, & Team and GitHub Enterprise Cloud, and GitHub Enterprise Cloud with Enterprise Managed Users. + /// GitHub cannot reactivate any credentials that have been revoked; new credentials will need to be generated. + /// + /// To prevent abuse, this API is limited to only 60 unauthenticated requests per hour and a max of 1000 tokens per API request. + /// + /// > [!NOTE] + /// > Any authenticated requests will return a 403. + /// + /// - Remark: HTTP `POST /credentials/revoke`. + /// - Remark: Generated from `#/paths//credentials/revoke/post(credentials/revoke)`. + public func credentialsRevoke( + headers: Operations.CredentialsRevoke.Input.Headers = .init(), + body: Operations.CredentialsRevoke.Input.Body + ) async throws -> Operations.CredentialsRevoke.Output { + try await credentialsRevoke(Operations.CredentialsRevoke.Input( + headers: headers, + body: body + )) + } +} + +/// 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 { + /// Basic Error + /// + /// - Remark: Generated from `#/components/schemas/basic-error`. + public struct BasicError: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/basic-error/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/status`. + public var status: Swift.String? + /// Creates a new `BasicError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - url: + /// - status: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + url: Swift.String? = nil, + status: Swift.String? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.url = url + self.status = status + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case url + case status + } + } + /// Validation Error Simple + /// + /// - Remark: Generated from `#/components/schemas/validation-error-simple`. + public struct ValidationErrorSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error-simple/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error-simple/documentation_url`. + public var documentationUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error-simple/errors`. + public var errors: [Swift.String]? + /// Creates a new `ValidationErrorSimple`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String, + documentationUrl: Swift.String, + errors: [Swift.String]? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + } + /// 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 { + public struct ValidationFailedSimple: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. + case json(Components.Schemas.ValidationErrorSimple) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationErrorSimple { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailedSimple.Body + /// Creates a new `ValidationFailedSimple`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailedSimple.Body) { + self.body = body + } + } + public struct Accepted: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/accepted/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/accepted/content/application\/json`. + case json(OpenAPIRuntime.OpenAPIObjectContainer) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: OpenAPIRuntime.OpenAPIObjectContainer { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Accepted.Body + /// Creates a new `Accepted`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Accepted.Body) { + self.body = body + } + } + public struct InternalError: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.InternalError.Body + /// Creates a new `InternalError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.InternalError.Body) { + self.body = body + } + } + } + /// 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 { + /// Revoke a list of credentials + /// + /// Submit a list of credentials to be revoked. This endpoint is intended to revoke credentials the caller does not own and may have found exposed on GitHub.com or elsewhere. It can also be used for credentials associated with an old user account that you no longer have access to. Credential owners will be notified of the revocation. + /// + /// This endpoint currently accepts the following credential types: + /// - Personal access tokens (classic) + /// - Fine-grained personal access tokens + /// + /// Revoked credentials may impact users on GitHub Free, Pro, & Team and GitHub Enterprise Cloud, and GitHub Enterprise Cloud with Enterprise Managed Users. + /// GitHub cannot reactivate any credentials that have been revoked; new credentials will need to be generated. + /// + /// To prevent abuse, this API is limited to only 60 unauthenticated requests per hour and a max of 1000 tokens per API request. + /// + /// > [!NOTE] + /// > Any authenticated requests will return a 403. + /// + /// - Remark: HTTP `POST /credentials/revoke`. + /// - Remark: Generated from `#/paths//credentials/revoke/post(credentials/revoke)`. + public enum CredentialsRevoke { + public static let id: Swift.String = "credentials/revoke" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/credentials/revoke/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.CredentialsRevoke.Input.Headers + /// - Remark: Generated from `#/paths/credentials/revoke/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/credentials/revoke/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// A list of credentials to be revoked, up to 1000 per request. + /// + /// - Remark: Generated from `#/paths/credentials/revoke/POST/requestBody/json/credentials`. + public var credentials: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - credentials: A list of credentials to be revoked, up to 1000 per request. + public init(credentials: [Swift.String]) { + self.credentials = credentials + } + public enum CodingKeys: String, CodingKey { + case credentials + } + } + /// - Remark: Generated from `#/paths/credentials/revoke/POST/requestBody/content/application\/json`. + case json(Operations.CredentialsRevoke.Input.Body.JsonPayload) + } + public var body: Operations.CredentialsRevoke.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - headers: + /// - body: + public init( + headers: Operations.CredentialsRevoke.Input.Headers = .init(), + body: Operations.CredentialsRevoke.Input.Body + ) { + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + /// Accepted + /// + /// - Remark: Generated from `#/paths//credentials/revoke/post(credentials/revoke)/responses/202`. + /// + /// HTTP response code: `202 accepted`. + case accepted(Components.Responses.Accepted) + /// The associated value of the enum case if `self` is `.accepted`. + /// + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Components.Responses.Accepted { + get throws { + switch self { + case let .accepted(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "accepted", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//credentials/revoke/post(credentials/revoke)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//credentials/revoke/post(credentials/revoke)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } +} diff --git a/Sources/dependabot/Client.swift b/Sources/dependabot/Client.swift index 5da94b10665..96fe48e8226 100644 --- a/Sources/dependabot/Client.swift +++ b/Sources/dependabot/Client.swift @@ -147,15 +147,150 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "first", - value: input.query.first + name: "per_page", + value: input.query.perPage + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DependabotListAlertsForEnterprise.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.DependabotAlertWithRepository].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Lists the repositories Dependabot can access in an organization + /// + /// Lists repositories that organization admins have allowed Dependabot to access when updating dependencies. + /// > [!NOTE] + /// > This operation supports both server-to-server and user-to-server access. + /// Unauthorized users will not see the existence of this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/get(dependabot/repository-access-for-org)`. + public func dependabotRepositoryAccessForOrg(_ input: Operations.DependabotRepositoryAccessForOrg.Input) async throws -> Operations.DependabotRepositoryAccessForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.DependabotRepositoryAccessForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/organizations/{}/dependabot/repository-access", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "last", - value: input.query.last + name: "page", + value: input.query.page ) try converter.setQueryItemAsURI( in: &request, @@ -174,7 +309,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DependabotListAlertsForEnterprise.Output.Ok.Body + let body: Operations.DependabotRepositoryAccessForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -184,7 +319,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.DependabotAlertWithRepository].self, + Components.Schemas.DependabotRepositoryAccessDetails.self, from: responseBody, transforming: { value in .json(value) @@ -194,8 +329,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - case 304: - return .notModified(.init()) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -240,9 +373,74 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 422: + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Updates Dependabot's repository access list for an organization + /// + /// Updates repositories according to the list of repositories that organization admins have given Dependabot access to when they've updated dependencies. + /// + /// > [!NOTE] + /// > This operation supports both server-to-server and user-to-server access. + /// Unauthorized users will not see the existence of this endpoint. + /// + /// **Example request body:** + /// ```json + /// { + /// "repository_ids_to_add": [123, 456], + /// "repository_ids_to_remove": [789] + /// } + /// ``` + /// + /// - Remark: HTTP `PATCH /organizations/{org}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/patch(dependabot/update-repository-access-for-org)`. + public func dependabotUpdateRepositoryAccessForOrg(_ input: Operations.DependabotUpdateRepositoryAccessForOrg.Input) async throws -> Operations.DependabotUpdateRepositoryAccessForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.DependabotUpdateRepositoryAccessForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/organizations/{}/dependabot/repository-access", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -252,7 +450,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -261,7 +459,132 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set the default repository access level for Dependabot + /// + /// Sets the default level of repository access Dependabot will have while performing an update. Available values are: + /// - 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories. + /// - 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories. + /// + /// Unauthorized users will not see the existence of this endpoint. + /// + /// This operation supports both server-to-server and user-to-server access. + /// + /// - Remark: HTTP `PUT /organizations/{org}/dependabot/repository-access/default-level`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level)`. + public func dependabotSetRepositoryAccessDefaultLevel(_ input: Operations.DependabotSetRepositoryAccessDefaultLevel.Input) async throws -> Operations.DependabotSetRepositoryAccessDefaultLevel.Output { + try await client.send( + input: input, + forOperation: Operations.DependabotSetRepositoryAccessDefaultLevel.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/organizations/{}/dependabot/repository-access/default-level", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -335,6 +658,20 @@ public struct Client: APIProtocol { name: "epss_percentage", value: input.query.epssPercentage ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "artifact_registry_url", + value: input.query.artifactRegistryUrl + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "artifact_registry", + value: input.query.artifactRegistry + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -342,6 +679,13 @@ public struct Client: APIProtocol { name: "has", value: input.query.has ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "runtime_risk", + value: input.query.runtimeRisk + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -377,20 +721,6 @@ public struct Client: APIProtocol { name: "after", value: input.query.after ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "first", - value: input.query.first - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "last", - value: input.query.last - ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -1209,13 +1539,6 @@ public struct Client: APIProtocol { name: "direction", value: input.query.direction ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -1237,20 +1560,6 @@ public struct Client: APIProtocol { name: "after", value: input.query.after ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "first", - value: input.query.first - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "last", - value: input.query.last - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept diff --git a/Sources/dependabot/Types.swift b/Sources/dependabot/Types.swift index 80a7b8871cf..56d7e77acac 100644 --- a/Sources/dependabot/Types.swift +++ b/Sources/dependabot/Types.swift @@ -24,6 +24,48 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /enterprises/{enterprise}/dependabot/alerts`. /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)`. func dependabotListAlertsForEnterprise(_ input: Operations.DependabotListAlertsForEnterprise.Input) async throws -> Operations.DependabotListAlertsForEnterprise.Output + /// Lists the repositories Dependabot can access in an organization + /// + /// Lists repositories that organization admins have allowed Dependabot to access when updating dependencies. + /// > [!NOTE] + /// > This operation supports both server-to-server and user-to-server access. + /// Unauthorized users will not see the existence of this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/get(dependabot/repository-access-for-org)`. + func dependabotRepositoryAccessForOrg(_ input: Operations.DependabotRepositoryAccessForOrg.Input) async throws -> Operations.DependabotRepositoryAccessForOrg.Output + /// Updates Dependabot's repository access list for an organization + /// + /// Updates repositories according to the list of repositories that organization admins have given Dependabot access to when they've updated dependencies. + /// + /// > [!NOTE] + /// > This operation supports both server-to-server and user-to-server access. + /// Unauthorized users will not see the existence of this endpoint. + /// + /// **Example request body:** + /// ```json + /// { + /// "repository_ids_to_add": [123, 456], + /// "repository_ids_to_remove": [789] + /// } + /// ``` + /// + /// - Remark: HTTP `PATCH /organizations/{org}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/patch(dependabot/update-repository-access-for-org)`. + func dependabotUpdateRepositoryAccessForOrg(_ input: Operations.DependabotUpdateRepositoryAccessForOrg.Input) async throws -> Operations.DependabotUpdateRepositoryAccessForOrg.Output + /// Set the default repository access level for Dependabot + /// + /// Sets the default level of repository access Dependabot will have while performing an update. Available values are: + /// - 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories. + /// - 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories. + /// + /// Unauthorized users will not see the existence of this endpoint. + /// + /// This operation supports both server-to-server and user-to-server access. + /// + /// - Remark: HTTP `PUT /organizations/{org}/dependabot/repository-access/default-level`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level)`. + func dependabotSetRepositoryAccessDefaultLevel(_ input: Operations.DependabotSetRepositoryAccessDefaultLevel.Input) async throws -> Operations.DependabotSetRepositoryAccessDefaultLevel.Output /// List Dependabot alerts for an organization /// /// Lists Dependabot alerts for an organization. @@ -225,6 +267,78 @@ extension APIProtocol { headers: headers )) } + /// Lists the repositories Dependabot can access in an organization + /// + /// Lists repositories that organization admins have allowed Dependabot to access when updating dependencies. + /// > [!NOTE] + /// > This operation supports both server-to-server and user-to-server access. + /// Unauthorized users will not see the existence of this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/get(dependabot/repository-access-for-org)`. + public func dependabotRepositoryAccessForOrg( + path: Operations.DependabotRepositoryAccessForOrg.Input.Path, + query: Operations.DependabotRepositoryAccessForOrg.Input.Query = .init(), + headers: Operations.DependabotRepositoryAccessForOrg.Input.Headers = .init() + ) async throws -> Operations.DependabotRepositoryAccessForOrg.Output { + try await dependabotRepositoryAccessForOrg(Operations.DependabotRepositoryAccessForOrg.Input( + path: path, + query: query, + headers: headers + )) + } + /// Updates Dependabot's repository access list for an organization + /// + /// Updates repositories according to the list of repositories that organization admins have given Dependabot access to when they've updated dependencies. + /// + /// > [!NOTE] + /// > This operation supports both server-to-server and user-to-server access. + /// Unauthorized users will not see the existence of this endpoint. + /// + /// **Example request body:** + /// ```json + /// { + /// "repository_ids_to_add": [123, 456], + /// "repository_ids_to_remove": [789] + /// } + /// ``` + /// + /// - Remark: HTTP `PATCH /organizations/{org}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/patch(dependabot/update-repository-access-for-org)`. + public func dependabotUpdateRepositoryAccessForOrg( + path: Operations.DependabotUpdateRepositoryAccessForOrg.Input.Path, + headers: Operations.DependabotUpdateRepositoryAccessForOrg.Input.Headers = .init(), + body: Operations.DependabotUpdateRepositoryAccessForOrg.Input.Body + ) async throws -> Operations.DependabotUpdateRepositoryAccessForOrg.Output { + try await dependabotUpdateRepositoryAccessForOrg(Operations.DependabotUpdateRepositoryAccessForOrg.Input( + path: path, + headers: headers, + body: body + )) + } + /// Set the default repository access level for Dependabot + /// + /// Sets the default level of repository access Dependabot will have while performing an update. Available values are: + /// - 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories. + /// - 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories. + /// + /// Unauthorized users will not see the existence of this endpoint. + /// + /// This operation supports both server-to-server and user-to-server access. + /// + /// - Remark: HTTP `PUT /organizations/{org}/dependabot/repository-access/default-level`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level)`. + public func dependabotSetRepositoryAccessDefaultLevel( + path: Operations.DependabotSetRepositoryAccessDefaultLevel.Input.Path, + headers: Operations.DependabotSetRepositoryAccessDefaultLevel.Input.Headers = .init(), + body: Operations.DependabotSetRepositoryAccessDefaultLevel.Input.Body + ) async throws -> Operations.DependabotSetRepositoryAccessDefaultLevel.Output { + try await dependabotSetRepositoryAccessDefaultLevel(Operations.DependabotSetRepositoryAccessDefaultLevel.Input( + path: path, + headers: headers, + body: body + )) + } /// List Dependabot alerts for an organization /// /// Lists Dependabot alerts for an organization. @@ -2360,6 +2474,11 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -2380,6 +2499,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -2525,7 +2649,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: @@ -2821,6 +2945,30 @@ public enum Components { public var webCommitSignoffRequired: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/security_and_analysis`. public var securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public struct CustomPropertiesPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CustomPropertiesPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public var customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? /// Creates a new `MinimalRepository`. /// /// - Parameters: @@ -2911,6 +3059,7 @@ public enum Components { /// - allowForking: /// - webCommitSignoffRequired: /// - securityAndAnalysis: + /// - customProperties: The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. public init( id: Swift.Int64, nodeId: Swift.String, @@ -2998,7 +3147,8 @@ public enum Components { watchers: Swift.Int? = nil, allowForking: Swift.Bool? = nil, webCommitSignoffRequired: Swift.Bool? = nil, - securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil + securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil, + customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -3087,6 +3237,7 @@ public enum Components { self.allowForking = allowForking self.webCommitSignoffRequired = webCommitSignoffRequired self.securityAndAnalysis = securityAndAnalysis + self.customProperties = customProperties } public enum CodingKeys: String, CodingKey { case id @@ -3176,1076 +3327,2178 @@ public enum Components { case allowForking = "allow_forking" case webCommitSignoffRequired = "web_commit_signoff_required" case securityAndAnalysis = "security_and_analysis" + case customProperties = "custom_properties" } } - /// An object without any properties. - /// - /// - Remark: Generated from `#/components/schemas/empty-object`. - public struct EmptyObject: Codable, Hashable, Sendable { - /// Creates a new `EmptyObject`. - public init() {} - public init(from decoder: any Decoder) throws { - try decoder.ensureNoAdditionalProperties(knownKeys: []) - } - } - /// Secrets for GitHub Dependabot for an organization. + /// A GitHub repository. /// - /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret`. - public struct OrganizationDependabotSecret: Codable, Hashable, Sendable { - /// The name of the secret. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository`. + public struct NullableSimpleRepository: Codable, Hashable, Sendable { + /// A unique identifier of the repository. /// - /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/name`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/id`. + public var id: Swift.Int64 + /// The GraphQL identifier of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/node_id`. + public var nodeId: Swift.String + /// The name of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/name`. public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/updated_at`. - public var updatedAt: Foundation.Date - /// Visibility of a secret + /// The full, globally unique, name of the repository. /// - /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/visibility`. - @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case _private = "private" - case selected = "selected" - } - /// Visibility of a secret + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/full_name`. + public var fullName: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/owner`. + public var owner: Components.Schemas.SimpleUser + /// Whether the repository is private. /// - /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/visibility`. - public var visibility: Components.Schemas.OrganizationDependabotSecret.VisibilityPayload - /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/selected_repositories_url`. - public var selectedRepositoriesUrl: Swift.String? - /// Creates a new `OrganizationDependabotSecret`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/private`. + public var _private: Swift.Bool + /// The URL to view the repository on GitHub.com. /// - /// - Parameters: - /// - name: The name of the secret. - /// - createdAt: - /// - updatedAt: - /// - visibility: Visibility of a secret - /// - selectedRepositoriesUrl: - public init( - name: Swift.String, - createdAt: Foundation.Date, - updatedAt: Foundation.Date, - visibility: Components.Schemas.OrganizationDependabotSecret.VisibilityPayload, - selectedRepositoriesUrl: Swift.String? = nil - ) { - self.name = name - self.createdAt = createdAt - self.updatedAt = updatedAt - self.visibility = visibility - self.selectedRepositoriesUrl = selectedRepositoriesUrl - } - public enum CodingKeys: String, CodingKey { - case name - case createdAt = "created_at" - case updatedAt = "updated_at" - case visibility - case selectedRepositoriesUrl = "selected_repositories_url" - } - } - /// The public key used for setting Dependabot Secrets. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-public-key`. - public struct DependabotPublicKey: Codable, Hashable, Sendable { - /// The identifier for the key. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/html_url`. + public var htmlUrl: Swift.String + /// The repository description. /// - /// - Remark: Generated from `#/components/schemas/dependabot-public-key/key_id`. - public var keyId: Swift.String - /// The Base64 encoded public key. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/description`. + public var description: Swift.String? + /// Whether the repository is a fork. /// - /// - Remark: Generated from `#/components/schemas/dependabot-public-key/key`. - public var key: Swift.String - /// Creates a new `DependabotPublicKey`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/fork`. + public var fork: Swift.Bool + /// The URL to get more information about the repository from the GitHub API. /// - /// - Parameters: - /// - keyId: The identifier for the key. - /// - key: The Base64 encoded public key. - public init( - keyId: Swift.String, - key: Swift.String - ) { - self.keyId = keyId - self.key = key - } - public enum CodingKeys: String, CodingKey { - case keyId = "key_id" - case key - } - } - /// A Dependabot alert. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert`. - public struct DependabotAlert: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/dependabot-alert/number`. - public var number: Components.Schemas.AlertNumber - /// The state of the Dependabot alert. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/url`. + public var url: Swift.String + /// A template for the API URL to download the repository as an archive. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case autoDismissed = "auto_dismissed" - case dismissed = "dismissed" - case fixed = "fixed" - case open = "open" - } - /// The state of the Dependabot alert. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/archive_url`. + public var archiveUrl: Swift.String + /// A template for the API URL to list the available assignees for issues in the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/state`. - public var state: Components.Schemas.DependabotAlert.StatePayload - /// Details for the vulnerable dependency. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/assignees_url`. + public var assigneesUrl: Swift.String + /// A template for the API URL to create or retrieve a raw Git blob in the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency`. - public struct DependencyPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/package`. - public var package: Components.Schemas.DependabotAlertPackage? - /// The full path to the dependency manifest file, relative to the root of the repository. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/manifest_path`. - public var manifestPath: Swift.String? - /// The execution scope of the vulnerable dependency. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/scope`. - @frozen public enum ScopePayload: String, Codable, Hashable, Sendable, CaseIterable { - case development = "development" - case runtime = "runtime" - } - /// The execution scope of the vulnerable dependency. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/scope`. - public var scope: Components.Schemas.DependabotAlert.DependencyPayload.ScopePayload? - /// The vulnerable dependency's relationship to your project. - /// - /// > [!NOTE] - /// > We are rolling out support for dependency relationship across ecosystems. This value will be "unknown" for all dependencies in unsupported ecosystems. - /// - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/relationship`. - @frozen public enum RelationshipPayload: String, Codable, Hashable, Sendable, CaseIterable { - case unknown = "unknown" - case direct = "direct" - case transitive = "transitive" - } - /// The vulnerable dependency's relationship to your project. - /// - /// > [!NOTE] - /// > We are rolling out support for dependency relationship across ecosystems. This value will be "unknown" for all dependencies in unsupported ecosystems. - /// - /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/relationship`. - public var relationship: Components.Schemas.DependabotAlert.DependencyPayload.RelationshipPayload? - /// Creates a new `DependencyPayload`. - /// - /// - Parameters: - /// - package: - /// - manifestPath: The full path to the dependency manifest file, relative to the root of the repository. - /// - scope: The execution scope of the vulnerable dependency. - /// - relationship: The vulnerable dependency's relationship to your project. - public init( - package: Components.Schemas.DependabotAlertPackage? = nil, - manifestPath: Swift.String? = nil, - scope: Components.Schemas.DependabotAlert.DependencyPayload.ScopePayload? = nil, - relationship: Components.Schemas.DependabotAlert.DependencyPayload.RelationshipPayload? = nil - ) { - self.package = package - self.manifestPath = manifestPath - self.scope = scope - self.relationship = relationship - } - public enum CodingKeys: String, CodingKey { - case package - case manifestPath = "manifest_path" - case scope - case relationship - } - } - /// Details for the vulnerable dependency. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/blobs_url`. + public var blobsUrl: Swift.String + /// A template for the API URL to get information about branches in the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency`. - public var dependency: Components.Schemas.DependabotAlert.DependencyPayload - /// - Remark: Generated from `#/components/schemas/dependabot-alert/security_advisory`. - public var securityAdvisory: Components.Schemas.DependabotAlertSecurityAdvisory - /// - Remark: Generated from `#/components/schemas/dependabot-alert/security_vulnerability`. - public var securityVulnerability: Components.Schemas.DependabotAlertSecurityVulnerability - /// - Remark: Generated from `#/components/schemas/dependabot-alert/url`. - public var url: Components.Schemas.AlertUrl - /// - Remark: Generated from `#/components/schemas/dependabot-alert/html_url`. - public var htmlUrl: Components.Schemas.AlertHtmlUrl - /// - Remark: Generated from `#/components/schemas/dependabot-alert/created_at`. - public var createdAt: Components.Schemas.AlertCreatedAt - /// - Remark: Generated from `#/components/schemas/dependabot-alert/updated_at`. - public var updatedAt: Components.Schemas.AlertUpdatedAt - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_at`. - public var dismissedAt: Components.Schemas.AlertDismissedAt? - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_by`. - public var dismissedBy: Components.Schemas.NullableSimpleUser? - /// The reason that the alert was dismissed. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/branches_url`. + public var branchesUrl: Swift.String + /// A template for the API URL to get information about collaborators of the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_reason`. - @frozen public enum DismissedReasonPayload: String, Codable, Hashable, Sendable, CaseIterable { - case fixStarted = "fix_started" - case inaccurate = "inaccurate" - case noBandwidth = "no_bandwidth" - case notUsed = "not_used" - case tolerableRisk = "tolerable_risk" - } - /// The reason that the alert was dismissed. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/collaborators_url`. + public var collaboratorsUrl: Swift.String + /// A template for the API URL to get information about comments on the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_reason`. - public var dismissedReason: Components.Schemas.DependabotAlert.DismissedReasonPayload? - /// An optional comment associated with the alert's dismissal. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/comments_url`. + public var commentsUrl: Swift.String + /// A template for the API URL to get information about commits on the repository. /// - /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_comment`. - public var dismissedComment: Swift.String? - /// - Remark: Generated from `#/components/schemas/dependabot-alert/fixed_at`. - public var fixedAt: Components.Schemas.AlertFixedAt? - /// - Remark: Generated from `#/components/schemas/dependabot-alert/auto_dismissed_at`. - public var autoDismissedAt: Components.Schemas.AlertAutoDismissedAt? - /// Creates a new `DependabotAlert`. + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/commits_url`. + public var commitsUrl: Swift.String + /// A template for the API URL to compare two commits or refs. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/compare_url`. + public var compareUrl: Swift.String + /// A template for the API URL to get the contents of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/contents_url`. + public var contentsUrl: Swift.String + /// A template for the API URL to list the contributors to the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/contributors_url`. + public var contributorsUrl: Swift.String + /// The API URL to list the deployments of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/deployments_url`. + public var deploymentsUrl: Swift.String + /// The API URL to list the downloads on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/downloads_url`. + public var downloadsUrl: Swift.String + /// The API URL to list the events of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/events_url`. + public var eventsUrl: Swift.String + /// The API URL to list the forks of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/forks_url`. + public var forksUrl: Swift.String + /// A template for the API URL to get information about Git commits of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/git_commits_url`. + public var gitCommitsUrl: Swift.String + /// A template for the API URL to get information about Git refs of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/git_refs_url`. + public var gitRefsUrl: Swift.String + /// A template for the API URL to get information about Git tags of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/git_tags_url`. + public var gitTagsUrl: Swift.String + /// A template for the API URL to get information about issue comments on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/issue_comment_url`. + public var issueCommentUrl: Swift.String + /// A template for the API URL to get information about issue events on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/issue_events_url`. + public var issueEventsUrl: Swift.String + /// A template for the API URL to get information about issues on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/issues_url`. + public var issuesUrl: Swift.String + /// A template for the API URL to get information about deploy keys on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/keys_url`. + public var keysUrl: Swift.String + /// A template for the API URL to get information about labels of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/labels_url`. + public var labelsUrl: Swift.String + /// The API URL to get information about the languages of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/languages_url`. + public var languagesUrl: Swift.String + /// The API URL to merge branches in the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/merges_url`. + public var mergesUrl: Swift.String + /// A template for the API URL to get information about milestones of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/milestones_url`. + public var milestonesUrl: Swift.String + /// A template for the API URL to get information about notifications on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/notifications_url`. + public var notificationsUrl: Swift.String + /// A template for the API URL to get information about pull requests on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/pulls_url`. + public var pullsUrl: Swift.String + /// A template for the API URL to get information about releases on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/releases_url`. + public var releasesUrl: Swift.String + /// The API URL to list the stargazers on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/stargazers_url`. + public var stargazersUrl: Swift.String + /// A template for the API URL to get information about statuses of a commit. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/statuses_url`. + public var statusesUrl: Swift.String + /// The API URL to list the subscribers on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/subscribers_url`. + public var subscribersUrl: Swift.String + /// The API URL to subscribe to notifications for this repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/subscription_url`. + public var subscriptionUrl: Swift.String + /// The API URL to get information about tags on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/tags_url`. + public var tagsUrl: Swift.String + /// The API URL to list the teams on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/teams_url`. + public var teamsUrl: Swift.String + /// A template for the API URL to create or retrieve a raw Git tree of the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/trees_url`. + public var treesUrl: Swift.String + /// The API URL to list the hooks on the repository. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-repository/hooks_url`. + public var hooksUrl: Swift.String + /// Creates a new `NullableSimpleRepository`. /// /// - Parameters: - /// - number: - /// - state: The state of the Dependabot alert. - /// - dependency: Details for the vulnerable dependency. - /// - securityAdvisory: - /// - securityVulnerability: - /// - url: - /// - htmlUrl: - /// - createdAt: - /// - updatedAt: - /// - dismissedAt: - /// - dismissedBy: - /// - dismissedReason: The reason that the alert was dismissed. - /// - dismissedComment: An optional comment associated with the alert's dismissal. - /// - fixedAt: - /// - autoDismissedAt: + /// - id: A unique identifier of the repository. + /// - nodeId: The GraphQL identifier of the repository. + /// - name: The name of the repository. + /// - fullName: The full, globally unique, name of the repository. + /// - owner: + /// - _private: Whether the repository is private. + /// - htmlUrl: The URL to view the repository on GitHub.com. + /// - description: The repository description. + /// - fork: Whether the repository is a fork. + /// - url: The URL to get more information about the repository from the GitHub API. + /// - archiveUrl: A template for the API URL to download the repository as an archive. + /// - assigneesUrl: A template for the API URL to list the available assignees for issues in the repository. + /// - blobsUrl: A template for the API URL to create or retrieve a raw Git blob in the repository. + /// - branchesUrl: A template for the API URL to get information about branches in the repository. + /// - collaboratorsUrl: A template for the API URL to get information about collaborators of the repository. + /// - commentsUrl: A template for the API URL to get information about comments on the repository. + /// - commitsUrl: A template for the API URL to get information about commits on the repository. + /// - compareUrl: A template for the API URL to compare two commits or refs. + /// - contentsUrl: A template for the API URL to get the contents of the repository. + /// - contributorsUrl: A template for the API URL to list the contributors to the repository. + /// - deploymentsUrl: The API URL to list the deployments of the repository. + /// - downloadsUrl: The API URL to list the downloads on the repository. + /// - eventsUrl: The API URL to list the events of the repository. + /// - forksUrl: The API URL to list the forks of the repository. + /// - gitCommitsUrl: A template for the API URL to get information about Git commits of the repository. + /// - gitRefsUrl: A template for the API URL to get information about Git refs of the repository. + /// - gitTagsUrl: A template for the API URL to get information about Git tags of the repository. + /// - issueCommentUrl: A template for the API URL to get information about issue comments on the repository. + /// - issueEventsUrl: A template for the API URL to get information about issue events on the repository. + /// - issuesUrl: A template for the API URL to get information about issues on the repository. + /// - keysUrl: A template for the API URL to get information about deploy keys on the repository. + /// - labelsUrl: A template for the API URL to get information about labels of the repository. + /// - languagesUrl: The API URL to get information about the languages of the repository. + /// - mergesUrl: The API URL to merge branches in the repository. + /// - milestonesUrl: A template for the API URL to get information about milestones of the repository. + /// - notificationsUrl: A template for the API URL to get information about notifications on the repository. + /// - pullsUrl: A template for the API URL to get information about pull requests on the repository. + /// - releasesUrl: A template for the API URL to get information about releases on the repository. + /// - stargazersUrl: The API URL to list the stargazers on the repository. + /// - statusesUrl: A template for the API URL to get information about statuses of a commit. + /// - subscribersUrl: The API URL to list the subscribers on the repository. + /// - subscriptionUrl: The API URL to subscribe to notifications for this repository. + /// - tagsUrl: The API URL to get information about tags on the repository. + /// - teamsUrl: The API URL to list the teams on the repository. + /// - treesUrl: A template for the API URL to create or retrieve a raw Git tree of the repository. + /// - hooksUrl: The API URL to list the hooks on the repository. public init( - number: Components.Schemas.AlertNumber, - state: Components.Schemas.DependabotAlert.StatePayload, - dependency: Components.Schemas.DependabotAlert.DependencyPayload, - securityAdvisory: Components.Schemas.DependabotAlertSecurityAdvisory, - securityVulnerability: Components.Schemas.DependabotAlertSecurityVulnerability, - url: Components.Schemas.AlertUrl, - htmlUrl: Components.Schemas.AlertHtmlUrl, - createdAt: Components.Schemas.AlertCreatedAt, - updatedAt: Components.Schemas.AlertUpdatedAt, - dismissedAt: Components.Schemas.AlertDismissedAt? = nil, - dismissedBy: Components.Schemas.NullableSimpleUser? = nil, - dismissedReason: Components.Schemas.DependabotAlert.DismissedReasonPayload? = nil, - dismissedComment: Swift.String? = nil, - fixedAt: Components.Schemas.AlertFixedAt? = nil, - autoDismissedAt: Components.Schemas.AlertAutoDismissedAt? = nil + id: Swift.Int64, + nodeId: Swift.String, + name: Swift.String, + fullName: Swift.String, + owner: Components.Schemas.SimpleUser, + _private: Swift.Bool, + htmlUrl: Swift.String, + description: Swift.String? = nil, + fork: Swift.Bool, + url: Swift.String, + archiveUrl: Swift.String, + assigneesUrl: Swift.String, + blobsUrl: Swift.String, + branchesUrl: Swift.String, + collaboratorsUrl: Swift.String, + commentsUrl: Swift.String, + commitsUrl: Swift.String, + compareUrl: Swift.String, + contentsUrl: Swift.String, + contributorsUrl: Swift.String, + deploymentsUrl: Swift.String, + downloadsUrl: Swift.String, + eventsUrl: Swift.String, + forksUrl: Swift.String, + gitCommitsUrl: Swift.String, + gitRefsUrl: Swift.String, + gitTagsUrl: Swift.String, + issueCommentUrl: Swift.String, + issueEventsUrl: Swift.String, + issuesUrl: Swift.String, + keysUrl: Swift.String, + labelsUrl: Swift.String, + languagesUrl: Swift.String, + mergesUrl: Swift.String, + milestonesUrl: Swift.String, + notificationsUrl: Swift.String, + pullsUrl: Swift.String, + releasesUrl: Swift.String, + stargazersUrl: Swift.String, + statusesUrl: Swift.String, + subscribersUrl: Swift.String, + subscriptionUrl: Swift.String, + tagsUrl: Swift.String, + teamsUrl: Swift.String, + treesUrl: Swift.String, + hooksUrl: Swift.String ) { - self.number = number - self.state = state - self.dependency = dependency - self.securityAdvisory = securityAdvisory - self.securityVulnerability = securityVulnerability - self.url = url + self.id = id + self.nodeId = nodeId + self.name = name + self.fullName = fullName + self.owner = owner + self._private = _private self.htmlUrl = htmlUrl - self.createdAt = createdAt - self.updatedAt = updatedAt - self.dismissedAt = dismissedAt - self.dismissedBy = dismissedBy - self.dismissedReason = dismissedReason - self.dismissedComment = dismissedComment - self.fixedAt = fixedAt - self.autoDismissedAt = autoDismissedAt + self.description = description + self.fork = fork + self.url = url + self.archiveUrl = archiveUrl + self.assigneesUrl = assigneesUrl + self.blobsUrl = blobsUrl + self.branchesUrl = branchesUrl + self.collaboratorsUrl = collaboratorsUrl + self.commentsUrl = commentsUrl + self.commitsUrl = commitsUrl + self.compareUrl = compareUrl + self.contentsUrl = contentsUrl + self.contributorsUrl = contributorsUrl + self.deploymentsUrl = deploymentsUrl + self.downloadsUrl = downloadsUrl + self.eventsUrl = eventsUrl + self.forksUrl = forksUrl + self.gitCommitsUrl = gitCommitsUrl + self.gitRefsUrl = gitRefsUrl + self.gitTagsUrl = gitTagsUrl + self.issueCommentUrl = issueCommentUrl + self.issueEventsUrl = issueEventsUrl + self.issuesUrl = issuesUrl + self.keysUrl = keysUrl + self.labelsUrl = labelsUrl + self.languagesUrl = languagesUrl + self.mergesUrl = mergesUrl + self.milestonesUrl = milestonesUrl + self.notificationsUrl = notificationsUrl + self.pullsUrl = pullsUrl + self.releasesUrl = releasesUrl + self.stargazersUrl = stargazersUrl + self.statusesUrl = statusesUrl + self.subscribersUrl = subscribersUrl + self.subscriptionUrl = subscriptionUrl + self.tagsUrl = tagsUrl + self.teamsUrl = teamsUrl + self.treesUrl = treesUrl + self.hooksUrl = hooksUrl } public enum CodingKeys: String, CodingKey { - case number - case state - case dependency - case securityAdvisory = "security_advisory" - case securityVulnerability = "security_vulnerability" - case url + case id + case nodeId = "node_id" + case name + case fullName = "full_name" + case owner + case _private = "private" case htmlUrl = "html_url" - case createdAt = "created_at" - case updatedAt = "updated_at" - case dismissedAt = "dismissed_at" - case dismissedBy = "dismissed_by" - case dismissedReason = "dismissed_reason" - case dismissedComment = "dismissed_comment" - case fixedAt = "fixed_at" - case autoDismissedAt = "auto_dismissed_at" + case description + case fork + case url + case archiveUrl = "archive_url" + case assigneesUrl = "assignees_url" + case blobsUrl = "blobs_url" + case branchesUrl = "branches_url" + case collaboratorsUrl = "collaborators_url" + case commentsUrl = "comments_url" + case commitsUrl = "commits_url" + case compareUrl = "compare_url" + case contentsUrl = "contents_url" + case contributorsUrl = "contributors_url" + case deploymentsUrl = "deployments_url" + case downloadsUrl = "downloads_url" + case eventsUrl = "events_url" + case forksUrl = "forks_url" + case gitCommitsUrl = "git_commits_url" + case gitRefsUrl = "git_refs_url" + case gitTagsUrl = "git_tags_url" + case issueCommentUrl = "issue_comment_url" + case issueEventsUrl = "issue_events_url" + case issuesUrl = "issues_url" + case keysUrl = "keys_url" + case labelsUrl = "labels_url" + case languagesUrl = "languages_url" + case mergesUrl = "merges_url" + case milestonesUrl = "milestones_url" + case notificationsUrl = "notifications_url" + case pullsUrl = "pulls_url" + case releasesUrl = "releases_url" + case stargazersUrl = "stargazers_url" + case statusesUrl = "statuses_url" + case subscribersUrl = "subscribers_url" + case subscriptionUrl = "subscription_url" + case tagsUrl = "tags_url" + case teamsUrl = "teams_url" + case treesUrl = "trees_url" + case hooksUrl = "hooks_url" + } + } + /// Information about repositories that Dependabot is able to access in an organization + /// + /// - Remark: Generated from `#/components/schemas/dependabot-repository-access-details`. + public struct DependabotRepositoryAccessDetails: Codable, Hashable, Sendable { + /// The default repository access level for Dependabot updates. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-repository-access-details/default_level`. + @frozen public enum DefaultLevelPayload: String, Codable, Hashable, Sendable, CaseIterable { + case _public = "public" + case _internal = "internal" + } + /// The default repository access level for Dependabot updates. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-repository-access-details/default_level`. + public var defaultLevel: Components.Schemas.DependabotRepositoryAccessDetails.DefaultLevelPayload? + /// - Remark: Generated from `#/components/schemas/dependabot-repository-access-details/accessible_repositories`. + public var accessibleRepositories: [Components.Schemas.NullableSimpleRepository]? + /// Creates a new `DependabotRepositoryAccessDetails`. + /// + /// - Parameters: + /// - defaultLevel: The default repository access level for Dependabot updates. + /// - accessibleRepositories: + public init( + defaultLevel: Components.Schemas.DependabotRepositoryAccessDetails.DefaultLevelPayload? = nil, + accessibleRepositories: [Components.Schemas.NullableSimpleRepository]? = nil + ) { + self.defaultLevel = defaultLevel + self.accessibleRepositories = accessibleRepositories + } + public enum CodingKeys: String, CodingKey { + case defaultLevel = "default_level" + case accessibleRepositories = "accessible_repositories" } public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - self.number = try container.decode( - Components.Schemas.AlertNumber.self, - forKey: .number - ) - self.state = try container.decode( - Components.Schemas.DependabotAlert.StatePayload.self, - forKey: .state - ) - self.dependency = try container.decode( - Components.Schemas.DependabotAlert.DependencyPayload.self, - forKey: .dependency - ) - self.securityAdvisory = try container.decode( - Components.Schemas.DependabotAlertSecurityAdvisory.self, - forKey: .securityAdvisory - ) - self.securityVulnerability = try container.decode( - Components.Schemas.DependabotAlertSecurityVulnerability.self, - forKey: .securityVulnerability - ) - self.url = try container.decode( - Components.Schemas.AlertUrl.self, - forKey: .url - ) - self.htmlUrl = try container.decode( - Components.Schemas.AlertHtmlUrl.self, - forKey: .htmlUrl - ) - self.createdAt = try container.decode( - Components.Schemas.AlertCreatedAt.self, - forKey: .createdAt - ) - self.updatedAt = try container.decode( - Components.Schemas.AlertUpdatedAt.self, - forKey: .updatedAt - ) - self.dismissedAt = try container.decodeIfPresent( - Components.Schemas.AlertDismissedAt.self, - forKey: .dismissedAt - ) - self.dismissedBy = try container.decodeIfPresent( - Components.Schemas.NullableSimpleUser.self, - forKey: .dismissedBy - ) - self.dismissedReason = try container.decodeIfPresent( - Components.Schemas.DependabotAlert.DismissedReasonPayload.self, - forKey: .dismissedReason - ) - self.dismissedComment = try container.decodeIfPresent( - Swift.String.self, - forKey: .dismissedComment - ) - self.fixedAt = try container.decodeIfPresent( - Components.Schemas.AlertFixedAt.self, - forKey: .fixedAt + self.defaultLevel = try container.decodeIfPresent( + Components.Schemas.DependabotRepositoryAccessDetails.DefaultLevelPayload.self, + forKey: .defaultLevel ) - self.autoDismissedAt = try container.decodeIfPresent( - Components.Schemas.AlertAutoDismissedAt.self, - forKey: .autoDismissedAt + self.accessibleRepositories = try container.decodeIfPresent( + [Components.Schemas.NullableSimpleRepository].self, + forKey: .accessibleRepositories ) try decoder.ensureNoAdditionalProperties(knownKeys: [ - "number", - "state", - "dependency", - "security_advisory", - "security_vulnerability", - "url", - "html_url", - "created_at", - "updated_at", - "dismissed_at", - "dismissed_by", - "dismissed_reason", - "dismissed_comment", - "fixed_at", - "auto_dismissed_at" + "default_level", + "accessible_repositories" ]) } - } - /// Set secrets for Dependabot. - /// - /// - Remark: Generated from `#/components/schemas/dependabot-secret`. - public struct DependabotSecret: Codable, Hashable, Sendable { - /// The name of the secret. + } + /// An object without any properties. + /// + /// - Remark: Generated from `#/components/schemas/empty-object`. + public struct EmptyObject: Codable, Hashable, Sendable { + /// Creates a new `EmptyObject`. + public init() {} + public init(from decoder: any Decoder) throws { + try decoder.ensureNoAdditionalProperties(knownKeys: []) + } + } + /// Secrets for GitHub Dependabot for an organization. + /// + /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret`. + public struct OrganizationDependabotSecret: Codable, Hashable, Sendable { + /// The name of the secret. + /// + /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/updated_at`. + public var updatedAt: Foundation.Date + /// Visibility of a secret + /// + /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/visibility`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case _private = "private" + case selected = "selected" + } + /// Visibility of a secret + /// + /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/visibility`. + public var visibility: Components.Schemas.OrganizationDependabotSecret.VisibilityPayload + /// - Remark: Generated from `#/components/schemas/organization-dependabot-secret/selected_repositories_url`. + public var selectedRepositoriesUrl: Swift.String? + /// Creates a new `OrganizationDependabotSecret`. + /// + /// - Parameters: + /// - name: The name of the secret. + /// - createdAt: + /// - updatedAt: + /// - visibility: Visibility of a secret + /// - selectedRepositoriesUrl: + public init( + name: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + visibility: Components.Schemas.OrganizationDependabotSecret.VisibilityPayload, + selectedRepositoriesUrl: Swift.String? = nil + ) { + self.name = name + self.createdAt = createdAt + self.updatedAt = updatedAt + self.visibility = visibility + self.selectedRepositoriesUrl = selectedRepositoriesUrl + } + public enum CodingKeys: String, CodingKey { + case name + case createdAt = "created_at" + case updatedAt = "updated_at" + case visibility + case selectedRepositoriesUrl = "selected_repositories_url" + } + } + /// The public key used for setting Dependabot Secrets. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-public-key`. + public struct DependabotPublicKey: Codable, Hashable, Sendable { + /// The identifier for the key. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-public-key/key_id`. + public var keyId: Swift.String + /// The Base64 encoded public key. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-public-key/key`. + public var key: Swift.String + /// Creates a new `DependabotPublicKey`. + /// + /// - Parameters: + /// - keyId: The identifier for the key. + /// - key: The Base64 encoded public key. + public init( + keyId: Swift.String, + key: Swift.String + ) { + self.keyId = keyId + self.key = key + } + public enum CodingKeys: String, CodingKey { + case keyId = "key_id" + case key + } + } + /// A Dependabot alert. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert`. + public struct DependabotAlert: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/dependabot-alert/number`. + public var number: Components.Schemas.AlertNumber + /// The state of the Dependabot alert. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case autoDismissed = "auto_dismissed" + case dismissed = "dismissed" + case fixed = "fixed" + case open = "open" + } + /// The state of the Dependabot alert. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/state`. + public var state: Components.Schemas.DependabotAlert.StatePayload + /// Details for the vulnerable dependency. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency`. + public struct DependencyPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/package`. + public var package: Components.Schemas.DependabotAlertPackage? + /// The full path to the dependency manifest file, relative to the root of the repository. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/manifest_path`. + public var manifestPath: Swift.String? + /// The execution scope of the vulnerable dependency. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/scope`. + @frozen public enum ScopePayload: String, Codable, Hashable, Sendable, CaseIterable { + case development = "development" + case runtime = "runtime" + } + /// The execution scope of the vulnerable dependency. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/scope`. + public var scope: Components.Schemas.DependabotAlert.DependencyPayload.ScopePayload? + /// The vulnerable dependency's relationship to your project. + /// + /// > [!NOTE] + /// > We are rolling out support for dependency relationship across ecosystems. This value will be "unknown" for all dependencies in unsupported ecosystems. + /// + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/relationship`. + @frozen public enum RelationshipPayload: String, Codable, Hashable, Sendable, CaseIterable { + case unknown = "unknown" + case direct = "direct" + case transitive = "transitive" + } + /// The vulnerable dependency's relationship to your project. + /// + /// > [!NOTE] + /// > We are rolling out support for dependency relationship across ecosystems. This value will be "unknown" for all dependencies in unsupported ecosystems. + /// + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency/relationship`. + public var relationship: Components.Schemas.DependabotAlert.DependencyPayload.RelationshipPayload? + /// Creates a new `DependencyPayload`. + /// + /// - Parameters: + /// - package: + /// - manifestPath: The full path to the dependency manifest file, relative to the root of the repository. + /// - scope: The execution scope of the vulnerable dependency. + /// - relationship: The vulnerable dependency's relationship to your project. + public init( + package: Components.Schemas.DependabotAlertPackage? = nil, + manifestPath: Swift.String? = nil, + scope: Components.Schemas.DependabotAlert.DependencyPayload.ScopePayload? = nil, + relationship: Components.Schemas.DependabotAlert.DependencyPayload.RelationshipPayload? = nil + ) { + self.package = package + self.manifestPath = manifestPath + self.scope = scope + self.relationship = relationship + } + public enum CodingKeys: String, CodingKey { + case package + case manifestPath = "manifest_path" + case scope + case relationship + } + } + /// Details for the vulnerable dependency. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dependency`. + public var dependency: Components.Schemas.DependabotAlert.DependencyPayload + /// - Remark: Generated from `#/components/schemas/dependabot-alert/security_advisory`. + public var securityAdvisory: Components.Schemas.DependabotAlertSecurityAdvisory + /// - Remark: Generated from `#/components/schemas/dependabot-alert/security_vulnerability`. + public var securityVulnerability: Components.Schemas.DependabotAlertSecurityVulnerability + /// - Remark: Generated from `#/components/schemas/dependabot-alert/url`. + public var url: Components.Schemas.AlertUrl + /// - Remark: Generated from `#/components/schemas/dependabot-alert/html_url`. + public var htmlUrl: Components.Schemas.AlertHtmlUrl + /// - Remark: Generated from `#/components/schemas/dependabot-alert/created_at`. + public var createdAt: Components.Schemas.AlertCreatedAt + /// - Remark: Generated from `#/components/schemas/dependabot-alert/updated_at`. + public var updatedAt: Components.Schemas.AlertUpdatedAt + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_at`. + public var dismissedAt: Components.Schemas.AlertDismissedAt? + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_by`. + public var dismissedBy: Components.Schemas.NullableSimpleUser? + /// The reason that the alert was dismissed. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_reason`. + @frozen public enum DismissedReasonPayload: String, Codable, Hashable, Sendable, CaseIterable { + case fixStarted = "fix_started" + case inaccurate = "inaccurate" + case noBandwidth = "no_bandwidth" + case notUsed = "not_used" + case tolerableRisk = "tolerable_risk" + } + /// The reason that the alert was dismissed. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_reason`. + public var dismissedReason: Components.Schemas.DependabotAlert.DismissedReasonPayload? + /// An optional comment associated with the alert's dismissal. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert/dismissed_comment`. + public var dismissedComment: Swift.String? + /// - Remark: Generated from `#/components/schemas/dependabot-alert/fixed_at`. + public var fixedAt: Components.Schemas.AlertFixedAt? + /// - Remark: Generated from `#/components/schemas/dependabot-alert/auto_dismissed_at`. + public var autoDismissedAt: Components.Schemas.AlertAutoDismissedAt? + /// Creates a new `DependabotAlert`. + /// + /// - Parameters: + /// - number: + /// - state: The state of the Dependabot alert. + /// - dependency: Details for the vulnerable dependency. + /// - securityAdvisory: + /// - securityVulnerability: + /// - url: + /// - htmlUrl: + /// - createdAt: + /// - updatedAt: + /// - dismissedAt: + /// - dismissedBy: + /// - dismissedReason: The reason that the alert was dismissed. + /// - dismissedComment: An optional comment associated with the alert's dismissal. + /// - fixedAt: + /// - autoDismissedAt: + public init( + number: Components.Schemas.AlertNumber, + state: Components.Schemas.DependabotAlert.StatePayload, + dependency: Components.Schemas.DependabotAlert.DependencyPayload, + securityAdvisory: Components.Schemas.DependabotAlertSecurityAdvisory, + securityVulnerability: Components.Schemas.DependabotAlertSecurityVulnerability, + url: Components.Schemas.AlertUrl, + htmlUrl: Components.Schemas.AlertHtmlUrl, + createdAt: Components.Schemas.AlertCreatedAt, + updatedAt: Components.Schemas.AlertUpdatedAt, + dismissedAt: Components.Schemas.AlertDismissedAt? = nil, + dismissedBy: Components.Schemas.NullableSimpleUser? = nil, + dismissedReason: Components.Schemas.DependabotAlert.DismissedReasonPayload? = nil, + dismissedComment: Swift.String? = nil, + fixedAt: Components.Schemas.AlertFixedAt? = nil, + autoDismissedAt: Components.Schemas.AlertAutoDismissedAt? = nil + ) { + self.number = number + self.state = state + self.dependency = dependency + self.securityAdvisory = securityAdvisory + self.securityVulnerability = securityVulnerability + self.url = url + self.htmlUrl = htmlUrl + self.createdAt = createdAt + self.updatedAt = updatedAt + self.dismissedAt = dismissedAt + self.dismissedBy = dismissedBy + self.dismissedReason = dismissedReason + self.dismissedComment = dismissedComment + self.fixedAt = fixedAt + self.autoDismissedAt = autoDismissedAt + } + public enum CodingKeys: String, CodingKey { + case number + case state + case dependency + case securityAdvisory = "security_advisory" + case securityVulnerability = "security_vulnerability" + case url + case htmlUrl = "html_url" + case createdAt = "created_at" + case updatedAt = "updated_at" + case dismissedAt = "dismissed_at" + case dismissedBy = "dismissed_by" + case dismissedReason = "dismissed_reason" + case dismissedComment = "dismissed_comment" + case fixedAt = "fixed_at" + case autoDismissedAt = "auto_dismissed_at" + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.number = try container.decode( + Components.Schemas.AlertNumber.self, + forKey: .number + ) + self.state = try container.decode( + Components.Schemas.DependabotAlert.StatePayload.self, + forKey: .state + ) + self.dependency = try container.decode( + Components.Schemas.DependabotAlert.DependencyPayload.self, + forKey: .dependency + ) + self.securityAdvisory = try container.decode( + Components.Schemas.DependabotAlertSecurityAdvisory.self, + forKey: .securityAdvisory + ) + self.securityVulnerability = try container.decode( + Components.Schemas.DependabotAlertSecurityVulnerability.self, + forKey: .securityVulnerability + ) + self.url = try container.decode( + Components.Schemas.AlertUrl.self, + forKey: .url + ) + self.htmlUrl = try container.decode( + Components.Schemas.AlertHtmlUrl.self, + forKey: .htmlUrl + ) + self.createdAt = try container.decode( + Components.Schemas.AlertCreatedAt.self, + forKey: .createdAt + ) + self.updatedAt = try container.decode( + Components.Schemas.AlertUpdatedAt.self, + forKey: .updatedAt + ) + self.dismissedAt = try container.decodeIfPresent( + Components.Schemas.AlertDismissedAt.self, + forKey: .dismissedAt + ) + self.dismissedBy = try container.decodeIfPresent( + Components.Schemas.NullableSimpleUser.self, + forKey: .dismissedBy + ) + self.dismissedReason = try container.decodeIfPresent( + Components.Schemas.DependabotAlert.DismissedReasonPayload.self, + forKey: .dismissedReason + ) + self.dismissedComment = try container.decodeIfPresent( + Swift.String.self, + forKey: .dismissedComment + ) + self.fixedAt = try container.decodeIfPresent( + Components.Schemas.AlertFixedAt.self, + forKey: .fixedAt + ) + self.autoDismissedAt = try container.decodeIfPresent( + Components.Schemas.AlertAutoDismissedAt.self, + forKey: .autoDismissedAt + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "number", + "state", + "dependency", + "security_advisory", + "security_vulnerability", + "url", + "html_url", + "created_at", + "updated_at", + "dismissed_at", + "dismissed_by", + "dismissed_reason", + "dismissed_comment", + "fixed_at", + "auto_dismissed_at" + ]) + } + } + /// Set secrets for Dependabot. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-secret`. + public struct DependabotSecret: Codable, Hashable, Sendable { + /// The name of the secret. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-secret/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/dependabot-secret/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/dependabot-secret/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `DependabotSecret`. + /// + /// - Parameters: + /// - name: The name of the secret. + /// - createdAt: + /// - updatedAt: + public init( + name: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.name = name + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case name + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// 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)." + /// + /// - Remark: Generated from `#/components/parameters/pagination-before`. + public typealias PaginationBefore = Swift.String + /// 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)." + /// + /// - Remark: Generated from `#/components/parameters/pagination-after`. + public typealias PaginationAfter = Swift.String + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/components/parameters/per-page`. + public typealias PerPage = Swift.Int + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/components/parameters/page`. + public typealias Page = Swift.Int + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/components/parameters/enterprise`. + public typealias Enterprise = Swift.String + /// A comma-separated list of states. If specified, only alerts with these states will be returned. + /// + /// Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-states`. + public typealias DependabotAlertCommaSeparatedStates = Swift.String + /// A comma-separated list of severities. If specified, only alerts with these severities will be returned. + /// + /// Can be: `low`, `medium`, `high`, `critical` + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-severities`. + public typealias DependabotAlertCommaSeparatedSeverities = Swift.String + /// A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. + /// + /// Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust` + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-ecosystems`. + public typealias DependabotAlertCommaSeparatedEcosystems = Swift.String + /// A comma-separated list of package names. If specified, only alerts for these packages will be returned. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-packages`. + public typealias DependabotAlertCommaSeparatedPackages = Swift.String + /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: + /// - An exact number (`n`) + /// - Comparators such as `>n`, `=n`, `<=n` + /// - A range like `n..n`, where `n` is a number from 0.0 to 1.0 + /// + /// Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-epss`. + public typealias DependabotAlertCommaSeparatedEpss = Swift.String + /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. + /// Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`. + @frozen public enum DependabotAlertCommaSeparatedHas: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/Case2Payload`. + @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { + case patch = "patch" + } + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. + public typealias Case2Payload = [Components.Parameters.DependabotAlertCommaSeparatedHas.Case2PayloadPayload] + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. + case case2(Components.Parameters.DependabotAlertCommaSeparatedHas.Case2Payload) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. + @frozen public enum DependabotAlertScope: String, Codable, Hashable, Sendable, CaseIterable { + case development = "development" + case runtime = "runtime" + } + /// The property by which to sort the results. + /// `created` means when the alert was created. + /// `updated` means when the alert's state last changed. + /// `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-sort`. + @frozen public enum DependabotAlertSort: String, Codable, Hashable, Sendable, CaseIterable { + case created = "created" + case updated = "updated" + case epssPercentage = "epss_percentage" + } + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/owner`. + public typealias Owner = Swift.String + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/repo`. + public typealias Repo = Swift.String + /// The name of the secret. + /// + /// - Remark: Generated from `#/components/parameters/secret-name`. + public typealias SecretName = Swift.String + /// A comma-separated list of artifact registry URLs. If specified, only alerts for repositories with storage records matching these URLs will be returned. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-artifact-registry-urls`. + public typealias DependabotAlertCommaSeparatedArtifactRegistryUrls = Swift.String + /// A comma-separated list of Artifact Registry name strings. If specified, only alerts for repositories with storage records matching these registries will be returned. + /// + /// Can be: `jfrog-artifactory` + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-artifact-registry`. + public typealias DependabotAlertCommaSeparatedArtifactRegistry = Swift.String + /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. + /// Multiple `has` filters can be passed to filter for alerts that have all of the values. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has`. + @frozen public enum DependabotAlertOrgScopeCommaSeparatedHas: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/Case2Payload`. + @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { + case patch = "patch" + case deployment = "deployment" + } + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`. + public typealias Case2Payload = [Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2PayloadPayload] + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`. + case case2(Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2Payload) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// A comma-separated list of runtime risk strings. If specified, only alerts for repositories with deployment records matching these risks will be returned. + /// + /// Can be: `critical-resource`, `internet-exposed`, `sensitive-data`, `lateral-movement` + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-runtime-risk`. + public typealias DependabotAlertCommaSeparatedRuntimeRisk = Swift.String + /// A comma-separated list of full manifest paths. If specified, only alerts for these manifests will be returned. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-manifests`. + public typealias DependabotAlertCommaSeparatedManifests = Swift.String + /// The number that identifies a Dependabot alert in its repository. + /// You can find this at the end of the URL for a Dependabot alert within GitHub, + /// or in `number` fields in the response from the + /// `GET /repos/{owner}/{repo}/dependabot/alerts` operation. + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-number`. + public typealias DependabotAlertNumber = Components.Schemas.AlertNumber + } + /// 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 { + public struct ValidationFailedSimple: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. + case json(Components.Schemas.ValidationErrorSimple) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationErrorSimple { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailedSimple.Body + /// Creates a new `ValidationFailedSimple`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailedSimple.Body) { + self.body = body + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.NotFound.Body) { + self.body = body + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/bad_request/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/json", + body: self + ) + } + } + } + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/scim+json`. + case applicationScimJson(Components.Schemas.ScimError) + /// The associated value of the enum case if `self` is `.applicationScimJson`. + /// + /// - Throws: An error if `self` is not `.applicationScimJson`. + /// - SeeAlso: `.applicationScimJson`. + public var applicationScimJson: Components.Schemas.ScimError { + get throws { + switch self { + case let .applicationScimJson(body): + return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/scim+json", + body: self + ) + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.BadRequest.Body) { + self.body = body + } + } + public struct NotModified: Sendable, Hashable { + /// Creates a new `NotModified`. + public init() {} + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Forbidden.Body) { + self.body = body + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/conflict/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/conflict/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Conflict.Body) { + self.body = body + } + } + } + /// Types generated from the `#/components/headers` section of the OpenAPI document. + public enum Headers { + /// - Remark: Generated from `#/components/headers/link`. + public typealias Link = Swift.String + } +} + +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations { + /// List Dependabot alerts for an enterprise + /// + /// Lists Dependabot alerts for repositories that are owned by the specified enterprise. + /// + /// The authenticated user must be a member of the enterprise to use this endpoint. + /// + /// Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. For more information about security managers, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/dependabot/alerts`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)`. + public enum DependabotListAlertsForEnterprise { + public static let id: Swift.String = "dependabot/list-alerts-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.DependabotListAlertsForEnterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query`. + public struct Query: Sendable, Hashable { + /// A comma-separated list of states. If specified, only alerts with these states will be returned. + /// + /// Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/state`. + public var state: Components.Parameters.DependabotAlertCommaSeparatedStates? + /// A comma-separated list of severities. If specified, only alerts with these severities will be returned. + /// + /// Can be: `low`, `medium`, `high`, `critical` + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/severity`. + public var severity: Components.Parameters.DependabotAlertCommaSeparatedSeverities? + /// A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. + /// + /// Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust` + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/ecosystem`. + public var ecosystem: Components.Parameters.DependabotAlertCommaSeparatedEcosystems? + /// A comma-separated list of package names. If specified, only alerts for these packages will be returned. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/package`. + public var package: Components.Parameters.DependabotAlertCommaSeparatedPackages? + /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: + /// - An exact number (`n`) + /// - Comparators such as `>n`, `=n`, `<=n` + /// - A range like `n..n`, where `n` is a number from 0.0 to 1.0 + /// + /// Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/epss_percentage`. + public var epssPercentage: Components.Parameters.DependabotAlertCommaSeparatedEpss? + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`. + @frozen public enum DependabotAlertCommaSeparatedHas: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/Case2Payload`. + @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { + case patch = "patch" + } + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. + public typealias Case2Payload = [Components.Parameters.DependabotAlertCommaSeparatedHas.Case2PayloadPayload] + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. + case case2(Components.Parameters.DependabotAlertCommaSeparatedHas.Case2Payload) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. + /// Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/has`. + public var has: Components.Parameters.DependabotAlertCommaSeparatedHas? + /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. + @frozen public enum DependabotAlertScope: String, Codable, Hashable, Sendable, CaseIterable { + case development = "development" + case runtime = "runtime" + } + /// The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/scope`. + public var scope: Components.Parameters.DependabotAlertScope? + /// - Remark: Generated from `#/components/parameters/dependabot-alert-sort`. + @frozen public enum DependabotAlertSort: String, Codable, Hashable, Sendable, CaseIterable { + case created = "created" + case updated = "updated" + case epssPercentage = "epss_percentage" + } + /// The property by which to sort the results. + /// `created` means when the alert was created. + /// `updated` means when the alert's state last changed. + /// `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/sort`. + public var sort: Components.Parameters.DependabotAlertSort? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/direction`. + public var direction: Components.Parameters.Direction? + /// 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)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// 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)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - state: A comma-separated list of states. If specified, only alerts with these states will be returned. + /// - severity: A comma-separated list of severities. If specified, only alerts with these severities will be returned. + /// - ecosystem: A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. + /// - package: A comma-separated list of package names. If specified, only alerts for these packages will be returned. + /// - epssPercentage: CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: + /// - 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. + /// - scope: The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. + /// - sort: The property by which to sort the results. + /// - direction: The direction to sort the results by. + /// - 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)." + /// - 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)." + /// - perPage: The number of results per page (max 100). 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)." + public init( + state: Components.Parameters.DependabotAlertCommaSeparatedStates? = nil, + severity: Components.Parameters.DependabotAlertCommaSeparatedSeverities? = nil, + ecosystem: Components.Parameters.DependabotAlertCommaSeparatedEcosystems? = nil, + package: Components.Parameters.DependabotAlertCommaSeparatedPackages? = nil, + epssPercentage: Components.Parameters.DependabotAlertCommaSeparatedEpss? = nil, + has: Components.Parameters.DependabotAlertCommaSeparatedHas? = nil, + scope: Components.Parameters.DependabotAlertScope? = nil, + sort: Components.Parameters.DependabotAlertSort? = nil, + direction: Components.Parameters.Direction? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.state = state + self.severity = severity + self.ecosystem = ecosystem + self.package = package + self.epssPercentage = epssPercentage + self.has = has + self.scope = scope + self.sort = sort + self.direction = direction + self.before = before + self.after = after + self.perPage = perPage + } + } + public var query: Operations.DependabotListAlertsForEnterprise.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.DependabotListAlertsForEnterprise.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.DependabotListAlertsForEnterprise.Input.Path, + query: Operations.DependabotListAlertsForEnterprise.Input.Query = .init(), + headers: Operations.DependabotListAlertsForEnterprise.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/responses/200/content/application\/json`. + case json([Components.Schemas.DependabotAlertWithRepository]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.DependabotAlertWithRepository] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.DependabotListAlertsForEnterprise.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.DependabotListAlertsForEnterprise.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.DependabotListAlertsForEnterprise.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.DependabotListAlertsForEnterprise.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found /// - /// - Remark: Generated from `#/components/schemas/dependabot-secret/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/dependabot-secret/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/dependabot-secret/updated_at`. - public var updatedAt: Foundation.Date - /// Creates a new `DependabotSecret`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/404`. /// - /// - Parameters: - /// - name: The name of the secret. - /// - createdAt: - /// - updatedAt: - public init( - name: Swift.String, - createdAt: Foundation.Date, - updatedAt: Foundation.Date - ) { - self.name = name - self.createdAt = createdAt - self.updatedAt = updatedAt - } - public enum CodingKeys: String, CodingKey { - case name - case createdAt = "created_at" - case updatedAt = "updated_at" - } - } - } - /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters { - /// 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)." - /// - /// - Remark: Generated from `#/components/parameters/pagination-before`. - public typealias PaginationBefore = Swift.String - /// 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)." - /// - /// - Remark: Generated from `#/components/parameters/pagination-after`. - public typealias PaginationAfter = Swift.String - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/components/parameters/per-page`. - public typealias PerPage = Swift.Int - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/components/parameters/page`. - public typealias Page = Swift.Int - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. - /// - /// - Remark: Generated from `#/components/parameters/enterprise`. - public typealias Enterprise = Swift.String - /// A comma-separated list of states. If specified, only alerts with these states will be returned. - /// - /// Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-states`. - public typealias DependabotAlertCommaSeparatedStates = Swift.String - /// A comma-separated list of severities. If specified, only alerts with these severities will be returned. - /// - /// Can be: `low`, `medium`, `high`, `critical` - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-severities`. - public typealias DependabotAlertCommaSeparatedSeverities = Swift.String - /// A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. - /// - /// Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust` - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-ecosystems`. - public typealias DependabotAlertCommaSeparatedEcosystems = Swift.String - /// A comma-separated list of package names. If specified, only alerts for these packages will be returned. - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-packages`. - public typealias DependabotAlertCommaSeparatedPackages = Swift.String - /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: - /// - An exact number (`n`) - /// - Comparators such as `>n`, `=n`, `<=n` - /// - A range like `n..n`, where `n` is a number from 0.0 to 1.0 - /// - /// Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned. - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-epss`. - public typealias DependabotAlertCommaSeparatedEpss = Swift.String - /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. - /// Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported. - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`. - @frozen public enum DependabotAlertCommaSeparatedHas: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/Case2Payload`. - @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { - case patch = "patch" - } - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. - public typealias Case2Payload = [Components.Parameters.DependabotAlertCommaSeparatedHas.Case2PayloadPayload] - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. - case case2(Components.Parameters.DependabotAlertCommaSeparatedHas.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } } } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - /// The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. - @frozen public enum DependabotAlertScope: String, Codable, Hashable, Sendable, CaseIterable { - case development = "development" - case runtime = "runtime" - } - /// The property by which to sort the results. - /// `created` means when the alert was created. - /// `updated` means when the alert's state last changed. - /// `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage. - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-sort`. - @frozen public enum DependabotAlertSort: String, Codable, Hashable, Sendable, CaseIterable { - case created = "created" - case updated = "updated" - case epssPercentage = "epss_percentage" - } - /// **Deprecated**. The number of results per page (max 100), starting from the first matching result. - /// This parameter must not be used in combination with `last`. - /// Instead, use `per_page` in combination with `after` to fetch the first page of results. - /// - /// - Remark: Generated from `#/components/parameters/pagination-first`. - public typealias PaginationFirst = Swift.Int - /// **Deprecated**. The number of results per page (max 100), starting from the last matching result. - /// This parameter must not be used in combination with `first`. - /// Instead, use `per_page` in combination with `before` to fetch the last page of results. - /// - /// - Remark: Generated from `#/components/parameters/pagination-last`. - public typealias PaginationLast = Swift.Int - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/owner`. - public typealias Owner = Swift.String - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/repo`. - public typealias Repo = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String - /// The name of the secret. - /// - /// - Remark: Generated from `#/components/parameters/secret-name`. - public typealias SecretName = Swift.String - /// A comma-separated list of full manifest paths. If specified, only alerts for these manifests will be returned. - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-manifests`. - public typealias DependabotAlertCommaSeparatedManifests = Swift.String - /// The number that identifies a Dependabot alert in its repository. - /// You can find this at the end of the URL for a Dependabot alert within GitHub, - /// or in `number` fields in the response from the - /// `GET /repos/{owner}/{repo}/dependabot/alerts` operation. - /// - /// - Remark: Generated from `#/components/parameters/dependabot-alert-number`. - public typealias DependabotAlertNumber = Components.Schemas.AlertNumber - } - /// 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 { - public struct ValidationFailedSimple: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. - case json(Components.Schemas.ValidationErrorSimple) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ValidationErrorSimple { - get throws { - switch self { - case let .json(body): - return body - } - } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" } } - /// Received HTTP response body - public var body: Components.Responses.ValidationFailedSimple.Body - /// Creates a new `ValidationFailedSimple`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.ValidationFailedSimple.Body) { - self.body = body + public static var allCases: [Self] { + [ + .json + ] } } - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/not_found/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. + } + /// Lists the repositories Dependabot can access in an organization + /// + /// Lists repositories that organization admins have allowed Dependabot to access when updating dependencies. + /// > [!NOTE] + /// > This operation supports both server-to-server and user-to-server access. + /// Unauthorized users will not see the existence of this endpoint. + /// + /// - Remark: HTTP `GET /organizations/{org}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/get(dependabot/repository-access-for-org)`. + public enum DependabotRepositoryAccessForOrg { + public static let id: Swift.String = "dependabot/repository-access-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org } } - /// Received HTTP response body - public var body: Components.Responses.NotFound.Body - /// Creates a new `NotFound`. + public var path: Operations.DependabotRepositoryAccessForOrg.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/GET/query`. + public struct Query: Sendable, Hashable { + /// The page number of results to fetch. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/GET/query/page`. + public var page: Swift.Int? + /// Number of results per page. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/GET/query/per_page`. + public var perPage: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - page: The page number of results to fetch. + /// - perPage: Number of results per page. + public init( + page: Swift.Int? = nil, + perPage: Swift.Int? = nil + ) { + self.page = page + self.perPage = perPage + } + } + public var query: Operations.DependabotRepositoryAccessForOrg.Input.Query + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.DependabotRepositoryAccessForOrg.Input.Headers + /// Creates a new `Input`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.NotFound.Body) { - self.body = body + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.DependabotRepositoryAccessForOrg.Input.Path, + query: Operations.DependabotRepositoryAccessForOrg.Input.Query = .init(), + headers: Operations.DependabotRepositoryAccessForOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers } } - public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/bad_request/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/bad_request/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/GET/responses/200/content/application\/json`. + case json(Components.Schemas.DependabotRepositoryAccessDetails) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.DependabotRepositoryAccessDetails { + get throws { + switch self { + case let .json(body): + return body + } } } } - /// - Remark: Generated from `#/components/responses/bad_request/content/application\/scim+json`. - case applicationScimJson(Components.Schemas.ScimError) - /// The associated value of the enum case if `self` is `.applicationScimJson`. + /// Received HTTP response body + public var body: Operations.DependabotRepositoryAccessForOrg.Output.Ok.Body + /// Creates a new `Ok`. /// - /// - Throws: An error if `self` is not `.applicationScimJson`. - /// - SeeAlso: `.applicationScimJson`. - public var applicationScimJson: Components.Schemas.ScimError { - get throws { - switch self { - case let .applicationScimJson(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/scim+json", - body: self - ) - } - } + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.DependabotRepositoryAccessForOrg.Output.Ok.Body) { + self.body = body } } - /// Received HTTP response body - public var body: Components.Responses.BadRequest.Body - /// Creates a new `BadRequest`. + /// Response /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.BadRequest.Body) { - self.body = body + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/get(dependabot/repository-access-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.DependabotRepositoryAccessForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.DependabotRepositoryAccessForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } } - } - public struct NotModified: Sendable, Hashable { - /// Creates a new `NotModified`. - public init() {} - } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/get(dependabot/repository-access-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) } } } - /// Received HTTP response body - public var body: Components.Responses.Forbidden.Body - /// Creates a new `Forbidden`. + /// Resource not found /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.Forbidden.Body) { - self.body = body + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/get(dependabot/repository-access-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/conflict/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/conflict/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) } } - /// Received HTTP response body - public var body: Components.Responses.Conflict.Body - /// Creates a new `Conflict`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.Conflict.Body) { - self.body = body + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] } } } - /// Types generated from the `#/components/headers` section of the OpenAPI document. - public enum Headers { - /// - Remark: Generated from `#/components/headers/link`. - public typealias Link = Swift.String - } -} - -/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations { - /// List Dependabot alerts for an enterprise - /// - /// Lists Dependabot alerts for repositories that are owned by the specified enterprise. - /// - /// The authenticated user must be a member of the enterprise to use this endpoint. - /// - /// Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. For more information about security managers, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." - /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /enterprises/{enterprise}/dependabot/alerts`. - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)`. - public enum DependabotListAlertsForEnterprise { - public static let id: Swift.String = "dependabot/list-alerts-for-enterprise" + /// Updates Dependabot's repository access list for an organization + /// + /// Updates repositories according to the list of repositories that organization admins have given Dependabot access to when they've updated dependencies. + /// + /// > [!NOTE] + /// > This operation supports both server-to-server and user-to-server access. + /// Unauthorized users will not see the existence of this endpoint. + /// + /// **Example request body:** + /// ```json + /// { + /// "repository_ids_to_add": [123, 456], + /// "repository_ids_to_remove": [789] + /// } + /// ``` + /// + /// - Remark: HTTP `PATCH /organizations/{org}/dependabot/repository-access`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/patch(dependabot/update-repository-access-for-org)`. + public enum DependabotUpdateRepositoryAccessForOrg { + public static let id: Swift.String = "dependabot/update-repository-access-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/PATCH/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/path/enterprise`. - public var enterprise: Components.Parameters.Enterprise + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/PATCH/path/org`. + public var org: Components.Parameters.Org /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. - public init(enterprise: Components.Parameters.Enterprise) { - self.enterprise = enterprise + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org } } - public var path: Operations.DependabotListAlertsForEnterprise.Input.Path - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query`. - public struct Query: Sendable, Hashable { - /// A comma-separated list of states. If specified, only alerts with these states will be returned. - /// - /// Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/state`. - public var state: Components.Parameters.DependabotAlertCommaSeparatedStates? - /// A comma-separated list of severities. If specified, only alerts with these severities will be returned. - /// - /// Can be: `low`, `medium`, `high`, `critical` - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/severity`. - public var severity: Components.Parameters.DependabotAlertCommaSeparatedSeverities? - /// A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. - /// - /// Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust` - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/ecosystem`. - public var ecosystem: Components.Parameters.DependabotAlertCommaSeparatedEcosystems? - /// A comma-separated list of package names. If specified, only alerts for these packages will be returned. - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/package`. - public var package: Components.Parameters.DependabotAlertCommaSeparatedPackages? - /// CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: - /// - An exact number (`n`) - /// - Comparators such as `>n`, `=n`, `<=n` - /// - A range like `n..n`, where `n` is a number from 0.0 to 1.0 - /// - /// Filters the list of alerts based on EPSS percentages. If specified, only alerts with the provided EPSS percentages will be returned. + public var path: Operations.DependabotUpdateRepositoryAccessForOrg.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/epss_percentage`. - public var epssPercentage: Components.Parameters.DependabotAlertCommaSeparatedEpss? - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`. - @frozen public enum DependabotAlertCommaSeparatedHas: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/Case2Payload`. - @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { - case patch = "patch" + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.DependabotUpdateRepositoryAccessForOrg.Input.Headers + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// List of repository IDs to add. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/PATCH/requestBody/json/repository_ids_to_add`. + public var repositoryIdsToAdd: [Swift.Int]? + /// List of repository IDs to remove. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/PATCH/requestBody/json/repository_ids_to_remove`. + public var repositoryIdsToRemove: [Swift.Int]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - repositoryIdsToAdd: List of repository IDs to add. + /// - repositoryIdsToRemove: List of repository IDs to remove. + public init( + repositoryIdsToAdd: [Swift.Int]? = nil, + repositoryIdsToRemove: [Swift.Int]? = nil + ) { + self.repositoryIdsToAdd = repositoryIdsToAdd + self.repositoryIdsToRemove = repositoryIdsToRemove } - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. - public typealias Case2Payload = [Components.Parameters.DependabotAlertCommaSeparatedHas.Case2PayloadPayload] - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. - case case2(Components.Parameters.DependabotAlertCommaSeparatedHas.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors + public enum CodingKeys: String, CodingKey { + case repositoryIdsToAdd = "repository_ids_to_add" + case repositoryIdsToRemove = "repository_ids_to_remove" + } + } + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/PATCH/requestBody/content/application\/json`. + case json(Operations.DependabotUpdateRepositoryAccessForOrg.Input.Body.JsonPayload) + } + public var body: Operations.DependabotUpdateRepositoryAccessForOrg.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.DependabotUpdateRepositoryAccessForOrg.Input.Path, + headers: Operations.DependabotUpdateRepositoryAccessForOrg.Input.Headers = .init(), + body: Operations.DependabotUpdateRepositoryAccessForOrg.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/patch(dependabot/update-repository-access-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.DependabotUpdateRepositoryAccessForOrg.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/patch(dependabot/update-repository-access-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.DependabotUpdateRepositoryAccessForOrg.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self ) } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/patch(dependabot/update-repository-access-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) } } - /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. - /// Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported. - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/has`. - public var has: Components.Parameters.DependabotAlertCommaSeparatedHas? - /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. - @frozen public enum DependabotAlertScope: String, Codable, Hashable, Sendable, CaseIterable { - case development = "development" - case runtime = "runtime" + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/patch(dependabot/update-repository-access-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } } - /// The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/scope`. - public var scope: Components.Parameters.DependabotAlertScope? - /// - Remark: Generated from `#/components/parameters/dependabot-alert-sort`. - @frozen public enum DependabotAlertSort: String, Codable, Hashable, Sendable, CaseIterable { - case created = "created" - case updated = "updated" - case epssPercentage = "epss_percentage" + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) } - /// The property by which to sort the results. - /// `created` means when the alert was created. - /// `updated` means when the alert's state last changed. - /// `epss_percentage` sorts alerts by the Exploit Prediction Scoring System (EPSS) percentage. - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/sort`. - public var sort: Components.Parameters.DependabotAlertSort? - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// 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)." - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// 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)." - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/after`. - public var after: Components.Parameters.PaginationAfter? - /// **Deprecated**. The number of results per page (max 100), starting from the first matching result. - /// This parameter must not be used in combination with `last`. - /// Instead, use `per_page` in combination with `after` to fetch the first page of results. - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/first`. - public var first: Components.Parameters.PaginationFirst? - /// **Deprecated**. The number of results per page (max 100), starting from the last matching result. - /// This parameter must not be used in combination with `first`. - /// Instead, use `per_page` in combination with `before` to fetch the last page of results. - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/last`. - public var last: Components.Parameters.PaginationLast? - /// The number of results per page (max 100). 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)." + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set the default repository access level for Dependabot + /// + /// Sets the default level of repository access Dependabot will have while performing an update. Available values are: + /// - 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories. + /// - 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories. + /// + /// Unauthorized users will not see the existence of this endpoint. + /// + /// This operation supports both server-to-server and user-to-server access. + /// + /// - Remark: HTTP `PUT /organizations/{org}/dependabot/repository-access/default-level`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level)`. + public enum DependabotSetRepositoryAccessDefaultLevel { + public static let id: Swift.String = "dependabot/set-repository-access-default-level" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/default-level/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// Creates a new `Query`. + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/default-level/PUT/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. /// /// - Parameters: - /// - state: A comma-separated list of states. If specified, only alerts with these states will be returned. - /// - severity: A comma-separated list of severities. If specified, only alerts with these severities will be returned. - /// - ecosystem: A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. - /// - package: A comma-separated list of package names. If specified, only alerts for these packages will be returned. - /// - epssPercentage: CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: - /// - 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. - /// - scope: The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. - /// - sort: The property by which to sort the results. - /// - direction: The direction to sort the results by. - /// - 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)." - /// - 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)." - /// - first: **Deprecated**. The number of results per page (max 100), starting from the first matching result. - /// - last: **Deprecated**. The number of results per page (max 100), starting from the last matching result. - /// - perPage: The number of results per page (max 100). 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)." - public init( - state: Components.Parameters.DependabotAlertCommaSeparatedStates? = nil, - severity: Components.Parameters.DependabotAlertCommaSeparatedSeverities? = nil, - ecosystem: Components.Parameters.DependabotAlertCommaSeparatedEcosystems? = nil, - package: Components.Parameters.DependabotAlertCommaSeparatedPackages? = nil, - epssPercentage: Components.Parameters.DependabotAlertCommaSeparatedEpss? = nil, - has: Components.Parameters.DependabotAlertCommaSeparatedHas? = nil, - scope: Components.Parameters.DependabotAlertScope? = nil, - sort: Components.Parameters.DependabotAlertSort? = nil, - direction: Components.Parameters.Direction? = nil, - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil, - first: Components.Parameters.PaginationFirst? = nil, - last: Components.Parameters.PaginationLast? = nil, - perPage: Components.Parameters.PerPage? = nil - ) { - self.state = state - self.severity = severity - self.ecosystem = ecosystem - self.package = package - self.epssPercentage = epssPercentage - self.has = has - self.scope = scope - self.sort = sort - self.direction = direction - self.before = before - self.after = after - self.first = first - self.last = last - self.perPage = perPage + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org } } - public var query: Operations.DependabotListAlertsForEnterprise.Input.Query - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/header`. + public var path: Operations.DependabotSetRepositoryAccessDefaultLevel.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/default-level/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.DependabotListAlertsForEnterprise.Input.Headers + public var headers: Operations.DependabotSetRepositoryAccessDefaultLevel.Input.Headers + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/default-level/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/default-level/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The default repository access level for Dependabot updates. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/default-level/PUT/requestBody/json/default_level`. + @frozen public enum DefaultLevelPayload: String, Codable, Hashable, Sendable, CaseIterable { + case _public = "public" + case _internal = "internal" + } + /// The default repository access level for Dependabot updates. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/default-level/PUT/requestBody/json/default_level`. + public var defaultLevel: Operations.DependabotSetRepositoryAccessDefaultLevel.Input.Body.JsonPayload.DefaultLevelPayload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - defaultLevel: The default repository access level for Dependabot updates. + public init(defaultLevel: Operations.DependabotSetRepositoryAccessDefaultLevel.Input.Body.JsonPayload.DefaultLevelPayload) { + self.defaultLevel = defaultLevel + } + public enum CodingKeys: String, CodingKey { + case defaultLevel = "default_level" + } + } + /// - Remark: Generated from `#/paths/organizations/{org}/dependabot/repository-access/default-level/PUT/requestBody/content/application\/json`. + case json(Operations.DependabotSetRepositoryAccessDefaultLevel.Input.Body.JsonPayload) + } + public var body: Operations.DependabotSetRepositoryAccessDefaultLevel.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.DependabotListAlertsForEnterprise.Input.Path, - query: Operations.DependabotListAlertsForEnterprise.Input.Query = .init(), - headers: Operations.DependabotListAlertsForEnterprise.Input.Headers = .init() + path: Operations.DependabotSetRepositoryAccessDefaultLevel.Input.Path, + headers: Operations.DependabotSetRepositoryAccessDefaultLevel.Input.Headers = .init(), + body: Operations.DependabotSetRepositoryAccessDefaultLevel.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/responses/200/content/application\/json`. - case json([Components.Schemas.DependabotAlertWithRepository]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.DependabotAlertWithRepository] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.DependabotListAlertsForEnterprise.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.DependabotListAlertsForEnterprise.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.DependabotListAlertsForEnterprise.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.DependabotListAlertsForEnterprise.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/304`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level)/responses/204`. /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified + /// HTTP response code: `204 noContent`. + case noContent(Operations.DependabotSetRepositoryAccessDefaultLevel.Output.NoContent) + /// Response /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/304`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level)/responses/204`. /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) } - /// The associated value of the enum case if `self` is `.notModified`. + /// The associated value of the enum case if `self` is `.noContent`. /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.DependabotSetRepositoryAccessDefaultLevel.Output.NoContent { get throws { switch self { - case let .notModified(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notModified", + expectedStatus: "noContent", response: self ) } @@ -4253,7 +5506,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/403`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -4276,7 +5529,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/404`. + /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -4297,29 +5550,6 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -4412,18 +5642,29 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/epss_percentage`. public var epssPercentage: Components.Parameters.DependabotAlertCommaSeparatedEpss? - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has`. - @frozen public enum DependabotAlertCommaSeparatedHas: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case1`. + /// A comma-separated list of artifact registry URLs. If specified, only alerts for repositories with storage records matching these URLs will be returned. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/artifact_registry_url`. + public var artifactRegistryUrl: Components.Parameters.DependabotAlertCommaSeparatedArtifactRegistryUrls? + /// A comma-separated list of Artifact Registry name strings. If specified, only alerts for repositories with storage records matching these registries will be returned. + /// + /// Can be: `jfrog-artifactory` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/artifact_registry`. + public var artifactRegistry: Components.Parameters.DependabotAlertCommaSeparatedArtifactRegistry? + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has`. + @frozen public enum DependabotAlertOrgScopeCommaSeparatedHas: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case1`. case case1(Swift.String) - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/Case2Payload`. + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/Case2Payload`. @frozen public enum Case2PayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { case patch = "patch" + case deployment = "deployment" } - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. - public typealias Case2Payload = [Components.Parameters.DependabotAlertCommaSeparatedHas.Case2PayloadPayload] - /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-has/case2`. - case case2(Components.Parameters.DependabotAlertCommaSeparatedHas.Case2Payload) + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`. + public typealias Case2Payload = [Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2PayloadPayload] + /// - Remark: Generated from `#/components/parameters/dependabot-alert-org-scope-comma-separated-has/case2`. + case case2(Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas.Case2Payload) public init(from decoder: any Decoder) throws { var errors: [any Error] = [] do { @@ -4454,10 +5695,16 @@ public enum Operations { } } /// Filters the list of alerts based on whether the alert has the given value. If specified, only alerts meeting this criterion will be returned. - /// Multiple `has` filters can be passed to filter for alerts that have all of the values. Currently, only `patch` is supported. + /// Multiple `has` filters can be passed to filter for alerts that have all of the values. /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/has`. - public var has: Components.Parameters.DependabotAlertCommaSeparatedHas? + public var has: Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas? + /// A comma-separated list of runtime risk strings. If specified, only alerts for repositories with deployment records matching these risks will be returned. + /// + /// Can be: `critical-resource`, `internet-exposed`, `sensitive-data`, `lateral-movement` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/runtime_risk`. + public var runtimeRisk: Components.Parameters.DependabotAlertCommaSeparatedRuntimeRisk? /// - Remark: Generated from `#/components/parameters/dependabot-alert-scope`. @frozen public enum DependabotAlertScope: String, Codable, Hashable, Sendable, CaseIterable { case development = "development" @@ -4497,18 +5744,6 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/after`. public var after: Components.Parameters.PaginationAfter? - /// **Deprecated**. The number of results per page (max 100), starting from the first matching result. - /// This parameter must not be used in combination with `last`. - /// Instead, use `per_page` in combination with `after` to fetch the first page of results. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/first`. - public var first: Components.Parameters.PaginationFirst? - /// **Deprecated**. The number of results per page (max 100), starting from the last matching result. - /// This parameter must not be used in combination with `first`. - /// Instead, use `per_page` in combination with `before` to fetch the last page of results. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/last`. - public var last: Components.Parameters.PaginationLast? /// The number of results per page (max 100). 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)." /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/per_page`. @@ -4521,14 +5756,15 @@ public enum Operations { /// - ecosystem: A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. /// - package: A comma-separated list of package names. If specified, only alerts for these packages will be returned. /// - epssPercentage: CVE Exploit Prediction Scoring System (EPSS) percentage. Can be specified as: + /// - artifactRegistryUrl: A comma-separated list of artifact registry URLs. If specified, only alerts for repositories with storage records matching these URLs will be returned. + /// - 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. /// - 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. + /// - runtimeRisk: A comma-separated list of runtime risk strings. If specified, only alerts for repositories with deployment records matching these risks will be returned. /// - scope: The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. /// - sort: The property by which to sort the results. /// - direction: The direction to sort the results by. /// - 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)." /// - 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)." - /// - first: **Deprecated**. The number of results per page (max 100), starting from the first matching result. - /// - last: **Deprecated**. The number of results per page (max 100), starting from the last matching result. /// - perPage: The number of results per page (max 100). 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)." public init( state: Components.Parameters.DependabotAlertCommaSeparatedStates? = nil, @@ -4536,14 +5772,15 @@ public enum Operations { ecosystem: Components.Parameters.DependabotAlertCommaSeparatedEcosystems? = nil, package: Components.Parameters.DependabotAlertCommaSeparatedPackages? = nil, epssPercentage: Components.Parameters.DependabotAlertCommaSeparatedEpss? = nil, - has: Components.Parameters.DependabotAlertCommaSeparatedHas? = nil, + artifactRegistryUrl: Components.Parameters.DependabotAlertCommaSeparatedArtifactRegistryUrls? = nil, + artifactRegistry: Components.Parameters.DependabotAlertCommaSeparatedArtifactRegistry? = nil, + has: Components.Parameters.DependabotAlertOrgScopeCommaSeparatedHas? = nil, + runtimeRisk: Components.Parameters.DependabotAlertCommaSeparatedRuntimeRisk? = nil, scope: Components.Parameters.DependabotAlertScope? = nil, sort: Components.Parameters.DependabotAlertSort? = nil, direction: Components.Parameters.Direction? = nil, before: Components.Parameters.PaginationBefore? = nil, after: Components.Parameters.PaginationAfter? = nil, - first: Components.Parameters.PaginationFirst? = nil, - last: Components.Parameters.PaginationLast? = nil, perPage: Components.Parameters.PerPage? = nil ) { self.state = state @@ -4551,14 +5788,15 @@ public enum Operations { self.ecosystem = ecosystem self.package = package self.epssPercentage = epssPercentage + self.artifactRegistryUrl = artifactRegistryUrl + self.artifactRegistry = artifactRegistry self.has = has + self.runtimeRisk = runtimeRisk self.scope = scope self.sort = sort self.direction = direction self.before = before self.after = after - self.first = first - self.last = last self.perPage = perPage } } @@ -5357,22 +6595,73 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/visibility`. public var visibility: Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.VisibilityPayload - /// 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. + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/SelectedRepositoryIdsPayload`. + public struct SelectedRepositoryIdsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/SelectedRepositoryIdsPayload/value1`. + public var value1: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/SelectedRepositoryIdsPayload/value2`. + public var value2: Swift.String? + /// Creates a new `SelectedRepositoryIdsPayloadPayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Swift.Int? = nil, + value2: Swift.String? = nil + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self.value1 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + do { + self.value2 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeFirstNonNilValueToSingleValueContainer([ + self.value1, + self.value2 + ]) + } + } + /// 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. /// /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.String]? + public typealias SelectedRepositoryIdsPayload = [Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.SelectedRepositoryIdsPayloadPayload] + /// 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. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/secrets/{secret_name}/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.SelectedRepositoryIdsPayload? /// Creates a new `JsonPayload`. /// /// - Parameters: /// - 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. /// - keyId: ID of the key you used to encrypt the secret. /// - 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. - /// - 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. + /// - 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. public init( encryptedValue: Swift.String? = nil, keyId: Swift.String? = nil, visibility: Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.VisibilityPayload, - selectedRepositoryIds: [Swift.String]? = nil + selectedRepositoryIds: Operations.DependabotCreateOrUpdateOrgSecret.Input.Body.JsonPayload.SelectedRepositoryIdsPayload? = nil ) { self.encryptedValue = encryptedValue self.keyId = keyId @@ -6319,11 +7608,6 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/direction`. public var direction: Components.Parameters.Direction? - /// **Closing down notice**. Page number of the results to fetch. Use cursor-based pagination with `before` or `after` instead. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/page`. - @available(*, deprecated) - public var page: Swift.Int? /// The number of results per page (max 100). 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)." /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/per_page`. @@ -6337,18 +7621,6 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/after`. public var after: Components.Parameters.PaginationAfter? - /// **Deprecated**. The number of results per page (max 100), starting from the first matching result. - /// This parameter must not be used in combination with `last`. - /// Instead, use `per_page` in combination with `after` to fetch the first page of results. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/first`. - public var first: Components.Parameters.PaginationFirst? - /// **Deprecated**. The number of results per page (max 100), starting from the last matching result. - /// This parameter must not be used in combination with `first`. - /// Instead, use `per_page` in combination with `before` to fetch the last page of results. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/last`. - public var last: Components.Parameters.PaginationLast? /// Creates a new `Query`. /// /// - Parameters: @@ -6362,12 +7634,9 @@ public enum Operations { /// - scope: The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. /// - sort: The property by which to sort the results. /// - direction: The direction to sort the results by. - /// - page: **Closing down notice**. Page number of the results to fetch. Use cursor-based pagination with `before` or `after` instead. /// - perPage: The number of results per page (max 100). 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)." /// - 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)." /// - 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)." - /// - first: **Deprecated**. The number of results per page (max 100), starting from the first matching result. - /// - last: **Deprecated**. The number of results per page (max 100), starting from the last matching result. public init( state: Components.Parameters.DependabotAlertCommaSeparatedStates? = nil, severity: Components.Parameters.DependabotAlertCommaSeparatedSeverities? = nil, @@ -6379,12 +7648,9 @@ public enum Operations { scope: Components.Parameters.DependabotAlertScope? = nil, sort: Components.Parameters.DependabotAlertSort? = nil, direction: Components.Parameters.Direction? = nil, - page: Swift.Int? = nil, perPage: Swift.Int? = nil, before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil, - first: Components.Parameters.PaginationFirst? = nil, - last: Components.Parameters.PaginationLast? = nil + after: Components.Parameters.PaginationAfter? = nil ) { self.state = state self.severity = severity @@ -6396,12 +7662,9 @@ public enum Operations { self.scope = scope self.sort = sort self.direction = direction - self.page = page self.perPage = perPage self.before = before self.after = after - self.first = first - self.last = last } } public var query: Operations.DependabotListAlertsForRepo.Input.Query diff --git a/Sources/enterprise-team-memberships/Client.swift b/Sources/enterprise-team-memberships/Client.swift new file mode 100644 index 00000000000..c84c8635940 --- /dev/null +++ b/Sources/enterprise-team-memberships/Client.swift @@ -0,0 +1,476 @@ +// 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 + } + /// List members in an enterprise team + /// + /// Lists all team members in an enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/get(enterprise-team-memberships/list)`. + public func enterpriseTeamMembershipsList(_ input: Operations.EnterpriseTeamMembershipsList.Input) async throws -> Operations.EnterpriseTeamMembershipsList.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsList.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.EnterpriseTeamMembershipsList.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamMembershipsList.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.SimpleUser].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Bulk add team members + /// + /// Add multiple team members to an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/post(enterprise-team-memberships/bulk-add)`. + public func enterpriseTeamMembershipsBulkAdd(_ input: Operations.EnterpriseTeamMembershipsBulkAdd.Input) async throws -> Operations.EnterpriseTeamMembershipsBulkAdd.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsBulkAdd.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships/add", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamMembershipsBulkAdd.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.SimpleUser].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Bulk remove team members + /// + /// Remove multiple team members from an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/post(enterprise-team-memberships/bulk-remove)`. + public func enterpriseTeamMembershipsBulkRemove(_ input: Operations.EnterpriseTeamMembershipsBulkRemove.Input) async throws -> Operations.EnterpriseTeamMembershipsBulkRemove.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsBulkRemove.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships/remove", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamMembershipsBulkRemove.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.SimpleUser].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get enterprise team membership + /// + /// Returns whether the user is a member of the enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/get(enterprise-team-memberships/get)`. + public func enterpriseTeamMembershipsGet(_ input: Operations.EnterpriseTeamMembershipsGet.Input) async throws -> Operations.EnterpriseTeamMembershipsGet.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsGet.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships/{}", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamMembershipsGet.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.SimpleUser.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add team member + /// + /// Add a team member to an enterprise team. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/put(enterprise-team-memberships/add)`. + public func enterpriseTeamMembershipsAdd(_ input: Operations.EnterpriseTeamMembershipsAdd.Input) async throws -> Operations.EnterpriseTeamMembershipsAdd.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsAdd.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships/{}", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamMembershipsAdd.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.SimpleUser.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove team membership + /// + /// Remove membership of a specific user from a particular team in an enterprise. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)`. + public func enterpriseTeamMembershipsRemove(_ input: Operations.EnterpriseTeamMembershipsRemove.Input) async throws -> Operations.EnterpriseTeamMembershipsRemove.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamMembershipsRemove.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/memberships/{}", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } +} diff --git a/Sources/enterprise-team-memberships/Types.swift b/Sources/enterprise-team-memberships/Types.swift new file mode 100644 index 00000000000..12f2f198ba9 --- /dev/null +++ b/Sources/enterprise-team-memberships/Types.swift @@ -0,0 +1,1401 @@ +// 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 { + /// List members in an enterprise team + /// + /// Lists all team members in an enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/get(enterprise-team-memberships/list)`. + func enterpriseTeamMembershipsList(_ input: Operations.EnterpriseTeamMembershipsList.Input) async throws -> Operations.EnterpriseTeamMembershipsList.Output + /// Bulk add team members + /// + /// Add multiple team members to an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/post(enterprise-team-memberships/bulk-add)`. + func enterpriseTeamMembershipsBulkAdd(_ input: Operations.EnterpriseTeamMembershipsBulkAdd.Input) async throws -> Operations.EnterpriseTeamMembershipsBulkAdd.Output + /// Bulk remove team members + /// + /// Remove multiple team members from an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/post(enterprise-team-memberships/bulk-remove)`. + func enterpriseTeamMembershipsBulkRemove(_ input: Operations.EnterpriseTeamMembershipsBulkRemove.Input) async throws -> Operations.EnterpriseTeamMembershipsBulkRemove.Output + /// Get enterprise team membership + /// + /// Returns whether the user is a member of the enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/get(enterprise-team-memberships/get)`. + func enterpriseTeamMembershipsGet(_ input: Operations.EnterpriseTeamMembershipsGet.Input) async throws -> Operations.EnterpriseTeamMembershipsGet.Output + /// Add team member + /// + /// Add a team member to an enterprise team. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/put(enterprise-team-memberships/add)`. + func enterpriseTeamMembershipsAdd(_ input: Operations.EnterpriseTeamMembershipsAdd.Input) async throws -> Operations.EnterpriseTeamMembershipsAdd.Output + /// Remove team membership + /// + /// Remove membership of a specific user from a particular team in an enterprise. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)`. + func enterpriseTeamMembershipsRemove(_ input: Operations.EnterpriseTeamMembershipsRemove.Input) async throws -> Operations.EnterpriseTeamMembershipsRemove.Output +} + +/// Convenience overloads for operation inputs. +extension APIProtocol { + /// List members in an enterprise team + /// + /// Lists all team members in an enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/get(enterprise-team-memberships/list)`. + public func enterpriseTeamMembershipsList( + path: Operations.EnterpriseTeamMembershipsList.Input.Path, + query: Operations.EnterpriseTeamMembershipsList.Input.Query = .init(), + headers: Operations.EnterpriseTeamMembershipsList.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamMembershipsList.Output { + try await enterpriseTeamMembershipsList(Operations.EnterpriseTeamMembershipsList.Input( + path: path, + query: query, + headers: headers + )) + } + /// Bulk add team members + /// + /// Add multiple team members to an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/post(enterprise-team-memberships/bulk-add)`. + public func enterpriseTeamMembershipsBulkAdd( + path: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Path, + headers: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Headers = .init(), + body: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Body + ) async throws -> Operations.EnterpriseTeamMembershipsBulkAdd.Output { + try await enterpriseTeamMembershipsBulkAdd(Operations.EnterpriseTeamMembershipsBulkAdd.Input( + path: path, + headers: headers, + body: body + )) + } + /// Bulk remove team members + /// + /// Remove multiple team members from an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/post(enterprise-team-memberships/bulk-remove)`. + public func enterpriseTeamMembershipsBulkRemove( + path: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Path, + headers: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Headers = .init(), + body: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Body + ) async throws -> Operations.EnterpriseTeamMembershipsBulkRemove.Output { + try await enterpriseTeamMembershipsBulkRemove(Operations.EnterpriseTeamMembershipsBulkRemove.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get enterprise team membership + /// + /// Returns whether the user is a member of the enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/get(enterprise-team-memberships/get)`. + public func enterpriseTeamMembershipsGet( + path: Operations.EnterpriseTeamMembershipsGet.Input.Path, + headers: Operations.EnterpriseTeamMembershipsGet.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamMembershipsGet.Output { + try await enterpriseTeamMembershipsGet(Operations.EnterpriseTeamMembershipsGet.Input( + path: path, + headers: headers + )) + } + /// Add team member + /// + /// Add a team member to an enterprise team. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/put(enterprise-team-memberships/add)`. + public func enterpriseTeamMembershipsAdd( + path: Operations.EnterpriseTeamMembershipsAdd.Input.Path, + headers: Operations.EnterpriseTeamMembershipsAdd.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamMembershipsAdd.Output { + try await enterpriseTeamMembershipsAdd(Operations.EnterpriseTeamMembershipsAdd.Input( + path: path, + headers: headers + )) + } + /// Remove team membership + /// + /// Remove membership of a specific user from a particular team in an enterprise. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)`. + public func enterpriseTeamMembershipsRemove( + path: Operations.EnterpriseTeamMembershipsRemove.Input.Path, + headers: Operations.EnterpriseTeamMembershipsRemove.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamMembershipsRemove.Output { + try await enterpriseTeamMembershipsRemove(Operations.EnterpriseTeamMembershipsRemove.Input( + path: path, + headers: headers + )) + } +} + +/// 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 { + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/simple-user`. + public struct SimpleUser: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/simple-user/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/avatar_url`. + public var avatarUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/gravatar_id`. + public var gravatarId: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/followers_url`. + public var followersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/following_url`. + public var followingUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/gists_url`. + public var gistsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/starred_url`. + public var starredUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/subscriptions_url`. + public var subscriptionsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/organizations_url`. + public var organizationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/repos_url`. + public var reposUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/received_events_url`. + public var receivedEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/site_admin`. + public var siteAdmin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. + public var starredAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `SimpleUser`. + /// + /// - Parameters: + /// - name: + /// - email: + /// - login: + /// - id: + /// - nodeId: + /// - avatarUrl: + /// - gravatarId: + /// - url: + /// - htmlUrl: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - starredUrl: + /// - subscriptionsUrl: + /// - organizationsUrl: + /// - reposUrl: + /// - eventsUrl: + /// - receivedEventsUrl: + /// - _type: + /// - siteAdmin: + /// - starredAt: + /// - userViewType: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + avatarUrl: Swift.String, + gravatarId: Swift.String? = nil, + url: Swift.String, + htmlUrl: Swift.String, + followersUrl: Swift.String, + followingUrl: Swift.String, + gistsUrl: Swift.String, + starredUrl: Swift.String, + subscriptionsUrl: Swift.String, + organizationsUrl: Swift.String, + reposUrl: Swift.String, + eventsUrl: Swift.String, + receivedEventsUrl: Swift.String, + _type: Swift.String, + siteAdmin: Swift.Bool, + starredAt: Swift.String? = nil, + userViewType: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.nodeId = nodeId + self.avatarUrl = avatarUrl + self.gravatarId = gravatarId + self.url = url + self.htmlUrl = htmlUrl + self.followersUrl = followersUrl + self.followingUrl = followingUrl + self.gistsUrl = gistsUrl + self.starredUrl = starredUrl + self.subscriptionsUrl = subscriptionsUrl + self.organizationsUrl = organizationsUrl + self.reposUrl = reposUrl + self.eventsUrl = eventsUrl + self.receivedEventsUrl = receivedEventsUrl + self._type = _type + self.siteAdmin = siteAdmin + self.starredAt = starredAt + self.userViewType = userViewType + } + public enum CodingKeys: String, CodingKey { + case name + case email + case login + case id + case nodeId = "node_id" + case avatarUrl = "avatar_url" + case gravatarId = "gravatar_id" + case url + case htmlUrl = "html_url" + case followersUrl = "followers_url" + case followingUrl = "following_url" + case gistsUrl = "gists_url" + case starredUrl = "starred_url" + case subscriptionsUrl = "subscriptions_url" + case organizationsUrl = "organizations_url" + case reposUrl = "repos_url" + case eventsUrl = "events_url" + case receivedEventsUrl = "received_events_url" + case _type = "type" + case siteAdmin = "site_admin" + case starredAt = "starred_at" + case userViewType = "user_view_type" + } + } + /// Basic Error + /// + /// - Remark: Generated from `#/components/schemas/basic-error`. + public struct BasicError: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/basic-error/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/status`. + public var status: Swift.String? + /// Creates a new `BasicError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - url: + /// - status: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + url: Swift.String? = nil, + status: Swift.String? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.url = url + self.status = status + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case url + case status + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/components/parameters/per-page`. + public typealias PerPage = Swift.Int + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/components/parameters/page`. + public typealias Page = Swift.Int + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/components/parameters/enterprise`. + public typealias Enterprise = Swift.String + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/components/parameters/enterprise-team`. + public typealias EnterpriseTeam = Swift.String + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + } + /// 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 { + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Forbidden.Body) { + self.body = body + } + } + } + /// Types generated from the `#/components/headers` section of the OpenAPI document. + public enum Headers { + /// - Remark: Generated from `#/components/headers/link`. + public typealias Link = Swift.String + } +} + +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations { + /// List members in an enterprise team + /// + /// Lists all team members in an enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/get(enterprise-team-memberships/list)`. + public enum EnterpriseTeamMembershipsList { + public static let id: Swift.String = "enterprise-team-memberships/list" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + } + } + public var path: Operations.EnterpriseTeamMembershipsList.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.EnterpriseTeamMembershipsList.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamMembershipsList.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.EnterpriseTeamMembershipsList.Input.Path, + query: Operations.EnterpriseTeamMembershipsList.Input.Query = .init(), + headers: Operations.EnterpriseTeamMembershipsList.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.EnterpriseTeamMembershipsList.Output.Ok.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.SimpleUser] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamMembershipsList.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.EnterpriseTeamMembershipsList.Output.Ok.Headers = .init(), + body: Operations.EnterpriseTeamMembershipsList.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/get(enterprise-team-memberships/list)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamMembershipsList.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.EnterpriseTeamMembershipsList.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Bulk add team members + /// + /// Add multiple team members to an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/post(enterprise-team-memberships/bulk-add)`. + public enum EnterpriseTeamMembershipsBulkAdd { + public static let id: Swift.String = "enterprise-team-memberships/bulk-add" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + } + } + public var path: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The GitHub user handles to add to the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/requestBody/json/usernames`. + public var usernames: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - usernames: The GitHub user handles to add to the team. + public init(usernames: [Swift.String]) { + self.usernames = usernames + } + public enum CodingKeys: String, CodingKey { + case usernames + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/requestBody/content/application\/json`. + case json(Operations.EnterpriseTeamMembershipsBulkAdd.Input.Body.JsonPayload) + } + public var body: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Path, + headers: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Headers = .init(), + body: Operations.EnterpriseTeamMembershipsBulkAdd.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/POST/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.SimpleUser] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamMembershipsBulkAdd.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamMembershipsBulkAdd.Output.Ok.Body) { + self.body = body + } + } + /// Successfully added team members. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/add/post(enterprise-team-memberships/bulk-add)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamMembershipsBulkAdd.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.EnterpriseTeamMembershipsBulkAdd.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Bulk remove team members + /// + /// Remove multiple team members from an enterprise team. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/post(enterprise-team-memberships/bulk-remove)`. + public enum EnterpriseTeamMembershipsBulkRemove { + public static let id: Swift.String = "enterprise-team-memberships/bulk-remove" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + } + } + public var path: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The GitHub user handles to be removed from the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/requestBody/json/usernames`. + public var usernames: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - usernames: The GitHub user handles to be removed from the team. + public init(usernames: [Swift.String]) { + self.usernames = usernames + } + public enum CodingKeys: String, CodingKey { + case usernames + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/requestBody/content/application\/json`. + case json(Operations.EnterpriseTeamMembershipsBulkRemove.Input.Body.JsonPayload) + } + public var body: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Path, + headers: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Headers = .init(), + body: Operations.EnterpriseTeamMembershipsBulkRemove.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/POST/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.SimpleUser] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamMembershipsBulkRemove.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamMembershipsBulkRemove.Output.Ok.Body) { + self.body = body + } + } + /// Successfully removed team members. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove/post(enterprise-team-memberships/bulk-remove)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamMembershipsBulkRemove.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.EnterpriseTeamMembershipsBulkRemove.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get enterprise team membership + /// + /// Returns whether the user is a member of the enterprise team. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/get(enterprise-team-memberships/get)`. + public enum EnterpriseTeamMembershipsGet { + public static let id: Swift.String = "enterprise-team-memberships/get" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// - username: The handle for the GitHub user account. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam, + username: Components.Parameters.Username + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + self.username = username + } + } + public var path: Operations.EnterpriseTeamMembershipsGet.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamMembershipsGet.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamMembershipsGet.Input.Path, + headers: Operations.EnterpriseTeamMembershipsGet.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.SimpleUser) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.SimpleUser { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamMembershipsGet.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamMembershipsGet.Output.Ok.Body) { + self.body = body + } + } + /// User is a member of the enterprise team. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/get(enterprise-team-memberships/get)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamMembershipsGet.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.EnterpriseTeamMembershipsGet.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Add team member + /// + /// Add a team member to an enterprise team. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/put(enterprise-team-memberships/add)`. + public enum EnterpriseTeamMembershipsAdd { + public static let id: Swift.String = "enterprise-team-memberships/add" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// - username: The handle for the GitHub user account. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam, + username: Components.Parameters.Username + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + self.username = username + } + } + public var path: Operations.EnterpriseTeamMembershipsAdd.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamMembershipsAdd.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamMembershipsAdd.Input.Path, + headers: Operations.EnterpriseTeamMembershipsAdd.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/PUT/responses/201/content/application\/json`. + case json(Components.Schemas.SimpleUser) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.SimpleUser { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamMembershipsAdd.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamMembershipsAdd.Output.Created.Body) { + self.body = body + } + } + /// Successfully added team member + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/put(enterprise-team-memberships/add)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.EnterpriseTeamMembershipsAdd.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.EnterpriseTeamMembershipsAdd.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Remove team membership + /// + /// Remove membership of a specific user from a particular team in an enterprise. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)`. + public enum EnterpriseTeamMembershipsRemove { + public static let id: Swift.String = "enterprise-team-memberships/remove" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/DELETE/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/DELETE/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/DELETE/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// - username: The handle for the GitHub user account. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam, + username: Components.Parameters.Username + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + self.username = username + } + } + public var path: Operations.EnterpriseTeamMembershipsRemove.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamMembershipsRemove.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamMembershipsRemove.Input.Path, + headers: Operations.EnterpriseTeamMembershipsRemove.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.EnterpriseTeamMembershipsRemove.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.EnterpriseTeamMembershipsRemove.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}/delete(enterprise-team-memberships/remove)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } +} diff --git a/Sources/enterprise-team-organizations/Client.swift b/Sources/enterprise-team-organizations/Client.swift new file mode 100644 index 00000000000..9359b54b36c --- /dev/null +++ b/Sources/enterprise-team-organizations/Client.swift @@ -0,0 +1,420 @@ +// 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 + } + /// Get organization assignments + /// + /// Get all organizations assigned to an enterprise team + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/get(enterprise-team-organizations/get-assignments)`. + public func enterpriseTeamOrganizationsGetAssignments(_ input: Operations.EnterpriseTeamOrganizationsGetAssignments.Input) async throws -> Operations.EnterpriseTeamOrganizationsGetAssignments.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamOrganizationsGetAssignments.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/organizations", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamOrganizationsGetAssignments.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.OrganizationSimple].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add organization assignments + /// + /// Assign an enterprise team to multiple organizations. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/add/post(enterprise-team-organizations/bulk-add)`. + public func enterpriseTeamOrganizationsBulkAdd(_ input: Operations.EnterpriseTeamOrganizationsBulkAdd.Input) async throws -> Operations.EnterpriseTeamOrganizationsBulkAdd.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamOrganizationsBulkAdd.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/organizations/add", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamOrganizationsBulkAdd.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.OrganizationSimple].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove organization assignments + /// + /// Unassign an enterprise team from multiple organizations. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove/post(enterprise-team-organizations/bulk-remove)`. + public func enterpriseTeamOrganizationsBulkRemove(_ input: Operations.EnterpriseTeamOrganizationsBulkRemove.Input) async throws -> Operations.EnterpriseTeamOrganizationsBulkRemove.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamOrganizationsBulkRemove.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/organizations/remove", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get organization assignment + /// + /// Check if an enterprise team is assigned to an organization + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/get(enterprise-team-organizations/get-assignment)`. + public func enterpriseTeamOrganizationsGetAssignment(_ input: Operations.EnterpriseTeamOrganizationsGetAssignment.Input) async throws -> Operations.EnterpriseTeamOrganizationsGetAssignment.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamOrganizationsGetAssignment.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/organizations/{}", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam, + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamOrganizationsGetAssignment.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.OrganizationSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + return .notFound(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add an organization assignment + /// + /// Assign an enterprise team to an organization. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/put(enterprise-team-organizations/add)`. + public func enterpriseTeamOrganizationsAdd(_ input: Operations.EnterpriseTeamOrganizationsAdd.Input) async throws -> Operations.EnterpriseTeamOrganizationsAdd.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamOrganizationsAdd.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/organizations/{}", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam, + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamOrganizationsAdd.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.OrganizationSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete an organization assignment + /// + /// Unassign an enterprise team from an organization. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/delete(enterprise-team-organizations/delete)`. + public func enterpriseTeamOrganizationsDelete(_ input: Operations.EnterpriseTeamOrganizationsDelete.Input) async throws -> Operations.EnterpriseTeamOrganizationsDelete.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamOrganizationsDelete.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}/organizations/{}", + parameters: [ + input.path.enterprise, + input.path.enterpriseTeam, + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } +} diff --git a/Sources/enterprise-team-organizations/Types.swift b/Sources/enterprise-team-organizations/Types.swift new file mode 100644 index 00000000000..0f896b98b10 --- /dev/null +++ b/Sources/enterprise-team-organizations/Types.swift @@ -0,0 +1,1159 @@ +// 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 { + /// Get organization assignments + /// + /// Get all organizations assigned to an enterprise team + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/get(enterprise-team-organizations/get-assignments)`. + func enterpriseTeamOrganizationsGetAssignments(_ input: Operations.EnterpriseTeamOrganizationsGetAssignments.Input) async throws -> Operations.EnterpriseTeamOrganizationsGetAssignments.Output + /// Add organization assignments + /// + /// Assign an enterprise team to multiple organizations. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/add/post(enterprise-team-organizations/bulk-add)`. + func enterpriseTeamOrganizationsBulkAdd(_ input: Operations.EnterpriseTeamOrganizationsBulkAdd.Input) async throws -> Operations.EnterpriseTeamOrganizationsBulkAdd.Output + /// Remove organization assignments + /// + /// Unassign an enterprise team from multiple organizations. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove/post(enterprise-team-organizations/bulk-remove)`. + func enterpriseTeamOrganizationsBulkRemove(_ input: Operations.EnterpriseTeamOrganizationsBulkRemove.Input) async throws -> Operations.EnterpriseTeamOrganizationsBulkRemove.Output + /// Get organization assignment + /// + /// Check if an enterprise team is assigned to an organization + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/get(enterprise-team-organizations/get-assignment)`. + func enterpriseTeamOrganizationsGetAssignment(_ input: Operations.EnterpriseTeamOrganizationsGetAssignment.Input) async throws -> Operations.EnterpriseTeamOrganizationsGetAssignment.Output + /// Add an organization assignment + /// + /// Assign an enterprise team to an organization. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/put(enterprise-team-organizations/add)`. + func enterpriseTeamOrganizationsAdd(_ input: Operations.EnterpriseTeamOrganizationsAdd.Input) async throws -> Operations.EnterpriseTeamOrganizationsAdd.Output + /// Delete an organization assignment + /// + /// Unassign an enterprise team from an organization. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/delete(enterprise-team-organizations/delete)`. + func enterpriseTeamOrganizationsDelete(_ input: Operations.EnterpriseTeamOrganizationsDelete.Input) async throws -> Operations.EnterpriseTeamOrganizationsDelete.Output +} + +/// Convenience overloads for operation inputs. +extension APIProtocol { + /// Get organization assignments + /// + /// Get all organizations assigned to an enterprise team + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/get(enterprise-team-organizations/get-assignments)`. + public func enterpriseTeamOrganizationsGetAssignments( + path: Operations.EnterpriseTeamOrganizationsGetAssignments.Input.Path, + query: Operations.EnterpriseTeamOrganizationsGetAssignments.Input.Query = .init(), + headers: Operations.EnterpriseTeamOrganizationsGetAssignments.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamOrganizationsGetAssignments.Output { + try await enterpriseTeamOrganizationsGetAssignments(Operations.EnterpriseTeamOrganizationsGetAssignments.Input( + path: path, + query: query, + headers: headers + )) + } + /// Add organization assignments + /// + /// Assign an enterprise team to multiple organizations. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/add/post(enterprise-team-organizations/bulk-add)`. + public func enterpriseTeamOrganizationsBulkAdd( + path: Operations.EnterpriseTeamOrganizationsBulkAdd.Input.Path, + headers: Operations.EnterpriseTeamOrganizationsBulkAdd.Input.Headers = .init(), + body: Operations.EnterpriseTeamOrganizationsBulkAdd.Input.Body + ) async throws -> Operations.EnterpriseTeamOrganizationsBulkAdd.Output { + try await enterpriseTeamOrganizationsBulkAdd(Operations.EnterpriseTeamOrganizationsBulkAdd.Input( + path: path, + headers: headers, + body: body + )) + } + /// Remove organization assignments + /// + /// Unassign an enterprise team from multiple organizations. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove/post(enterprise-team-organizations/bulk-remove)`. + public func enterpriseTeamOrganizationsBulkRemove( + path: Operations.EnterpriseTeamOrganizationsBulkRemove.Input.Path, + body: Operations.EnterpriseTeamOrganizationsBulkRemove.Input.Body + ) async throws -> Operations.EnterpriseTeamOrganizationsBulkRemove.Output { + try await enterpriseTeamOrganizationsBulkRemove(Operations.EnterpriseTeamOrganizationsBulkRemove.Input( + path: path, + body: body + )) + } + /// Get organization assignment + /// + /// Check if an enterprise team is assigned to an organization + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/get(enterprise-team-organizations/get-assignment)`. + public func enterpriseTeamOrganizationsGetAssignment( + path: Operations.EnterpriseTeamOrganizationsGetAssignment.Input.Path, + headers: Operations.EnterpriseTeamOrganizationsGetAssignment.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamOrganizationsGetAssignment.Output { + try await enterpriseTeamOrganizationsGetAssignment(Operations.EnterpriseTeamOrganizationsGetAssignment.Input( + path: path, + headers: headers + )) + } + /// Add an organization assignment + /// + /// Assign an enterprise team to an organization. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/put(enterprise-team-organizations/add)`. + public func enterpriseTeamOrganizationsAdd( + path: Operations.EnterpriseTeamOrganizationsAdd.Input.Path, + headers: Operations.EnterpriseTeamOrganizationsAdd.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamOrganizationsAdd.Output { + try await enterpriseTeamOrganizationsAdd(Operations.EnterpriseTeamOrganizationsAdd.Input( + path: path, + headers: headers + )) + } + /// Delete an organization assignment + /// + /// Unassign an enterprise team from an organization. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/delete(enterprise-team-organizations/delete)`. + public func enterpriseTeamOrganizationsDelete(path: Operations.EnterpriseTeamOrganizationsDelete.Input.Path) async throws -> Operations.EnterpriseTeamOrganizationsDelete.Output { + try await enterpriseTeamOrganizationsDelete(Operations.EnterpriseTeamOrganizationsDelete.Input(path: path)) + } +} + +/// 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 { + /// A GitHub organization. + /// + /// - Remark: Generated from `#/components/schemas/organization-simple`. + public struct OrganizationSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/organization-simple/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization-simple/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/repos_url`. + public var reposUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/hooks_url`. + public var hooksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/issues_url`. + public var issuesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/members_url`. + public var membersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/public_members_url`. + public var publicMembersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/avatar_url`. + public var avatarUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/description`. + public var description: Swift.String? + /// Creates a new `OrganizationSimple`. + /// + /// - Parameters: + /// - login: + /// - id: + /// - nodeId: + /// - url: + /// - reposUrl: + /// - eventsUrl: + /// - hooksUrl: + /// - issuesUrl: + /// - membersUrl: + /// - publicMembersUrl: + /// - avatarUrl: + /// - description: + public init( + login: Swift.String, + id: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + reposUrl: Swift.String, + eventsUrl: Swift.String, + hooksUrl: Swift.String, + issuesUrl: Swift.String, + membersUrl: Swift.String, + publicMembersUrl: Swift.String, + avatarUrl: Swift.String, + description: Swift.String? = nil + ) { + self.login = login + self.id = id + self.nodeId = nodeId + self.url = url + self.reposUrl = reposUrl + self.eventsUrl = eventsUrl + self.hooksUrl = hooksUrl + self.issuesUrl = issuesUrl + self.membersUrl = membersUrl + self.publicMembersUrl = publicMembersUrl + self.avatarUrl = avatarUrl + self.description = description + } + public enum CodingKeys: String, CodingKey { + case login + case id + case nodeId = "node_id" + case url + case reposUrl = "repos_url" + case eventsUrl = "events_url" + case hooksUrl = "hooks_url" + case issuesUrl = "issues_url" + case membersUrl = "members_url" + case publicMembersUrl = "public_members_url" + case avatarUrl = "avatar_url" + case description + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/components/parameters/per-page`. + public typealias PerPage = Swift.Int + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/components/parameters/page`. + public typealias Page = Swift.Int + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/components/parameters/enterprise`. + public typealias Enterprise = Swift.String + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/components/parameters/enterprise-team`. + public typealias EnterpriseTeam = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String + } + /// 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 { + /// Get organization assignments + /// + /// Get all organizations assigned to an enterprise team + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/get(enterprise-team-organizations/get-assignments)`. + public enum EnterpriseTeamOrganizationsGetAssignments { + public static let id: Swift.String = "enterprise-team-organizations/get-assignments" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/GET/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + } + } + public var path: Operations.EnterpriseTeamOrganizationsGetAssignments.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.EnterpriseTeamOrganizationsGetAssignments.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamOrganizationsGetAssignments.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.EnterpriseTeamOrganizationsGetAssignments.Input.Path, + query: Operations.EnterpriseTeamOrganizationsGetAssignments.Input.Query = .init(), + headers: Operations.EnterpriseTeamOrganizationsGetAssignments.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/GET/responses/200/content/application\/json`. + case json([Components.Schemas.OrganizationSimple]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.OrganizationSimple] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamOrganizationsGetAssignments.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamOrganizationsGetAssignments.Output.Ok.Body) { + self.body = body + } + } + /// An array of organizations the team is assigned to + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/get(enterprise-team-organizations/get-assignments)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamOrganizationsGetAssignments.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.EnterpriseTeamOrganizationsGetAssignments.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Add organization assignments + /// + /// Assign an enterprise team to multiple organizations. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/add/post(enterprise-team-organizations/bulk-add)`. + public enum EnterpriseTeamOrganizationsBulkAdd { + public static let id: Swift.String = "enterprise-team-organizations/bulk-add" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/add/POST/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/add/POST/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/add/POST/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + } + } + public var path: Operations.EnterpriseTeamOrganizationsBulkAdd.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/add/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamOrganizationsBulkAdd.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/add/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/add/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Organization slug to assign the team to. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/add/POST/requestBody/json/organization_slugs`. + public var organizationSlugs: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - organizationSlugs: Organization slug to assign the team to. + public init(organizationSlugs: [Swift.String]) { + self.organizationSlugs = organizationSlugs + } + public enum CodingKeys: String, CodingKey { + case organizationSlugs = "organization_slugs" + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/add/POST/requestBody/content/application\/json`. + case json(Operations.EnterpriseTeamOrganizationsBulkAdd.Input.Body.JsonPayload) + } + public var body: Operations.EnterpriseTeamOrganizationsBulkAdd.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.EnterpriseTeamOrganizationsBulkAdd.Input.Path, + headers: Operations.EnterpriseTeamOrganizationsBulkAdd.Input.Headers = .init(), + body: Operations.EnterpriseTeamOrganizationsBulkAdd.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/add/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/add/POST/responses/200/content/application\/json`. + case json([Components.Schemas.OrganizationSimple]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.OrganizationSimple] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamOrganizationsBulkAdd.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamOrganizationsBulkAdd.Output.Ok.Body) { + self.body = body + } + } + /// Successfully assigned the enterprise team to organizations. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/add/post(enterprise-team-organizations/bulk-add)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamOrganizationsBulkAdd.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.EnterpriseTeamOrganizationsBulkAdd.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Remove organization assignments + /// + /// Unassign an enterprise team from multiple organizations. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove/post(enterprise-team-organizations/bulk-remove)`. + public enum EnterpriseTeamOrganizationsBulkRemove { + public static let id: Swift.String = "enterprise-team-organizations/bulk-remove" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove/POST/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove/POST/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove/POST/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + } + } + public var path: Operations.EnterpriseTeamOrganizationsBulkRemove.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Organization slug to unassign the team from. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove/POST/requestBody/json/organization_slugs`. + public var organizationSlugs: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - organizationSlugs: Organization slug to unassign the team from. + public init(organizationSlugs: [Swift.String]) { + self.organizationSlugs = organizationSlugs + } + public enum CodingKeys: String, CodingKey { + case organizationSlugs = "organization_slugs" + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove/POST/requestBody/content/application\/json`. + case json(Operations.EnterpriseTeamOrganizationsBulkRemove.Input.Body.JsonPayload) + } + public var body: Operations.EnterpriseTeamOrganizationsBulkRemove.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.EnterpriseTeamOrganizationsBulkRemove.Input.Path, + body: Operations.EnterpriseTeamOrganizationsBulkRemove.Input.Body + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Successfully unassigned the enterprise team from organizations. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove/post(enterprise-team-organizations/bulk-remove)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.EnterpriseTeamOrganizationsBulkRemove.Output.NoContent) + /// Successfully unassigned the enterprise team from organizations. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove/post(enterprise-team-organizations/bulk-remove)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.EnterpriseTeamOrganizationsBulkRemove.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Get organization assignment + /// + /// Check if an enterprise team is assigned to an organization + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/get(enterprise-team-organizations/get-assignment)`. + public enum EnterpriseTeamOrganizationsGetAssignment { + public static let id: Swift.String = "enterprise-team-organizations/get-assignment" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/GET/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// - org: The organization name. The name is not case sensitive. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam, + org: Components.Parameters.Org + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + self.org = org + } + } + public var path: Operations.EnterpriseTeamOrganizationsGetAssignment.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamOrganizationsGetAssignment.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamOrganizationsGetAssignment.Input.Path, + headers: Operations.EnterpriseTeamOrganizationsGetAssignment.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.OrganizationSimple) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.OrganizationSimple { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamOrganizationsGetAssignment.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamOrganizationsGetAssignment.Output.Ok.Body) { + self.body = body + } + } + /// The team is assigned to the organization + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/get(enterprise-team-organizations/get-assignment)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamOrganizationsGetAssignment.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.EnterpriseTeamOrganizationsGetAssignment.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// The team is not assigned to the organization + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/get(enterprise-team-organizations/get-assignment)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.EnterpriseTeamOrganizationsGetAssignment.Output.NotFound) + /// The team is not assigned to the organization + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/get(enterprise-team-organizations/get-assignment)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.EnterpriseTeamOrganizationsGetAssignment.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Add an organization assignment + /// + /// Assign an enterprise team to an organization. + /// + /// - Remark: HTTP `PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/put(enterprise-team-organizations/add)`. + public enum EnterpriseTeamOrganizationsAdd { + public static let id: Swift.String = "enterprise-team-organizations/add" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/PUT/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/PUT/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/PUT/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// - org: The organization name. The name is not case sensitive. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam, + org: Components.Parameters.Org + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + self.org = org + } + } + public var path: Operations.EnterpriseTeamOrganizationsAdd.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamOrganizationsAdd.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamOrganizationsAdd.Input.Path, + headers: Operations.EnterpriseTeamOrganizationsAdd.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/PUT/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/PUT/responses/201/content/application\/json`. + case json(Components.Schemas.OrganizationSimple) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.OrganizationSimple { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamOrganizationsAdd.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamOrganizationsAdd.Output.Created.Body) { + self.body = body + } + } + /// Successfully assigned the enterprise team to the organization. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/put(enterprise-team-organizations/add)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.EnterpriseTeamOrganizationsAdd.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.EnterpriseTeamOrganizationsAdd.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete an organization assignment + /// + /// Unassign an enterprise team from an organization. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/delete(enterprise-team-organizations/delete)`. + public enum EnterpriseTeamOrganizationsDelete { + public static let id: Swift.String = "enterprise-team-organizations/delete" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/DELETE/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/DELETE/path/enterprise-team`. + public var enterpriseTeam: Components.Parameters.EnterpriseTeam + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - enterpriseTeam: The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. + /// - org: The organization name. The name is not case sensitive. + public init( + enterprise: Components.Parameters.Enterprise, + enterpriseTeam: Components.Parameters.EnterpriseTeam, + org: Components.Parameters.Org + ) { + self.enterprise = enterprise + self.enterpriseTeam = enterpriseTeam + self.org = org + } + } + public var path: Operations.EnterpriseTeamOrganizationsDelete.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.EnterpriseTeamOrganizationsDelete.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Successfully unassigned the enterprise team from the organization. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/delete(enterprise-team-organizations/delete)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.EnterpriseTeamOrganizationsDelete.Output.NoContent) + /// Successfully unassigned the enterprise team from the organization. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}/delete(enterprise-team-organizations/delete)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.EnterpriseTeamOrganizationsDelete.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } +} diff --git a/Sources/enterprise-teams/Client.swift b/Sources/enterprise-teams/Client.swift index 87202523ac7..ff723ec28ae 100644 --- a/Sources/enterprise-teams/Client.swift +++ b/Sources/enterprise-teams/Client.swift @@ -38,4 +38,453 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } + /// List enterprise teams + /// + /// List all teams in the enterprise for the authenticated user + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)`. + public func enterpriseTeamsList(_ input: Operations.EnterpriseTeamsList.Input) async throws -> Operations.EnterpriseTeamsList.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamsList.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams", + parameters: [ + input.path.enterprise + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.EnterpriseTeamsList.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamsList.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.EnterpriseTeam].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create an enterprise team + /// + /// To create an enterprise team, the authenticated user must be an owner of the enterprise. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/post(enterprise-teams/create)`. + public func enterpriseTeamsCreate(_ input: Operations.EnterpriseTeamsCreate.Input) async throws -> Operations.EnterpriseTeamsCreate.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamsCreate.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams", + parameters: [ + input.path.enterprise + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamsCreate.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.EnterpriseTeam.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get an enterprise team + /// + /// Gets a team using the team's slug. To create the slug, GitHub replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a `-` separator and adds the "ent:" prefix. For example, "My TEam Näme" would become `ent:my-team-name`. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)`. + public func enterpriseTeamsGet(_ input: Operations.EnterpriseTeamsGet.Input) async throws -> Operations.EnterpriseTeamsGet.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamsGet.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}", + parameters: [ + input.path.enterprise, + input.path.teamSlug + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.EnterpriseTeamsGet.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamsGet.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.EnterpriseTeam.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update an enterprise team + /// + /// To edit a team, the authenticated user must be an enterprise owner. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)`. + public func enterpriseTeamsUpdate(_ input: Operations.EnterpriseTeamsUpdate.Input) async throws -> Operations.EnterpriseTeamsUpdate.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamsUpdate.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}", + parameters: [ + input.path.enterprise, + input.path.teamSlug + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.EnterpriseTeamsUpdate.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.EnterpriseTeamsUpdate.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.EnterpriseTeam.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete an enterprise team + /// + /// To delete an enterprise team, the authenticated user must be an enterprise owner. + /// + /// If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)`. + public func enterpriseTeamsDelete(_ input: Operations.EnterpriseTeamsDelete.Input) async throws -> Operations.EnterpriseTeamsDelete.Output { + try await client.send( + input: input, + forOperation: Operations.EnterpriseTeamsDelete.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/teams/{}", + parameters: [ + input.path.enterprise, + input.path.teamSlug + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } } diff --git a/Sources/enterprise-teams/Types.swift b/Sources/enterprise-teams/Types.swift index c3d1209ecf5..aa064f3ebc1 100644 --- a/Sources/enterprise-teams/Types.swift +++ b/Sources/enterprise-teams/Types.swift @@ -10,10 +10,131 @@ import struct Foundation.Data import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. -public protocol APIProtocol: Sendable {} +public protocol APIProtocol: Sendable { + /// List enterprise teams + /// + /// List all teams in the enterprise for the authenticated user + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)`. + func enterpriseTeamsList(_ input: Operations.EnterpriseTeamsList.Input) async throws -> Operations.EnterpriseTeamsList.Output + /// Create an enterprise team + /// + /// To create an enterprise team, the authenticated user must be an owner of the enterprise. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/post(enterprise-teams/create)`. + func enterpriseTeamsCreate(_ input: Operations.EnterpriseTeamsCreate.Input) async throws -> Operations.EnterpriseTeamsCreate.Output + /// Get an enterprise team + /// + /// Gets a team using the team's slug. To create the slug, GitHub replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a `-` separator and adds the "ent:" prefix. For example, "My TEam Näme" would become `ent:my-team-name`. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)`. + func enterpriseTeamsGet(_ input: Operations.EnterpriseTeamsGet.Input) async throws -> Operations.EnterpriseTeamsGet.Output + /// Update an enterprise team + /// + /// To edit a team, the authenticated user must be an enterprise owner. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)`. + func enterpriseTeamsUpdate(_ input: Operations.EnterpriseTeamsUpdate.Input) async throws -> Operations.EnterpriseTeamsUpdate.Output + /// Delete an enterprise team + /// + /// To delete an enterprise team, the authenticated user must be an enterprise owner. + /// + /// If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)`. + func enterpriseTeamsDelete(_ input: Operations.EnterpriseTeamsDelete.Input) async throws -> Operations.EnterpriseTeamsDelete.Output +} /// Convenience overloads for operation inputs. extension APIProtocol { + /// List enterprise teams + /// + /// List all teams in the enterprise for the authenticated user + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)`. + public func enterpriseTeamsList( + path: Operations.EnterpriseTeamsList.Input.Path, + query: Operations.EnterpriseTeamsList.Input.Query = .init(), + headers: Operations.EnterpriseTeamsList.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamsList.Output { + try await enterpriseTeamsList(Operations.EnterpriseTeamsList.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create an enterprise team + /// + /// To create an enterprise team, the authenticated user must be an owner of the enterprise. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/post(enterprise-teams/create)`. + public func enterpriseTeamsCreate( + path: Operations.EnterpriseTeamsCreate.Input.Path, + headers: Operations.EnterpriseTeamsCreate.Input.Headers = .init(), + body: Operations.EnterpriseTeamsCreate.Input.Body + ) async throws -> Operations.EnterpriseTeamsCreate.Output { + try await enterpriseTeamsCreate(Operations.EnterpriseTeamsCreate.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get an enterprise team + /// + /// Gets a team using the team's slug. To create the slug, GitHub replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a `-` separator and adds the "ent:" prefix. For example, "My TEam Näme" would become `ent:my-team-name`. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)`. + public func enterpriseTeamsGet( + path: Operations.EnterpriseTeamsGet.Input.Path, + headers: Operations.EnterpriseTeamsGet.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamsGet.Output { + try await enterpriseTeamsGet(Operations.EnterpriseTeamsGet.Input( + path: path, + headers: headers + )) + } + /// Update an enterprise team + /// + /// To edit a team, the authenticated user must be an enterprise owner. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)`. + public func enterpriseTeamsUpdate( + path: Operations.EnterpriseTeamsUpdate.Input.Path, + headers: Operations.EnterpriseTeamsUpdate.Input.Headers = .init(), + body: Operations.EnterpriseTeamsUpdate.Input.Body + ) async throws -> Operations.EnterpriseTeamsUpdate.Output { + try await enterpriseTeamsUpdate(Operations.EnterpriseTeamsUpdate.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete an enterprise team + /// + /// To delete an enterprise team, the authenticated user must be an enterprise owner. + /// + /// If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)`. + public func enterpriseTeamsDelete( + path: Operations.EnterpriseTeamsDelete.Input.Path, + headers: Operations.EnterpriseTeamsDelete.Input.Headers = .init() + ) async throws -> Operations.EnterpriseTeamsDelete.Output { + try await enterpriseTeamsDelete(Operations.EnterpriseTeamsDelete.Input( + path: path, + headers: headers + )) + } } /// Server URLs defined in the OpenAPI document. @@ -38,16 +159,1226 @@ public enum Servers { /// 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 {} + public enum Schemas { + /// Basic Error + /// + /// - Remark: Generated from `#/components/schemas/basic-error`. + public struct BasicError: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/basic-error/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/status`. + public var status: Swift.String? + /// Creates a new `BasicError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - url: + /// - status: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + url: Swift.String? = nil, + status: Swift.String? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.url = url + self.status = status + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case url + case status + } + } + /// Group of enterprise owners and/or members + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team`. + public struct EnterpriseTeam: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/enterprise-team/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/enterprise-team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/url`. + public var url: Swift.String + /// Retired: this field will not be returned with GHEC enterprise teams. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/sync_to_organizations`. + public var syncToOrganizations: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/organization_selection_type`. + public var organizationSelectionType: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_id`. + public var groupId: Swift.String? + /// Retired: this field will not be returned with GHEC enterprise teams. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/group_name`. + public var groupName: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise-team/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/members_url`. + public var membersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise-team/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `EnterpriseTeam`. + /// + /// - Parameters: + /// - id: + /// - name: + /// - description: + /// - slug: + /// - url: + /// - syncToOrganizations: Retired: this field will not be returned with GHEC enterprise teams. + /// - organizationSelectionType: + /// - groupId: + /// - groupName: Retired: this field will not be returned with GHEC enterprise teams. + /// - htmlUrl: + /// - membersUrl: + /// - createdAt: + /// - updatedAt: + public init( + id: Swift.Int64, + name: Swift.String, + description: Swift.String? = nil, + slug: Swift.String, + url: Swift.String, + syncToOrganizations: Swift.String? = nil, + organizationSelectionType: Swift.String? = nil, + groupId: Swift.String? = nil, + groupName: Swift.String? = nil, + htmlUrl: Swift.String, + membersUrl: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.id = id + self.name = name + self.description = description + self.slug = slug + self.url = url + self.syncToOrganizations = syncToOrganizations + self.organizationSelectionType = organizationSelectionType + self.groupId = groupId + self.groupName = groupName + self.htmlUrl = htmlUrl + self.membersUrl = membersUrl + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case name + case description + case slug + case url + case syncToOrganizations = "sync_to_organizations" + case organizationSelectionType = "organization_selection_type" + case groupId = "group_id" + case groupName = "group_name" + case htmlUrl = "html_url" + case membersUrl = "members_url" + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + } /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters {} + public enum Parameters { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/components/parameters/per-page`. + public typealias PerPage = Swift.Int + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/components/parameters/page`. + public typealias Page = Swift.Int + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/components/parameters/enterprise`. + public typealias Enterprise = Swift.String + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias TeamSlug = Swift.String + } /// 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 {} + public enum Responses { + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Forbidden.Body) { + self.body = body + } + } + } /// Types generated from the `#/components/headers` section of the OpenAPI document. - public enum Headers {} + public enum Headers { + /// - Remark: Generated from `#/components/headers/link`. + public typealias Link = Swift.String + } } /// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations {} +public enum Operations { + /// List enterprise teams + /// + /// List all teams in the enterprise for the authenticated user + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)`. + public enum EnterpriseTeamsList { + public static let id: Swift.String = "enterprise-teams/list" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.EnterpriseTeamsList.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.EnterpriseTeamsList.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamsList.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.EnterpriseTeamsList.Input.Path, + query: Operations.EnterpriseTeamsList.Input.Query = .init(), + headers: Operations.EnterpriseTeamsList.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.EnterpriseTeamsList.Output.Ok.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/GET/responses/200/content/application\/json`. + case json([Components.Schemas.EnterpriseTeam]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.EnterpriseTeam] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamsList.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.EnterpriseTeamsList.Output.Ok.Headers = .init(), + body: Operations.EnterpriseTeamsList.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamsList.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.EnterpriseTeamsList.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/get(enterprise-teams/list)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create an enterprise team + /// + /// To create an enterprise team, the authenticated user must be an owner of the enterprise. + /// + /// - Remark: HTTP `POST /enterprises/{enterprise}/teams`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/post(enterprise-teams/create)`. + public enum EnterpriseTeamsCreate { + public static let id: Swift.String = "enterprise-teams/create" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.EnterpriseTeamsCreate.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamsCreate.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/name`. + public var name: Swift.String + /// A description of the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/description`. + public var description: Swift.String? + /// Retired: this field is no longer supported. + /// Whether the enterprise team should be reflected in each organization. + /// This value cannot be set. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/sync_to_organizations`. + @frozen public enum SyncToOrganizationsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case disabled = "disabled" + } + /// Retired: this field is no longer supported. + /// Whether the enterprise team should be reflected in each organization. + /// This value cannot be set. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/sync_to_organizations`. + public var syncToOrganizations: Operations.EnterpriseTeamsCreate.Input.Body.JsonPayload.SyncToOrganizationsPayload? + /// Specifies which organizations in the enterprise should have access to this team. Can be one of `disabled`, `selected`, or `all`. + /// `disabled`: The team is not assigned to any organizations. This is the default when you create a new team. + /// `selected`: The team is assigned to specific organizations. You can then use the [add organization assignments API](https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#add-organization-assignments) endpoint. + /// `all`: The team is assigned to all current and future organizations in the enterprise. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/organization_selection_type`. + @frozen public enum OrganizationSelectionTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case disabled = "disabled" + case selected = "selected" + case all = "all" + } + /// Specifies which organizations in the enterprise should have access to this team. Can be one of `disabled`, `selected`, or `all`. + /// `disabled`: The team is not assigned to any organizations. This is the default when you create a new team. + /// `selected`: The team is assigned to specific organizations. You can then use the [add organization assignments API](https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#add-organization-assignments) endpoint. + /// `all`: The team is assigned to all current and future organizations in the enterprise. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/organization_selection_type`. + public var organizationSelectionType: Operations.EnterpriseTeamsCreate.Input.Body.JsonPayload.OrganizationSelectionTypePayload? + /// The ID of the IdP group to assign team membership with. You can get this value from the [REST API endpoints for SCIM](https://docs.github.com/rest/scim#list-provisioned-scim-groups-for-an-enterprise). + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/group_id`. + public var groupId: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the team. + /// - description: A description of the team. + /// - syncToOrganizations: Retired: this field is no longer supported. + /// - organizationSelectionType: Specifies which organizations in the enterprise should have access to this team. Can be one of `disabled`, `selected`, or `all`. + /// - groupId: The ID of the IdP group to assign team membership with. You can get this value from the [REST API endpoints for SCIM](https://docs.github.com/rest/scim#list-provisioned-scim-groups-for-an-enterprise). + public init( + name: Swift.String, + description: Swift.String? = nil, + syncToOrganizations: Operations.EnterpriseTeamsCreate.Input.Body.JsonPayload.SyncToOrganizationsPayload? = nil, + organizationSelectionType: Operations.EnterpriseTeamsCreate.Input.Body.JsonPayload.OrganizationSelectionTypePayload? = nil, + groupId: Swift.String? = nil + ) { + self.name = name + self.description = description + self.syncToOrganizations = syncToOrganizations + self.organizationSelectionType = organizationSelectionType + self.groupId = groupId + } + public enum CodingKeys: String, CodingKey { + case name + case description + case syncToOrganizations = "sync_to_organizations" + case organizationSelectionType = "organization_selection_type" + case groupId = "group_id" + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/content/application\/json`. + case json(Operations.EnterpriseTeamsCreate.Input.Body.JsonPayload) + } + public var body: Operations.EnterpriseTeamsCreate.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.EnterpriseTeamsCreate.Input.Path, + headers: Operations.EnterpriseTeamsCreate.Input.Headers = .init(), + body: Operations.EnterpriseTeamsCreate.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/responses/201/content/application\/json`. + case json(Components.Schemas.EnterpriseTeam) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.EnterpriseTeam { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamsCreate.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.EnterpriseTeamsCreate.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/post(enterprise-teams/create)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.EnterpriseTeamsCreate.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.EnterpriseTeamsCreate.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get an enterprise team + /// + /// Gets a team using the team's slug. To create the slug, GitHub replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a `-` separator and adds the "ent:" prefix. For example, "My TEam Näme" would become `ent:my-team-name`. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)`. + public enum EnterpriseTeamsGet { + public static let id: Swift.String = "enterprise-teams/get" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug of the team name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/path/team_slug`. + public var teamSlug: Components.Parameters.TeamSlug + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - teamSlug: The slug of the team name. + public init( + enterprise: Components.Parameters.Enterprise, + teamSlug: Components.Parameters.TeamSlug + ) { + self.enterprise = enterprise + self.teamSlug = teamSlug + } + } + public var path: Operations.EnterpriseTeamsGet.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamsGet.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamsGet.Input.Path, + headers: Operations.EnterpriseTeamsGet.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.EnterpriseTeamsGet.Output.Ok.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.EnterpriseTeam) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.EnterpriseTeam { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamsGet.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.EnterpriseTeamsGet.Output.Ok.Headers = .init(), + body: Operations.EnterpriseTeamsGet.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamsGet.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.EnterpriseTeamsGet.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/get(enterprise-teams/get)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update an enterprise team + /// + /// To edit a team, the authenticated user must be an enterprise owner. + /// + /// - Remark: HTTP `PATCH /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)`. + public enum EnterpriseTeamsUpdate { + public static let id: Swift.String = "enterprise-teams/update" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug of the team name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/path/team_slug`. + public var teamSlug: Components.Parameters.TeamSlug + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - teamSlug: The slug of the team name. + public init( + enterprise: Components.Parameters.Enterprise, + teamSlug: Components.Parameters.TeamSlug + ) { + self.enterprise = enterprise + self.teamSlug = teamSlug + } + } + public var path: Operations.EnterpriseTeamsUpdate.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamsUpdate.Input.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// A new name for the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// A new description for the team. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/description`. + public var description: Swift.String? + /// Retired: this field is no longer supported. + /// Whether the enterprise team should be reflected in each organization. + /// This value cannot be changed. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/sync_to_organizations`. + @frozen public enum SyncToOrganizationsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case disabled = "disabled" + } + /// Retired: this field is no longer supported. + /// Whether the enterprise team should be reflected in each organization. + /// This value cannot be changed. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/sync_to_organizations`. + public var syncToOrganizations: Operations.EnterpriseTeamsUpdate.Input.Body.JsonPayload.SyncToOrganizationsPayload? + /// Specifies which organizations in the enterprise should have access to this team. Can be one of `disabled`, `selected`, or `all`. + /// `disabled`: The team is not assigned to any organizations. This is the default when you create a new team. + /// `selected`: The team is assigned to specific organizations. You can then use the [add organization assignments API](https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#add-organization-assignments). + /// `all`: The team is assigned to all current and future organizations in the enterprise. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/organization_selection_type`. + @frozen public enum OrganizationSelectionTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case disabled = "disabled" + case selected = "selected" + case all = "all" + } + /// Specifies which organizations in the enterprise should have access to this team. Can be one of `disabled`, `selected`, or `all`. + /// `disabled`: The team is not assigned to any organizations. This is the default when you create a new team. + /// `selected`: The team is assigned to specific organizations. You can then use the [add organization assignments API](https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#add-organization-assignments). + /// `all`: The team is assigned to all current and future organizations in the enterprise. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/organization_selection_type`. + public var organizationSelectionType: Operations.EnterpriseTeamsUpdate.Input.Body.JsonPayload.OrganizationSelectionTypePayload? + /// The ID of the IdP group to assign team membership with. The new IdP group will replace the existing one, or replace existing direct members if the team isn't currently linked to an IdP group. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/group_id`. + public var groupId: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: A new name for the team. + /// - description: A new description for the team. + /// - syncToOrganizations: Retired: this field is no longer supported. + /// - organizationSelectionType: Specifies which organizations in the enterprise should have access to this team. Can be one of `disabled`, `selected`, or `all`. + /// - groupId: The ID of the IdP group to assign team membership with. The new IdP group will replace the existing one, or replace existing direct members if the team isn't currently linked to an IdP group. + public init( + name: Swift.String? = nil, + description: Swift.String? = nil, + syncToOrganizations: Operations.EnterpriseTeamsUpdate.Input.Body.JsonPayload.SyncToOrganizationsPayload? = nil, + organizationSelectionType: Operations.EnterpriseTeamsUpdate.Input.Body.JsonPayload.OrganizationSelectionTypePayload? = nil, + groupId: Swift.String? = nil + ) { + self.name = name + self.description = description + self.syncToOrganizations = syncToOrganizations + self.organizationSelectionType = organizationSelectionType + self.groupId = groupId + } + public enum CodingKeys: String, CodingKey { + case name + case description + case syncToOrganizations = "sync_to_organizations" + case organizationSelectionType = "organization_selection_type" + case groupId = "group_id" + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/content/application\/json`. + case json(Operations.EnterpriseTeamsUpdate.Input.Body.JsonPayload) + } + public var body: Operations.EnterpriseTeamsUpdate.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.EnterpriseTeamsUpdate.Input.Path, + headers: Operations.EnterpriseTeamsUpdate.Input.Headers = .init(), + body: Operations.EnterpriseTeamsUpdate.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.EnterpriseTeamsUpdate.Output.Ok.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.EnterpriseTeam) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.EnterpriseTeam { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.EnterpriseTeamsUpdate.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.EnterpriseTeamsUpdate.Output.Ok.Headers = .init(), + body: Operations.EnterpriseTeamsUpdate.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.EnterpriseTeamsUpdate.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.EnterpriseTeamsUpdate.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/patch(enterprise-teams/update)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete an enterprise team + /// + /// To delete an enterprise team, the authenticated user must be an enterprise owner. + /// + /// If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well. + /// + /// - Remark: HTTP `DELETE /enterprises/{enterprise}/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)`. + public enum EnterpriseTeamsDelete { + public static let id: Swift.String = "enterprise-teams/delete" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/DELETE/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// The slug of the team name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/DELETE/path/team_slug`. + public var teamSlug: Components.Parameters.TeamSlug + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + /// - teamSlug: The slug of the team name. + public init( + enterprise: Components.Parameters.Enterprise, + teamSlug: Components.Parameters.TeamSlug + ) { + self.enterprise = enterprise + self.teamSlug = teamSlug + } + } + public var path: Operations.EnterpriseTeamsDelete.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.EnterpriseTeamsDelete.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.EnterpriseTeamsDelete.Input.Path, + headers: Operations.EnterpriseTeamsDelete.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.EnterpriseTeamsDelete.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.EnterpriseTeamsDelete.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/teams/{team_slug}/delete(enterprise-teams/delete)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } +} diff --git a/Sources/gists/Types.swift b/Sources/gists/Types.swift index 9165a2da328..1195d3d8244 100644 --- a/Sources/gists/Types.swift +++ b/Sources/gists/Types.swift @@ -2437,6 +2437,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/since`. public typealias Since = Foundation.Date + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// The unique identifier of the gist. /// /// - Remark: Generated from `#/components/parameters/gist-id`. @@ -2445,10 +2449,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/comment-id`. public typealias CommentId = Swift.Int64 - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} diff --git a/Sources/interactions/Types.swift b/Sources/interactions/Types.swift index 43900c98f74..db325da1641 100644 --- a/Sources/interactions/Types.swift +++ b/Sources/interactions/Types.swift @@ -420,6 +420,10 @@ public enum Components { } /// Types generated from the `#/components/parameters` section of the OpenAPI document. public enum Parameters { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -428,10 +432,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repo`. public typealias Repo = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} diff --git a/Sources/issues/Client.swift b/Sources/issues/Client.swift index 652329b744b..594e66de241 100644 --- a/Sources/issues/Client.swift +++ b/Sources/issues/Client.swift @@ -2630,6 +2630,750 @@ public struct Client: APIProtocol { } ) } + /// List dependencies an issue is blocked by + /// + /// You can use the REST API to list the dependencies an issue is blocked by. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)`. + public func issuesListDependenciesBlockedBy(_ input: Operations.IssuesListDependenciesBlockedBy.Input) async throws -> Operations.IssuesListDependenciesBlockedBy.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesListDependenciesBlockedBy.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/dependencies/blocked_by", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.Issue].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 301: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.MovedPermanently.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .movedPermanently(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add a dependency an issue is blocked by + /// + /// You can use the REST API to add a 'blocked by' relationship to an issue. + /// + /// Creating content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see [Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits) + /// and [Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)`. + public func issuesAddBlockedByDependency(_ input: Operations.IssuesAddBlockedByDependency.Input) async throws -> Operations.IssuesAddBlockedByDependency.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesAddBlockedByDependency.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/dependencies/blocked_by", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let headers: Operations.IssuesAddBlockedByDependency.Output.Created.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Location", + as: Swift.String.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesAddBlockedByDependency.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Issue.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init( + headers: headers, + body: body + )) + case 301: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.MovedPermanently.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .movedPermanently(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove dependency an issue is blocked by + /// + /// You can use the REST API to remove a dependency that an issue is blocked by. + /// + /// Removing content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see [Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits) + /// and [Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)`. + public func issuesRemoveDependencyBlockedBy(_ input: Operations.IssuesRemoveDependencyBlockedBy.Input) async throws -> Operations.IssuesRemoveDependencyBlockedBy.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesRemoveDependencyBlockedBy.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/dependencies/blocked_by/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber, + input.path.issueId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesRemoveDependencyBlockedBy.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Issue.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 301: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.MovedPermanently.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .movedPermanently(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List dependencies an issue is blocking + /// + /// You can use the REST API to list the dependencies an issue is blocking. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)`. + public func issuesListDependenciesBlocking(_ input: Operations.IssuesListDependenciesBlocking.Input) async throws -> Operations.IssuesListDependenciesBlocking.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesListDependenciesBlocking.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/dependencies/blocking", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.IssuesListDependenciesBlocking.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesListDependenciesBlocking.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.Issue].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 301: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.MovedPermanently.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .movedPermanently(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// List issue events /// /// Lists all events for an issue. @@ -3706,6 +4450,145 @@ public struct Client: APIProtocol { } ) } + /// Get parent issue + /// + /// You can use the REST API to get the parent issue of a sub-issue. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/parent`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)`. + public func issuesGetParent(_ input: Operations.IssuesGetParent.Input) async throws -> Operations.IssuesGetParent.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesGetParent.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/parent", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesGetParent.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Issue.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 301: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.MovedPermanently.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .movedPermanently(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Remove sub-issue /// /// You can use the REST API to remove a sub-issue from an issue. @@ -3854,11 +4737,11 @@ public struct Client: APIProtocol { /// /// You can use the REST API to list the sub-issues on an issue. /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index 98e1908748b..0f5a480e99b 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -260,6 +260,69 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/comments`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/post(issues/create-comment)`. func issuesCreateComment(_ input: Operations.IssuesCreateComment.Input) async throws -> Operations.IssuesCreateComment.Output + /// List dependencies an issue is blocked by + /// + /// You can use the REST API to list the dependencies an issue is blocked by. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)`. + func issuesListDependenciesBlockedBy(_ input: Operations.IssuesListDependenciesBlockedBy.Input) async throws -> Operations.IssuesListDependenciesBlockedBy.Output + /// Add a dependency an issue is blocked by + /// + /// You can use the REST API to add a 'blocked by' relationship to an issue. + /// + /// Creating content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see [Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits) + /// and [Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)`. + func issuesAddBlockedByDependency(_ input: Operations.IssuesAddBlockedByDependency.Input) async throws -> Operations.IssuesAddBlockedByDependency.Output + /// Remove dependency an issue is blocked by + /// + /// You can use the REST API to remove a dependency that an issue is blocked by. + /// + /// Removing content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see [Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits) + /// and [Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)`. + func issuesRemoveDependencyBlockedBy(_ input: Operations.IssuesRemoveDependencyBlockedBy.Input) async throws -> Operations.IssuesRemoveDependencyBlockedBy.Output + /// List dependencies an issue is blocking + /// + /// You can use the REST API to list the dependencies an issue is blocking. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)`. + func issuesListDependenciesBlocking(_ input: Operations.IssuesListDependenciesBlocking.Input) async throws -> Operations.IssuesListDependenciesBlocking.Output /// List issue events /// /// Lists all events for an issue. @@ -318,6 +381,20 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)`. func issuesUnlock(_ input: Operations.IssuesUnlock.Input) async throws -> Operations.IssuesUnlock.Output + /// Get parent issue + /// + /// You can use the REST API to get the parent issue of a sub-issue. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/parent`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)`. + func issuesGetParent(_ input: Operations.IssuesGetParent.Input) async throws -> Operations.IssuesGetParent.Output /// Remove sub-issue /// /// You can use the REST API to remove a sub-issue from an issue. @@ -337,11 +414,11 @@ public protocol APIProtocol: Sendable { /// /// You can use the REST API to list the sub-issues on an issue. /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. @@ -896,6 +973,107 @@ extension APIProtocol { body: body )) } + /// List dependencies an issue is blocked by + /// + /// You can use the REST API to list the dependencies an issue is blocked by. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)`. + public func issuesListDependenciesBlockedBy( + path: Operations.IssuesListDependenciesBlockedBy.Input.Path, + query: Operations.IssuesListDependenciesBlockedBy.Input.Query = .init(), + headers: Operations.IssuesListDependenciesBlockedBy.Input.Headers = .init() + ) async throws -> Operations.IssuesListDependenciesBlockedBy.Output { + try await issuesListDependenciesBlockedBy(Operations.IssuesListDependenciesBlockedBy.Input( + path: path, + query: query, + headers: headers + )) + } + /// Add a dependency an issue is blocked by + /// + /// You can use the REST API to add a 'blocked by' relationship to an issue. + /// + /// Creating content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see [Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits) + /// and [Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)`. + public func issuesAddBlockedByDependency( + path: Operations.IssuesAddBlockedByDependency.Input.Path, + headers: Operations.IssuesAddBlockedByDependency.Input.Headers = .init(), + body: Operations.IssuesAddBlockedByDependency.Input.Body + ) async throws -> Operations.IssuesAddBlockedByDependency.Output { + try await issuesAddBlockedByDependency(Operations.IssuesAddBlockedByDependency.Input( + path: path, + headers: headers, + body: body + )) + } + /// Remove dependency an issue is blocked by + /// + /// You can use the REST API to remove a dependency that an issue is blocked by. + /// + /// Removing content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see [Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits) + /// and [Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)`. + public func issuesRemoveDependencyBlockedBy( + path: Operations.IssuesRemoveDependencyBlockedBy.Input.Path, + headers: Operations.IssuesRemoveDependencyBlockedBy.Input.Headers = .init() + ) async throws -> Operations.IssuesRemoveDependencyBlockedBy.Output { + try await issuesRemoveDependencyBlockedBy(Operations.IssuesRemoveDependencyBlockedBy.Input( + path: path, + headers: headers + )) + } + /// List dependencies an issue is blocking + /// + /// You can use the REST API to list the dependencies an issue is blocking. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)`. + public func issuesListDependenciesBlocking( + path: Operations.IssuesListDependenciesBlocking.Input.Path, + query: Operations.IssuesListDependenciesBlocking.Input.Query = .init(), + headers: Operations.IssuesListDependenciesBlocking.Input.Headers = .init() + ) async throws -> Operations.IssuesListDependenciesBlocking.Output { + try await issuesListDependenciesBlocking(Operations.IssuesListDependenciesBlocking.Input( + path: path, + query: query, + headers: headers + )) + } /// List issue events /// /// Lists all events for an issue. @@ -1028,6 +1206,28 @@ extension APIProtocol { headers: headers )) } + /// Get parent issue + /// + /// You can use the REST API to get the parent issue of a sub-issue. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/parent`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)`. + public func issuesGetParent( + path: Operations.IssuesGetParent.Input.Path, + headers: Operations.IssuesGetParent.Input.Headers = .init() + ) async throws -> Operations.IssuesGetParent.Output { + try await issuesGetParent(Operations.IssuesGetParent.Input( + path: path, + headers: headers + )) + } /// Remove sub-issue /// /// You can use the REST API to remove a sub-issue from an issue. @@ -1057,11 +1257,11 @@ extension APIProtocol { /// /// You can use the REST API to list the sub-issues on an issue. /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. @@ -1831,20 +2031,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/integration/permissions`. public var permissions: Components.Schemas.Integration.PermissionsPayload - /// The list of events for the GitHub app + /// The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. /// /// - Remark: Generated from `#/components/schemas/integration/events`. public var events: [Swift.String] - /// The number of installations associated with the GitHub app + /// The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. /// /// - Remark: Generated from `#/components/schemas/integration/installations_count`. public var installationsCount: Swift.Int? - /// - Remark: Generated from `#/components/schemas/integration/client_secret`. - public var clientSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/integration/webhook_secret`. - public var webhookSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/integration/pem`. - public var pem: Swift.String? /// Creates a new `Integration`. /// /// - Parameters: @@ -1860,11 +2054,8 @@ public enum Components { /// - createdAt: /// - updatedAt: /// - permissions: The set of permissions for the GitHub app - /// - events: The list of events for the GitHub app - /// - installationsCount: The number of installations associated with the GitHub app - /// - clientSecret: - /// - webhookSecret: - /// - pem: + /// - events: The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. + /// - installationsCount: The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. public init( id: Swift.Int, slug: Swift.String? = nil, @@ -1879,10 +2070,7 @@ public enum Components { updatedAt: Foundation.Date, permissions: Components.Schemas.Integration.PermissionsPayload, events: [Swift.String], - installationsCount: Swift.Int? = nil, - clientSecret: Swift.String? = nil, - webhookSecret: Swift.String? = nil, - pem: Swift.String? = nil + installationsCount: Swift.Int? = nil ) { self.id = id self.slug = slug @@ -1898,9 +2086,6 @@ public enum Components { self.permissions = permissions self.events = events self.installationsCount = installationsCount - self.clientSecret = clientSecret - self.webhookSecret = webhookSecret - self.pem = pem } public enum CodingKeys: String, CodingKey { case id @@ -1917,9 +2102,6 @@ public enum Components { case permissions case events case installationsCount = "installations_count" - case clientSecret = "client_secret" - case webhookSecret = "webhook_secret" - case pem } } /// Scim Error @@ -2641,6 +2823,35 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/anonymous_access_enabled`. public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? /// Creates a new `Repository`. /// /// - Parameters: @@ -2739,6 +2950,7 @@ public enum Components { /// - masterBranch: /// - starredAt: /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository public init( id: Swift.Int64, nodeId: Swift.String, @@ -2834,7 +3046,8 @@ public enum Components { watchers: Swift.Int, masterBranch: Swift.String? = nil, starredAt: Swift.String? = nil, - anonymousAccessEnabled: Swift.Bool? = nil + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -2931,6 +3144,7 @@ public enum Components { self.masterBranch = masterBranch self.starredAt = starredAt self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus } public enum CodingKeys: String, CodingKey { case id @@ -3028,6 +3242,7 @@ public enum Components { case masterBranch = "master_branch" case starredAt = "starred_at" case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" } } /// A collection of related issues and pull requests. @@ -3415,20 +3630,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. public var permissions: Components.Schemas.NullableIntegration.PermissionsPayload - /// The list of events for the GitHub app + /// The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. /// /// - Remark: Generated from `#/components/schemas/nullable-integration/events`. public var events: [Swift.String] - /// The number of installations associated with the GitHub app + /// The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. /// /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. public var installationsCount: Swift.Int? - /// - Remark: Generated from `#/components/schemas/nullable-integration/client_secret`. - public var clientSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/webhook_secret`. - public var webhookSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/pem`. - public var pem: Swift.String? /// Creates a new `NullableIntegration`. /// /// - Parameters: @@ -3444,11 +3653,8 @@ public enum Components { /// - createdAt: /// - updatedAt: /// - permissions: The set of permissions for the GitHub app - /// - events: The list of events for the GitHub app - /// - installationsCount: The number of installations associated with the GitHub app - /// - clientSecret: - /// - webhookSecret: - /// - pem: + /// - events: The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. + /// - installationsCount: The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. public init( id: Swift.Int, slug: Swift.String? = nil, @@ -3463,10 +3669,7 @@ public enum Components { updatedAt: Foundation.Date, permissions: Components.Schemas.NullableIntegration.PermissionsPayload, events: [Swift.String], - installationsCount: Swift.Int? = nil, - clientSecret: Swift.String? = nil, - webhookSecret: Swift.String? = nil, - pem: Swift.String? = nil + installationsCount: Swift.Int? = nil ) { self.id = id self.slug = slug @@ -3482,9 +3685,6 @@ public enum Components { self.permissions = permissions self.events = events self.installationsCount = installationsCount - self.clientSecret = clientSecret - self.webhookSecret = webhookSecret - self.pem = pem } public enum CodingKeys: String, CodingKey { case id @@ -3501,9 +3701,6 @@ public enum Components { case permissions case events case installationsCount = "installations_count" - case clientSecret = "client_secret" - case webhookSecret = "webhook_secret" - case pem } } /// How the author is associated with the repository. @@ -3619,6 +3816,199 @@ public enum Components { case percentCompleted = "percent_completed" } } + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary`. + public struct IssueDependenciesSummary: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocked_by`. + public var blockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocking`. + public var blocking: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocked_by`. + public var totalBlockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocking`. + public var totalBlocking: Swift.Int + /// Creates a new `IssueDependenciesSummary`. + /// + /// - Parameters: + /// - blockedBy: + /// - blocking: + /// - totalBlockedBy: + /// - totalBlocking: + public init( + blockedBy: Swift.Int, + blocking: Swift.Int, + totalBlockedBy: Swift.Int, + totalBlocking: Swift.Int + ) { + self.blockedBy = blockedBy + self.blocking = blocking + self.totalBlockedBy = totalBlockedBy + self.totalBlocking = totalBlocking + } + public enum CodingKeys: String, CodingKey { + case blockedBy = "blocked_by" + case blocking + case totalBlockedBy = "total_blocked_by" + case totalBlocking = "total_blocking" + } + } + /// A value assigned to an issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value`. + public struct IssueFieldValue: Codable, Hashable, Sendable { + /// Unique identifier for the issue field. + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/issue_field_id`. + public var issueFieldId: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/issue-field-value/node_id`. + public var nodeId: Swift.String + /// The data type of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case text = "text" + case singleSelect = "single_select" + case number = "number" + case date = "date" + } + /// The data type of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/data_type`. + public var dataType: Components.Schemas.IssueFieldValue.DataTypePayload + /// The value of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/value`. + public struct ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value1`. + public var value1: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value2`. + public var value2: Swift.Double? + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value3`. + public var value3: Swift.Int? + /// Creates a new `ValuePayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + /// - value3: + public init( + value1: Swift.String? = nil, + value2: Swift.Double? = nil, + value3: Swift.Int? = nil + ) { + self.value1 = value1 + self.value2 = value2 + self.value3 = value3 + } + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self.value1 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + do { + self.value2 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + do { + self.value3 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2, + self.value3 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeFirstNonNilValueToSingleValueContainer([ + self.value1, + self.value2, + self.value3 + ]) + } + } + /// The value of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/value`. + public var value: Components.Schemas.IssueFieldValue.ValuePayload? + /// Details about the selected option (only present for single_select fields) + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option`. + public struct SingleSelectOptionPayload: Codable, Hashable, Sendable { + /// Unique identifier for the option. + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option/id`. + public var id: Swift.Int64 + /// The name of the option + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option/name`. + public var name: Swift.String + /// The color of the option + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option/color`. + public var color: Swift.String + /// Creates a new `SingleSelectOptionPayload`. + /// + /// - Parameters: + /// - id: Unique identifier for the option. + /// - name: The name of the option + /// - color: The color of the option + public init( + id: Swift.Int64, + name: Swift.String, + color: Swift.String + ) { + self.id = id + self.name = name + self.color = color + } + public enum CodingKeys: String, CodingKey { + case id + case name + case color + } + } + /// Details about the selected option (only present for single_select fields) + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option`. + public var singleSelectOption: Components.Schemas.IssueFieldValue.SingleSelectOptionPayload? + /// Creates a new `IssueFieldValue`. + /// + /// - Parameters: + /// - issueFieldId: Unique identifier for the issue field. + /// - nodeId: + /// - dataType: The data type of the issue field + /// - value: The value of the issue field + /// - singleSelectOption: Details about the selected option (only present for single_select fields) + public init( + issueFieldId: Swift.Int64, + nodeId: Swift.String, + dataType: Components.Schemas.IssueFieldValue.DataTypePayload, + value: Components.Schemas.IssueFieldValue.ValuePayload? = nil, + singleSelectOption: Components.Schemas.IssueFieldValue.SingleSelectOptionPayload? = nil + ) { + self.issueFieldId = issueFieldId + self.nodeId = nodeId + self.dataType = dataType + self.value = value + self.singleSelectOption = singleSelectOption + } + public enum CodingKeys: String, CodingKey { + case issueFieldId = "issue_field_id" + case nodeId = "node_id" + case dataType = "data_type" + case value + case singleSelectOption = "single_select_option" + } + } /// Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. /// /// - Remark: Generated from `#/components/schemas/issue`. @@ -3656,6 +4046,7 @@ public enum Components { case completed = "completed" case reopened = "reopened" case notPlanned = "not_planned" + case duplicate = "duplicate" } /// The reason for the current state /// @@ -3845,11 +4236,19 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/issue/performed_via_github_app`. public var performedViaGithubApp: Components.Schemas.NullableIntegration? /// - Remark: Generated from `#/components/schemas/issue/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation + public var authorAssociation: Components.Schemas.AuthorAssociation? /// - Remark: Generated from `#/components/schemas/issue/reactions`. public var reactions: Components.Schemas.ReactionRollup? /// - Remark: Generated from `#/components/schemas/issue/sub_issues_summary`. public var subIssuesSummary: Components.Schemas.SubIssuesSummary? + /// URL to get the parent issue of this issue, if it is a sub-issue + /// + /// - Remark: Generated from `#/components/schemas/issue/parent_issue_url`. + public var parentIssueUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/issue_dependencies_summary`. + public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? + /// - Remark: Generated from `#/components/schemas/issue/issue_field_values`. + public var issueFieldValues: [Components.Schemas.IssueFieldValue]? /// Creates a new `Issue`. /// /// - Parameters: @@ -3889,6 +4288,9 @@ public enum Components { /// - authorAssociation: /// - reactions: /// - subIssuesSummary: + /// - parentIssueUrl: URL to get the parent issue of this issue, if it is a sub-issue + /// - issueDependenciesSummary: + /// - issueFieldValues: public init( id: Swift.Int64, nodeId: Swift.String, @@ -3923,9 +4325,12 @@ public enum Components { _type: Components.Schemas.IssueType? = nil, repository: Components.Schemas.Repository? = nil, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - authorAssociation: Components.Schemas.AuthorAssociation, + authorAssociation: Components.Schemas.AuthorAssociation? = nil, reactions: Components.Schemas.ReactionRollup? = nil, - subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil + subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, + parentIssueUrl: Swift.String? = nil, + issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil, + issueFieldValues: [Components.Schemas.IssueFieldValue]? = nil ) { self.id = id self.nodeId = nodeId @@ -3963,6 +4368,9 @@ public enum Components { self.authorAssociation = authorAssociation self.reactions = reactions self.subIssuesSummary = subIssuesSummary + self.parentIssueUrl = parentIssueUrl + self.issueDependenciesSummary = issueDependenciesSummary + self.issueFieldValues = issueFieldValues } public enum CodingKeys: String, CodingKey { case id @@ -4001,6 +4409,9 @@ public enum Components { case authorAssociation = "author_association" case reactions case subIssuesSummary = "sub_issues_summary" + case parentIssueUrl = "parent_issue_url" + case issueDependenciesSummary = "issue_dependencies_summary" + case issueFieldValues = "issue_field_values" } } /// Comments provide a way for people to collaborate on an issue. @@ -4152,6 +4563,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -4168,6 +4598,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -4181,7 +4614,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -4196,6 +4632,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -4211,6 +4650,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -4284,6 +4726,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -4302,6 +4763,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -4317,6 +4781,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -4332,6 +4799,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -4348,6 +4818,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -4485,6 +4958,7 @@ public enum Components { case completed = "completed" case reopened = "reopened" case notPlanned = "not_planned" + case duplicate = "duplicate" } /// The reason for the current state /// @@ -4674,11 +5148,19 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/nullable-issue/performed_via_github_app`. public var performedViaGithubApp: Components.Schemas.NullableIntegration? /// - Remark: Generated from `#/components/schemas/nullable-issue/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation + public var authorAssociation: Components.Schemas.AuthorAssociation? /// - Remark: Generated from `#/components/schemas/nullable-issue/reactions`. public var reactions: Components.Schemas.ReactionRollup? /// - Remark: Generated from `#/components/schemas/nullable-issue/sub_issues_summary`. public var subIssuesSummary: Components.Schemas.SubIssuesSummary? + /// URL to get the parent issue of this issue, if it is a sub-issue + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue/parent_issue_url`. + public var parentIssueUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-issue/issue_dependencies_summary`. + public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? + /// - Remark: Generated from `#/components/schemas/nullable-issue/issue_field_values`. + public var issueFieldValues: [Components.Schemas.IssueFieldValue]? /// Creates a new `NullableIssue`. /// /// - Parameters: @@ -4718,6 +5200,9 @@ public enum Components { /// - authorAssociation: /// - reactions: /// - subIssuesSummary: + /// - parentIssueUrl: URL to get the parent issue of this issue, if it is a sub-issue + /// - issueDependenciesSummary: + /// - issueFieldValues: public init( id: Swift.Int64, nodeId: Swift.String, @@ -4752,9 +5237,12 @@ public enum Components { _type: Components.Schemas.IssueType? = nil, repository: Components.Schemas.Repository? = nil, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - authorAssociation: Components.Schemas.AuthorAssociation, + authorAssociation: Components.Schemas.AuthorAssociation? = nil, reactions: Components.Schemas.ReactionRollup? = nil, - subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil + subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, + parentIssueUrl: Swift.String? = nil, + issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil, + issueFieldValues: [Components.Schemas.IssueFieldValue]? = nil ) { self.id = id self.nodeId = nodeId @@ -4792,6 +5280,9 @@ public enum Components { self.authorAssociation = authorAssociation self.reactions = reactions self.subIssuesSummary = subIssuesSummary + self.parentIssueUrl = parentIssueUrl + self.issueDependenciesSummary = issueDependenciesSummary + self.issueFieldValues = issueFieldValues } public enum CodingKeys: String, CodingKey { case id @@ -4830,6 +5321,9 @@ public enum Components { case authorAssociation = "author_association" case reactions case subIssuesSummary = "sub_issues_summary" + case parentIssueUrl = "parent_issue_url" + case issueDependenciesSummary = "issue_dependencies_summary" + case issueFieldValues = "issue_field_values" } } /// Issue Event Label @@ -7373,6 +7867,8 @@ public enum Components { public var _links: Components.Schemas.TimelineReviewedEvent._LinksPayload /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/submitted_at`. public var submittedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/updated_at`. + public var updatedAt: Foundation.Date? /// A commit SHA for the review. /// /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/commit_id`. @@ -7396,6 +7892,7 @@ public enum Components { /// - pullRequestUrl: /// - _links: /// - submittedAt: + /// - updatedAt: /// - commitId: A commit SHA for the review. /// - bodyHtml: /// - bodyText: @@ -7411,6 +7908,7 @@ public enum Components { pullRequestUrl: Swift.String, _links: Components.Schemas.TimelineReviewedEvent._LinksPayload, submittedAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, commitId: Swift.String, bodyHtml: Swift.String? = nil, bodyText: Swift.String? = nil, @@ -7426,6 +7924,7 @@ public enum Components { self.pullRequestUrl = pullRequestUrl self._links = _links self.submittedAt = submittedAt + self.updatedAt = updatedAt self.commitId = commitId self.bodyHtml = bodyHtml self.bodyText = bodyText @@ -7442,6 +7941,7 @@ public enum Components { case pullRequestUrl = "pull_request_url" case _links case submittedAt = "submitted_at" + case updatedAt = "updated_at" case commitId = "commit_id" case bodyHtml = "body_html" case bodyText = "body_text" @@ -8490,6 +8990,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/since`. public typealias Since = Foundation.Date + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// The unique identifier of the comment. /// /// - Remark: Generated from `#/components/parameters/comment-id`. @@ -8513,10 +9017,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repo`. public typealias Repo = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String /// The number that identifies the issue. /// /// - Remark: Generated from `#/components/parameters/issue-number`. @@ -8670,6 +9170,34 @@ public enum Components { /// Creates a new `NotModified`. public init() {} } + public struct RequiresAuthentication: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.RequiresAuthentication.Body + /// Creates a new `RequiresAuthentication`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.RequiresAuthentication.Body) { + self.body = body + } + } public struct Forbidden: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/forbidden/content`. @frozen public enum Body: Sendable, Hashable { @@ -12290,6 +12818,7 @@ public enum Operations { @frozen public enum StateReasonPayload: String, Codable, Hashable, Sendable, CaseIterable { case completed = "completed" case notPlanned = "not_planned" + case duplicate = "duplicate" case reopened = "reopened" } /// The reason for the state change. Ignored unless `state` is changed. @@ -13800,28 +14329,35 @@ public enum Operations { } } } - /// List issue events + /// List dependencies an issue is blocked by /// - /// Lists all events for an issue. + /// You can use the REST API to list the dependencies an issue is blocked by. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/events`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/events/get(issues/list-events)`. - public enum IssuesListEvents { - public static let id: Swift.String = "issues/list-events" + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)`. + public enum IssuesListDependenciesBlockedBy { + public static let id: Swift.String = "issues/list-dependencies-blocked-by" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -13839,16 +14375,16 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesListEvents.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/query`. + public var path: Operations.IssuesListDependenciesBlockedBy.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/query`. public struct Query: Sendable, Hashable { /// The number of results per page (max 100). 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)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/query/per_page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. 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)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/query/page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// @@ -13863,8 +14399,1169 @@ public enum Operations { self.page = page } } - public var query: Operations.IssuesListEvents.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/header`. + public var query: Operations.IssuesListDependenciesBlockedBy.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesListDependenciesBlockedBy.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.IssuesListDependenciesBlockedBy.Input.Path, + query: Operations.IssuesListDependenciesBlockedBy.Input.Query = .init(), + headers: Operations.IssuesListDependenciesBlockedBy.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Issue]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.Issue] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Headers = .init(), + body: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesListDependenciesBlockedBy.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesListDependenciesBlockedBy.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Add a dependency an issue is blocked by + /// + /// You can use the REST API to add a 'blocked by' relationship to an issue. + /// + /// Creating content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see [Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits) + /// and [Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)`. + public enum IssuesAddBlockedByDependency { + public static let id: Swift.String = "issues/add-blocked-by-dependency" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesAddBlockedByDependency.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesAddBlockedByDependency.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The id of the issue that blocks the current issue + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody/json/issue_id`. + public var issueId: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - issueId: The id of the issue that blocks the current issue + public init(issueId: Swift.Int) { + self.issueId = issueId + } + public enum CodingKeys: String, CodingKey { + case issueId = "issue_id" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody/content/application\/json`. + case json(Operations.IssuesAddBlockedByDependency.Input.Body.JsonPayload) + } + public var body: Operations.IssuesAddBlockedByDependency.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.IssuesAddBlockedByDependency.Input.Path, + headers: Operations.IssuesAddBlockedByDependency.Input.Headers = .init(), + body: Operations.IssuesAddBlockedByDependency.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/responses/201/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/responses/201/headers/Location`. + public var location: Swift.String? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - location: + public init(location: Swift.String? = nil) { + self.location = location + } + } + /// Received HTTP response headers + public var headers: Operations.IssuesAddBlockedByDependency.Output.Created.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/responses/201/content/application\/json`. + case json(Components.Schemas.Issue) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Issue { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesAddBlockedByDependency.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesAddBlockedByDependency.Output.Created.Headers = .init(), + body: Operations.IssuesAddBlockedByDependency.Output.Created.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.IssuesAddBlockedByDependency.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.IssuesAddBlockedByDependency.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Remove dependency an issue is blocked by + /// + /// You can use the REST API to remove a dependency that an issue is blocked by. + /// + /// Removing content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see [Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits) + /// and [Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api). + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)`. + public enum IssuesRemoveDependencyBlockedBy { + public static let id: Swift.String = "issues/remove-dependency-blocked-by" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// The id of the blocking issue to remove as a dependency + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path/issue_id`. + public var issueId: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + /// - issueId: The id of the blocking issue to remove as a dependency + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber, + issueId: Swift.Int + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + self.issueId = issueId + } + } + public var path: Operations.IssuesRemoveDependencyBlockedBy.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesRemoveDependencyBlockedBy.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.IssuesRemoveDependencyBlockedBy.Input.Path, + headers: Operations.IssuesRemoveDependencyBlockedBy.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/responses/200/content/application\/json`. + case json(Components.Schemas.Issue) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Issue { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesRemoveDependencyBlockedBy.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesRemoveDependencyBlockedBy.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesRemoveDependencyBlockedBy.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesRemoveDependencyBlockedBy.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } + /// List dependencies an issue is blocking + /// + /// You can use the REST API to list the dependencies an issue is blocking. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)`. + public enum IssuesListDependenciesBlocking { + public static let id: Swift.String = "issues/list-dependencies-blocking" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesListDependenciesBlocking.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.IssuesListDependenciesBlocking.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesListDependenciesBlocking.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.IssuesListDependenciesBlocking.Input.Path, + query: Operations.IssuesListDependenciesBlocking.Input.Query = .init(), + headers: Operations.IssuesListDependenciesBlocking.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.IssuesListDependenciesBlocking.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Issue]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.Issue] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesListDependenciesBlocking.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesListDependenciesBlocking.Output.Ok.Headers = .init(), + body: Operations.IssuesListDependenciesBlocking.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesListDependenciesBlocking.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesListDependenciesBlocking.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List issue events + /// + /// Lists all events for an issue. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/events`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/events/get(issues/list-events)`. + public enum IssuesListEvents { + public static let id: Swift.String = "issues/list-events" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesListEvents.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.IssuesListEvents.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/header`. public struct Headers: Sendable, Hashable { public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. @@ -15910,6 +17607,230 @@ public enum Operations { } } } + /// Get parent issue + /// + /// You can use the REST API to get the parent issue of a sub-issue. + /// + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/parent`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)`. + public enum IssuesGetParent { + public static let id: Swift.String = "issues/get-parent" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesGetParent.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesGetParent.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.IssuesGetParent.Input.Path, + headers: Operations.IssuesGetParent.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/responses/200/content/application\/json`. + case json(Components.Schemas.Issue) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Issue { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesGetParent.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesGetParent.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesGetParent.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesGetParent.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// Remove sub-issue /// /// You can use the REST API to remove a sub-issue from an issue. @@ -16167,11 +18088,11 @@ public enum Operations { /// /// You can use the REST API to list the sub-issues on an issue. /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. diff --git a/Sources/markdown/Client.swift b/Sources/markdown/Client.swift index f86df8fee0a..6936f56e929 100644 --- a/Sources/markdown/Client.swift +++ b/Sources/markdown/Client.swift @@ -40,7 +40,7 @@ public struct Client: APIProtocol { } /// Render a Markdown document /// - /// + /// Depending on what is rendered in the Markdown, you may need to provide additional token scopes for labels, such as `issues:read` or `pull_requests:read`. /// /// - Remark: HTTP `POST /markdown`. /// - Remark: Generated from `#/paths//markdown/post(markdown/render)`. diff --git a/Sources/markdown/Types.swift b/Sources/markdown/Types.swift index 10f4f12ac1f..e6f7824d76f 100644 --- a/Sources/markdown/Types.swift +++ b/Sources/markdown/Types.swift @@ -13,7 +13,7 @@ import struct Foundation.Date public protocol APIProtocol: Sendable { /// Render a Markdown document /// - /// + /// Depending on what is rendered in the Markdown, you may need to provide additional token scopes for labels, such as `issues:read` or `pull_requests:read`. /// /// - Remark: HTTP `POST /markdown`. /// - Remark: Generated from `#/paths//markdown/post(markdown/render)`. @@ -31,7 +31,7 @@ public protocol APIProtocol: Sendable { extension APIProtocol { /// Render a Markdown document /// - /// + /// Depending on what is rendered in the Markdown, you may need to provide additional token scopes for labels, such as `issues:read` or `pull_requests:read`. /// /// - Remark: HTTP `POST /markdown`. /// - Remark: Generated from `#/paths//markdown/post(markdown/render)`. @@ -108,7 +108,7 @@ public enum Components { public enum Operations { /// Render a Markdown document /// - /// + /// Depending on what is rendered in the Markdown, you may need to provide additional token scopes for labels, such as `issues:read` or `pull_requests:read`. /// /// - Remark: HTTP `POST /markdown`. /// - Remark: Generated from `#/paths//markdown/post(markdown/render)`. diff --git a/Sources/migrations/Types.swift b/Sources/migrations/Types.swift index 96008a916e8..891b6e61f49 100644 --- a/Sources/migrations/Types.swift +++ b/Sources/migrations/Types.swift @@ -1628,6 +1628,35 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/anonymous_access_enabled`. public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? /// Creates a new `Repository`. /// /// - Parameters: @@ -1726,6 +1755,7 @@ public enum Components { /// - masterBranch: /// - starredAt: /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository public init( id: Swift.Int64, nodeId: Swift.String, @@ -1821,7 +1851,8 @@ public enum Components { watchers: Swift.Int, masterBranch: Swift.String? = nil, starredAt: Swift.String? = nil, - anonymousAccessEnabled: Swift.Bool? = nil + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -1918,6 +1949,7 @@ public enum Components { self.masterBranch = masterBranch self.starredAt = starredAt self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus } public enum CodingKeys: String, CodingKey { case id @@ -2015,6 +2047,7 @@ public enum Components { case masterBranch = "master_branch" case starredAt = "starred_at" case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" } } /// Code Of Conduct @@ -2062,6 +2095,11 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -2082,6 +2120,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -2227,7 +2270,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: @@ -2523,6 +2566,30 @@ public enum Components { public var webCommitSignoffRequired: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/security_and_analysis`. public var securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public struct CustomPropertiesPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CustomPropertiesPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public var customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? /// Creates a new `MinimalRepository`. /// /// - Parameters: @@ -2613,6 +2680,7 @@ public enum Components { /// - allowForking: /// - webCommitSignoffRequired: /// - securityAndAnalysis: + /// - customProperties: The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. public init( id: Swift.Int64, nodeId: Swift.String, @@ -2700,7 +2768,8 @@ public enum Components { watchers: Swift.Int? = nil, allowForking: Swift.Bool? = nil, webCommitSignoffRequired: Swift.Bool? = nil, - securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil + securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil, + customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -2789,6 +2858,7 @@ public enum Components { self.allowForking = allowForking self.webCommitSignoffRequired = webCommitSignoffRequired self.securityAndAnalysis = securityAndAnalysis + self.customProperties = customProperties } public enum CodingKeys: String, CodingKey { case id @@ -2878,6 +2948,7 @@ public enum Components { case allowForking = "allow_forking" case webCommitSignoffRequired = "web_commit_signoff_required" case securityAndAnalysis = "security_and_analysis" + case customProperties = "custom_properties" } } /// A migration. @@ -3311,6 +3382,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -3319,10 +3394,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repo`. public typealias Repo = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String /// The unique identifier of the migration. /// /// - Remark: Generated from `#/components/parameters/migration-id`. diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index aea79cd7d8f..52ad7cee540 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -127,6 +127,248 @@ public struct Client: APIProtocol { } ) } + /// Get all custom property values for an organization + /// + /// Gets all custom property values that are set for an organization. + /// + /// The organization must belong to an enterprise. + /// + /// Access requirements: + /// - Organization admins + /// - OAuth tokens and personal access tokens (classic) with the `read:org` scope + /// - Actors with the organization-level "read custom properties for an organization" fine-grained permission or above + /// + /// - Remark: HTTP `GET /organizations/{org}/org-properties/values`. + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/get(orgs/custom-properties-for-orgs-get-organization-values)`. + public func orgsCustomPropertiesForOrgsGetOrganizationValues(_ input: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/organizations/{}/org-properties/values", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.CustomPropertyValue].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create or update custom property values for an organization + /// + /// Create new or update existing custom property values for an organization. + /// To remove a custom property value from an organization, set the property value to `null`. + /// + /// The organization must belong to an enterprise. + /// + /// Access requirements: + /// - Organization admins + /// - OAuth tokens and personal access tokens (classic) with the `admin:org` scope + /// - Actors with the organization-level "edit custom properties for an organization" fine-grained permission + /// + /// - Remark: HTTP `PATCH /organizations/{org}/org-properties/values`. + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)`. + public func orgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues(_ input: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/organizations/{}/org-properties/values", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get an organization /// /// Gets information about an organization. @@ -464,72 +706,50 @@ public struct Client: APIProtocol { } ) } - /// List attestations + /// Create artifact metadata storage record /// - /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. - /// - /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. - /// - /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// Create metadata storage records for artifacts associated with an organization. + /// This endpoint will create a new artifact storage record on behalf of any artifact matching the provided digest and + /// associated with a repository owned by the organization. /// - /// - Remark: HTTP `GET /orgs/{org}/attestations/{subject_digest}`. - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)`. - public func orgsListAttestations(_ input: Operations.OrgsListAttestations.Input) async throws -> Operations.OrgsListAttestations.Output { + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/storage-record`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)`. + public func orgsCreateArtifactStorageRecord(_ input: Operations.OrgsCreateArtifactStorageRecord.Input) async throws -> Operations.OrgsCreateArtifactStorageRecord.Output { try await client.send( input: input, - forOperation: Operations.OrgsListAttestations.id, + forOperation: Operations.OrgsCreateArtifactStorageRecord.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/attestations/{}", + template: "/orgs/{}/artifacts/metadata/storage-record", parameters: [ - input.path.org, - input.path.subjectDigest + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "before", - value: input.query.before - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "after", - value: input.query.after + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "predicate_type", - value: input.query.predicateType - ) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListAttestations.Output.Ok.Body + let body: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -539,7 +759,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.self, + Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -561,21 +781,24 @@ public struct Client: APIProtocol { } ) } - /// List users blocked by an organization + /// List artifact storage records /// - /// List the users blocked by an organization. + /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/blocks`. - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/get(orgs/list-blocked-users)`. - public func orgsListBlockedUsers(_ input: Operations.OrgsListBlockedUsers.Input) async throws -> Operations.OrgsListBlockedUsers.Output { + /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. + public func orgsListArtifactStorageRecords(_ input: Operations.OrgsListArtifactStorageRecords.Input) async throws -> Operations.OrgsListArtifactStorageRecords.Output { try await client.send( input: input, - forOperation: Operations.OrgsListBlockedUsers.id, + forOperation: Operations.OrgsListArtifactStorageRecords.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/blocks", + template: "/orgs/{}/artifacts/{}/metadata/storage-records", parameters: [ - input.path.org + input.path.org, + input.path.subjectDigest ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -583,20 +806,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -607,7 +816,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListBlockedUsers.Output.Ok.Body + let body: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -617,7 +826,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.SimpleUser].self, + Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -639,42 +848,73 @@ public struct Client: APIProtocol { } ) } - /// Check if a user is blocked by an organization + /// List attestations by bulk subject digests /// - /// Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. + /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/blocks/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)`. - public func orgsCheckBlockedUser(_ input: Operations.OrgsCheckBlockedUser.Input) async throws -> Operations.OrgsCheckBlockedUser.Output { + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /orgs/{org}/attestations/bulk-list`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/bulk-list/post(orgs/list-attestations-bulk)`. + public func orgsListAttestationsBulk(_ input: Operations.OrgsListAttestationsBulk.Input) async throws -> Operations.OrgsListAttestationsBulk.Output { try await client.send( input: input, - forOperation: Operations.OrgsCheckBlockedUser.id, + forOperation: Operations.OrgsListAttestationsBulk.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/blocks/{}", + template: "/orgs/{}/attestations/bulk-list", parameters: [ - input.path.org, - input.path.username + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 404: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsCheckBlockedUser.Output.NotFound.Body + let body: Operations.OrgsListAttestationsBulk.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -684,7 +924,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -693,7 +933,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -706,42 +946,50 @@ public struct Client: APIProtocol { } ) } - /// Block a user from an organization + /// Delete attestations in bulk /// - /// Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned. + /// Delete artifact attestations in bulk by either subject digests or unique ID. /// - /// - Remark: HTTP `PUT /orgs/{org}/blocks/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)`. - public func orgsBlockUser(_ input: Operations.OrgsBlockUser.Input) async throws -> Operations.OrgsBlockUser.Output { + /// - Remark: HTTP `POST /orgs/{org}/attestations/delete-request`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)`. + public func orgsDeleteAttestationsBulk(_ input: Operations.OrgsDeleteAttestationsBulk.Input) async throws -> Operations.OrgsDeleteAttestationsBulk.Output { try await client.send( input: input, - forOperation: Operations.OrgsBlockUser.id, + forOperation: Operations.OrgsDeleteAttestationsBulk.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/blocks/{}", + template: "/orgs/{}/attestations/delete-request", parameters: [ - input.path.org, - input.path.username + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 422: + case 200: + return .ok(.init()) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -751,7 +999,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -760,7 +1008,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -773,22 +1021,22 @@ public struct Client: APIProtocol { } ) } - /// Unblock a user from an organization + /// Delete attestations by subject digest /// - /// Unblocks the given user on behalf of the specified organization. + /// Delete an artifact attestation by subject digest. /// - /// - Remark: HTTP `DELETE /orgs/{org}/blocks/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/delete(orgs/unblock-user)`. - public func orgsUnblockUser(_ input: Operations.OrgsUnblockUser.Input) async throws -> Operations.OrgsUnblockUser.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/digest/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)`. + public func orgsDeleteAttestationsBySubjectDigest(_ input: Operations.OrgsDeleteAttestationsBySubjectDigest.Input) async throws -> Operations.OrgsDeleteAttestationsBySubjectDigest.Output { try await client.send( input: input, - forOperation: Operations.OrgsUnblockUser.id, + forOperation: Operations.OrgsDeleteAttestationsBySubjectDigest.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/blocks/{}", + template: "/orgs/{}/attestations/digest/{}", parameters: [ input.path.org, - input.path.username + input.path.subjectDigest ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -796,12 +1044,40 @@ public struct Client: APIProtocol { method: .delete ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { + case 200: + return .ok(.init()) case 204: return .noContent(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -814,19 +1090,20 @@ public struct Client: APIProtocol { } ) } - /// List failed organization invitations + /// List attestation repositories /// - /// The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure. + /// List repositories owned by the provided organization that have created at least one attested artifact + /// Results will be sorted in ascending order by repository ID /// - /// - Remark: HTTP `GET /orgs/{org}/failed_invitations`. - /// - Remark: Generated from `#/paths//orgs/{org}/failed_invitations/get(orgs/list-failed-invitations)`. - public func orgsListFailedInvitations(_ input: Operations.OrgsListFailedInvitations.Input) async throws -> Operations.OrgsListFailedInvitations.Output { + /// - Remark: HTTP `GET /orgs/{org}/attestations/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/repositories/get(orgs/list-attestation-repositories)`. + public func orgsListAttestationRepositories(_ input: Operations.OrgsListAttestationRepositories.Input) async throws -> Operations.OrgsListAttestationRepositories.Output { try await client.send( input: input, - forOperation: Operations.OrgsListFailedInvitations.id, + forOperation: Operations.OrgsListAttestationRepositories.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/failed_invitations", + template: "/orgs/{}/attestations/repositories", parameters: [ input.path.org ] @@ -847,8 +1124,22 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "page", - value: input.query.page + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "predicate_type", + value: input.query.predicateType ) converter.setAcceptHeader( in: &request.headerFields, @@ -859,38 +1150,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.OrgsListFailedInvitations.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListFailedInvitations.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.OrganizationInvitation].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.OrgsListAttestationRepositories.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -900,7 +1161,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Operations.OrgsListAttestationRepositories.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -909,7 +1170,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -922,47 +1183,29 @@ public struct Client: APIProtocol { } ) } - /// List organization webhooks - /// - /// List webhooks for an organization. - /// - /// The authenticated user must be an organization owner to use this endpoint. + /// Delete attestations by ID /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Delete an artifact attestation by unique ID that is associated with a repository owned by an org. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/get(orgs/list-webhooks)`. - public func orgsListWebhooks(_ input: Operations.OrgsListWebhooks.Input) async throws -> Operations.OrgsListWebhooks.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/{attestation_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)`. + public func orgsDeleteAttestationsById(_ input: Operations.OrgsDeleteAttestationsById.Input) async throws -> Operations.OrgsDeleteAttestationsById.Output { try await client.send( input: input, - forOperation: Operations.OrgsListWebhooks.id, + forOperation: Operations.OrgsDeleteAttestationsById.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/hooks", + template: "/orgs/{}/attestations/{}", parameters: [ - input.path.org + input.path.org, + input.path.attestationId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -972,13 +1215,12 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.OrgsListWebhooks.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) + return .ok(.init()) + case 204: + return .noContent(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListWebhooks.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -988,7 +1230,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.OrgHook].self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -997,10 +1239,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .forbidden(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -1035,105 +1274,72 @@ public struct Client: APIProtocol { } ) } - /// Create an organization webhook + /// List attestations /// - /// Create a hook that posts payloads in JSON format. + /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. /// - /// You must be an organization owner to use this endpoint. + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or - /// edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). /// - /// - Remark: HTTP `POST /orgs/{org}/hooks`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)`. - public func orgsCreateWebhook(_ input: Operations.OrgsCreateWebhook.Input) async throws -> Operations.OrgsCreateWebhook.Output { + /// - Remark: HTTP `GET /orgs/{org}/attestations/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)`. + public func orgsListAttestations(_ input: Operations.OrgsListAttestations.Input) async throws -> Operations.OrgsListAttestations.Output { try await client.send( input: input, - forOperation: Operations.OrgsCreateWebhook.id, + forOperation: Operations.OrgsListAttestations.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/hooks", + template: "/orgs/{}/attestations/{}", parameters: [ - input.path.org + input.path.org, + input.path.subjectDigest ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "predicate_type", + value: input.query.predicateType + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: - let headers: Operations.OrgsCreateWebhook.Output.Created.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Location", - as: Swift.String.self - )) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsCreateWebhook.Output.Created.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.OrgHook.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init( - headers: headers, - body: body - )) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - case 404: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.OrgsListAttestations.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1143,7 +1349,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1152,7 +1358,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1165,28 +1371,21 @@ public struct Client: APIProtocol { } ) } - /// Get an organization webhook - /// - /// Returns a webhook configured in an organization. To get only the webhook - /// `config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization). - /// - /// You must be an organization owner to use this endpoint. + /// List users blocked by an organization /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// List the users blocked by an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/get(orgs/get-webhook)`. - public func orgsGetWebhook(_ input: Operations.OrgsGetWebhook.Input) async throws -> Operations.OrgsGetWebhook.Output { + /// - Remark: HTTP `GET /orgs/{org}/blocks`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/get(orgs/list-blocked-users)`. + public func orgsListBlockedUsers(_ input: Operations.OrgsListBlockedUsers.Input) async throws -> Operations.OrgsListBlockedUsers.Output { try await client.send( input: input, - forOperation: Operations.OrgsGetWebhook.id, + forOperation: Operations.OrgsListBlockedUsers.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/hooks/{}", + template: "/orgs/{}/blocks", parameters: [ - input.path.org, - input.path.hookId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1194,6 +1393,20 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1204,7 +1417,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsGetWebhook.Output.Ok.Body + let body: Operations.OrgsListBlockedUsers.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1214,7 +1427,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.OrgHook.self, + [Components.Schemas.SimpleUser].self, from: responseBody, transforming: { value in .json(value) @@ -1224,9 +1437,54 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Check if a user is blocked by an organization + /// + /// Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. + /// + /// - Remark: HTTP `GET /orgs/{org}/blocks/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)`. + public func orgsCheckBlockedUser(_ input: Operations.OrgsCheckBlockedUser.Input) async throws -> Operations.OrgsCheckBlockedUser.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsCheckBlockedUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/blocks/{}", + parameters: [ + input.path.org, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.OrgsCheckBlockedUser.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1258,79 +1516,39 @@ public struct Client: APIProtocol { } ) } - /// Update an organization webhook - /// - /// Updates a webhook configured in an organization. When you update a webhook, - /// the `secret` will be overwritten. If you previously had a `secret` set, you must - /// provide the same `secret` or set a new `secret` or the secret will be removed. If - /// you are only updating individual webhook `config` properties, use "[Update a webhook - /// configuration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)". - /// - /// You must be an organization owner to use this endpoint. + /// Block a user from an organization /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned. /// - /// - Remark: HTTP `PATCH /orgs/{org}/hooks/{hook_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)`. - public func orgsUpdateWebhook(_ input: Operations.OrgsUpdateWebhook.Input) async throws -> Operations.OrgsUpdateWebhook.Output { + /// - Remark: HTTP `PUT /orgs/{org}/blocks/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)`. + public func orgsBlockUser(_ input: Operations.OrgsBlockUser.Input) async throws -> Operations.OrgsBlockUser.Output { try await client.send( input: input, - forOperation: Operations.OrgsUpdateWebhook.id, + forOperation: Operations.OrgsBlockUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/hooks/{}", + template: "/orgs/{}/blocks/{}", parameters: [ input.path.org, - input.path.hookId + input.path.username ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case .none: - body = nil - case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsUpdateWebhook.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.OrgHook.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) + case 204: + return .noContent(.init()) case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.ValidationFailed.Body @@ -1353,28 +1571,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .unprocessableContent(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1387,27 +1583,22 @@ public struct Client: APIProtocol { } ) } - /// Delete an organization webhook - /// - /// Delete a webhook for an organization. - /// - /// The authenticated user must be an organization owner to use this endpoint. + /// Unblock a user from an organization /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Unblocks the given user on behalf of the specified organization. /// - /// - Remark: HTTP `DELETE /orgs/{org}/hooks/{hook_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)`. - public func orgsDeleteWebhook(_ input: Operations.OrgsDeleteWebhook.Input) async throws -> Operations.OrgsDeleteWebhook.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/blocks/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/delete(orgs/unblock-user)`. + public func orgsUnblockUser(_ input: Operations.OrgsUnblockUser.Input) async throws -> Operations.OrgsUnblockUser.Output { try await client.send( input: input, - forOperation: Operations.OrgsDeleteWebhook.id, + forOperation: Operations.OrgsUnblockUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/hooks/{}", + template: "/orgs/{}/blocks/{}", parameters: [ input.path.org, - input.path.hookId + input.path.username ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1415,38 +1606,12 @@ public struct Client: APIProtocol { method: .delete ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 204: return .noContent(.init()) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1459,27 +1624,21 @@ public struct Client: APIProtocol { } ) } - /// Get a webhook configuration for an organization - /// - /// Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)." - /// - /// You must be an organization owner to use this endpoint. + /// List failed organization invitations /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/config`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/get(orgs/get-webhook-config-for-org)`. - public func orgsGetWebhookConfigForOrg(_ input: Operations.OrgsGetWebhookConfigForOrg.Input) async throws -> Operations.OrgsGetWebhookConfigForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/failed_invitations`. + /// - Remark: Generated from `#/paths//orgs/{org}/failed_invitations/get(orgs/list-failed-invitations)`. + public func orgsListFailedInvitations(_ input: Operations.OrgsListFailedInvitations.Input) async throws -> Operations.OrgsListFailedInvitations.Output { try await client.send( input: input, - forOperation: Operations.OrgsGetWebhookConfigForOrg.id, + forOperation: Operations.OrgsListFailedInvitations.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/hooks/{}/config", + template: "/orgs/{}/failed_invitations", parameters: [ - input.path.org, - input.path.hookId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1487,6 +1646,20 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1496,8 +1669,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.OrgsListFailedInvitations.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsGetWebhookConfigForOrg.Output.Ok.Body + let body: Operations.OrgsListFailedInvitations.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1507,7 +1685,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.WebhookConfig.self, + [Components.Schemas.OrganizationInvitation].self, from: responseBody, transforming: { value in .json(value) @@ -1516,69 +1694,13 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update a webhook configuration for an organization - /// - /// Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)." - /// - /// You must be an organization owner to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. - /// - /// - Remark: HTTP `PATCH /orgs/{org}/hooks/{hook_id}/config`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/patch(orgs/update-webhook-config-for-org)`. - public func orgsUpdateWebhookConfigForOrg(_ input: Operations.OrgsUpdateWebhookConfigForOrg.Input) async throws -> Operations.OrgsUpdateWebhookConfigForOrg.Output { - try await client.send( - input: input, - forOperation: Operations.OrgsUpdateWebhookConfigForOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/hooks/{}/config", - parameters: [ - input.path.org, - input.path.hookId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .patch - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case .none: - body = nil - case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: + return .ok(.init( + headers: headers, + body: body + )) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1588,7 +1710,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.WebhookConfig.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -1597,7 +1719,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1610,27 +1732,26 @@ public struct Client: APIProtocol { } ) } - /// List deliveries for an organization webhook + /// List organization webhooks /// - /// Returns a list of webhook deliveries for a webhook configured in an organization. + /// List webhooks for an organization. /// - /// You must be an organization owner to use this endpoint. + /// The authenticated user must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/deliveries`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)`. - public func orgsListWebhookDeliveries(_ input: Operations.OrgsListWebhookDeliveries.Input) async throws -> Operations.OrgsListWebhookDeliveries.Output { + /// - Remark: HTTP `GET /orgs/{org}/hooks`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/get(orgs/list-webhooks)`. + public func orgsListWebhooks(_ input: Operations.OrgsListWebhooks.Input) async throws -> Operations.OrgsListWebhooks.Output { try await client.send( input: input, - forOperation: Operations.OrgsListWebhookDeliveries.id, + forOperation: Operations.OrgsListWebhooks.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/hooks/{}/deliveries", + template: "/orgs/{}/hooks", parameters: [ - input.path.org, - input.path.hookId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1649,8 +1770,8 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "cursor", - value: input.query.cursor + name: "page", + value: input.query.page ) converter.setAcceptHeader( in: &request.headerFields, @@ -1661,61 +1782,38 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.OrgsListWebhooks.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListWebhookDeliveries.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.HookDeliveryItem].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 400: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.BadRequest.Body + let body: Operations.OrgsListWebhooks.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json", - "application/scim+json" + "application/json" ] ) switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + [Components.Schemas.OrgHook].self, from: responseBody, transforming: { value in .json(value) } ) - case "application/scim+json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ScimError.self, - from: responseBody, - transforming: { value in - .applicationScimJson(value) - } - ) default: preconditionFailure("bestContentType chose an invalid content type.") } - return .badRequest(.init(body: body)) - case 422: + return .ok(.init( + headers: headers, + body: body + )) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1725,7 +1823,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -1734,7 +1832,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1747,46 +1845,58 @@ public struct Client: APIProtocol { } ) } - /// Get a webhook delivery for an organization webhook + /// Create an organization webhook /// - /// Returns a delivery for a webhook configured in an organization. + /// Create a hook that posts payloads in JSON format. /// /// You must be an organization owner to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or + /// edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)`. - public func orgsGetWebhookDelivery(_ input: Operations.OrgsGetWebhookDelivery.Input) async throws -> Operations.OrgsGetWebhookDelivery.Output { + /// - Remark: HTTP `POST /orgs/{org}/hooks`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)`. + public func orgsCreateWebhook(_ input: Operations.OrgsCreateWebhook.Input) async throws -> Operations.OrgsCreateWebhook.Output { try await client.send( input: input, - forOperation: Operations.OrgsGetWebhookDelivery.id, + forOperation: Operations.OrgsCreateWebhook.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/hooks/{}/deliveries/{}", + template: "/orgs/{}/hooks", parameters: [ - input.path.org, - input.path.hookId, - input.path.deliveryId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 201: + let headers: Operations.OrgsCreateWebhook.Output.Created.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Location", + as: Swift.String.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsGetWebhookDelivery.Output.Ok.Body + let body: Operations.OrgsCreateWebhook.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1796,7 +1906,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.HookDelivery.self, + Components.Schemas.OrgHook.self, from: responseBody, transforming: { value in .json(value) @@ -1805,41 +1915,35 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 400: + return .created(.init( + headers: headers, + body: body + )) + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.BadRequest.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json", - "application/scim+json" + "application/json" ] ) switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ValidationError.self, from: responseBody, transforming: { value in .json(value) } ) - case "application/scim+json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ScimError.self, - from: responseBody, - transforming: { value in - .applicationScimJson(value) - } - ) default: preconditionFailure("bestContentType chose an invalid content type.") } - return .badRequest(.init(body: body)) - case 422: + return .unprocessableContent(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1849,7 +1953,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -1858,7 +1962,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1871,33 +1975,33 @@ public struct Client: APIProtocol { } ) } - /// Redeliver a delivery for an organization webhook + /// Get an organization webhook /// - /// Redeliver a delivery for a webhook configured in an organization. + /// Returns a webhook configured in an organization. To get only the webhook + /// `config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization). /// /// You must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)`. - public func orgsRedeliverWebhookDelivery(_ input: Operations.OrgsRedeliverWebhookDelivery.Input) async throws -> Operations.OrgsRedeliverWebhookDelivery.Output { + /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/get(orgs/get-webhook)`. + public func orgsGetWebhook(_ input: Operations.OrgsGetWebhook.Input) async throws -> Operations.OrgsGetWebhook.Output { try await client.send( input: input, - forOperation: Operations.OrgsRedeliverWebhookDelivery.id, + forOperation: Operations.OrgsGetWebhook.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/hooks/{}/deliveries/{}/attempts", + template: "/orgs/{}/hooks/{}", parameters: [ input.path.org, - input.path.hookId, - input.path.deliveryId + input.path.hookId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -1908,9 +2012,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 202: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Accepted.Body + let body: Operations.OrgsGetWebhook.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1920,50 +2024,19 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - OpenAPIRuntime.OpenAPIObjectContainer.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .accepted(.init(body: body)) - case 400: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.BadRequest.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json", - "application/scim+json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.OrgHook.self, from: responseBody, transforming: { value in .json(value) } ) - case "application/scim+json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ScimError.self, - from: responseBody, - transforming: { value in - .applicationScimJson(value) - } - ) default: preconditionFailure("bestContentType chose an invalid content type.") } - return .badRequest(.init(body: body)) - case 422: + return .ok(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1973,7 +2046,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -1982,7 +2055,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1995,25 +2068,28 @@ public struct Client: APIProtocol { } ) } - /// Ping an organization webhook + /// Update an organization webhook /// - /// This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) - /// to be sent to the hook. + /// Updates a webhook configured in an organization. When you update a webhook, + /// the `secret` will be overwritten. If you previously had a `secret` set, you must + /// provide the same `secret` or set a new `secret` or the secret will be removed. If + /// you are only updating individual webhook `config` properties, use "[Update a webhook + /// configuration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)". /// /// You must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/pings`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)`. - public func orgsPingWebhook(_ input: Operations.OrgsPingWebhook.Input) async throws -> Operations.OrgsPingWebhook.Output { + /// - Remark: HTTP `PATCH /orgs/{org}/hooks/{hook_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)`. + public func orgsUpdateWebhook(_ input: Operations.OrgsUpdateWebhook.Input) async throws -> Operations.OrgsUpdateWebhook.Output { try await client.send( input: input, - forOperation: Operations.OrgsPingWebhook.id, + forOperation: Operations.OrgsUpdateWebhook.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/hooks/{}/pings", + template: "/orgs/{}/hooks/{}", parameters: [ input.path.org, input.path.hookId @@ -2021,22 +2097,31 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .patch ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case .none: + body = nil + case let .json(value): + body = try converter.setOptionalRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 404: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.OrgsUpdateWebhook.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2046,7 +2131,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.OrgHook.self, from: responseBody, transforming: { value in .json(value) @@ -2055,103 +2140,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get route stats by actor - /// - /// Get API request count statistics for an actor broken down by route within a specified time frame. - /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. - public func apiInsightsGetRouteStatsByActor(_ input: Operations.ApiInsightsGetRouteStatsByActor.Input) async throws -> Operations.ApiInsightsGetRouteStatsByActor.Output { - try await client.send( - input: input, - forOperation: Operations.ApiInsightsGetRouteStatsByActor.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/insights/api/route-stats/{}/{}", - parameters: [ - input.path.org, - input.path.actorType, - input.path.actorId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "min_timestamp", - value: input.query.minTimestamp - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "max_timestamp", - value: input.query.maxTimestamp - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "direction", - value: input.query.direction - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "sort", - value: input.query.sort - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "api_route_substring", - value: input.query.apiRouteSubstring - ) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: + return .ok(.init(body: body)) + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApiInsightsGetRouteStatsByActor.Output.Ok.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2161,7 +2153,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ApiInsightsRouteStats.self, + Components.Schemas.ValidationError.self, from: responseBody, transforming: { value in .json(value) @@ -2170,7 +2162,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .unprocessableContent(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2183,77 +2197,34 @@ public struct Client: APIProtocol { } ) } - /// Get subject stats + /// Delete an organization webhook /// - /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. + /// Delete a webhook for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. - public func apiInsightsGetSubjectStats(_ input: Operations.ApiInsightsGetSubjectStats.Input) async throws -> Operations.ApiInsightsGetSubjectStats.Output { + /// The authenticated user must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/hooks/{hook_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)`. + public func orgsDeleteWebhook(_ input: Operations.OrgsDeleteWebhook.Input) async throws -> Operations.OrgsDeleteWebhook.Output { try await client.send( input: input, - forOperation: Operations.ApiInsightsGetSubjectStats.id, + forOperation: Operations.OrgsDeleteWebhook.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/insights/api/subject-stats", + template: "/orgs/{}/hooks/{}", parameters: [ - input.path.org + input.path.org, + input.path.hookId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "min_timestamp", - value: input.query.minTimestamp - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "max_timestamp", - value: input.query.maxTimestamp - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "direction", - value: input.query.direction - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "sort", - value: input.query.sort - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "subject_name_substring", - value: input.query.subjectNameSubstring - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -2262,9 +2233,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 204: + return .noContent(.init()) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApiInsightsGetSubjectStats.Output.Ok.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2274,7 +2247,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ApiInsightsSubjectStats.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -2283,7 +2256,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2296,21 +2269,27 @@ public struct Client: APIProtocol { } ) } - /// Get summary stats + /// Get a webhook configuration for an organization /// - /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. + /// Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)." /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. - public func apiInsightsGetSummaryStats(_ input: Operations.ApiInsightsGetSummaryStats.Input) async throws -> Operations.ApiInsightsGetSummaryStats.Output { + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/config`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/get(orgs/get-webhook-config-for-org)`. + public func orgsGetWebhookConfigForOrg(_ input: Operations.OrgsGetWebhookConfigForOrg.Input) async throws -> Operations.OrgsGetWebhookConfigForOrg.Output { try await client.send( input: input, - forOperation: Operations.ApiInsightsGetSummaryStats.id, + forOperation: Operations.OrgsGetWebhookConfigForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/insights/api/summary-stats", + template: "/orgs/{}/hooks/{}/config", parameters: [ - input.path.org + input.path.org, + input.path.hookId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -2318,20 +2297,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "min_timestamp", - value: input.query.minTimestamp - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "max_timestamp", - value: input.query.maxTimestamp - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -2342,7 +2307,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApiInsightsGetSummaryStats.Output.Ok.Body + let body: Operations.OrgsGetWebhookConfigForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2352,7 +2317,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ApiInsightsSummaryStats.self, + Components.Schemas.WebhookConfig.self, from: responseBody, transforming: { value in .json(value) @@ -2374,54 +2339,56 @@ public struct Client: APIProtocol { } ) } - /// Get summary stats by user + /// Update a webhook configuration for an organization /// - /// Get overall statistics of API requests within the organization for a user. + /// Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)." /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. - public func apiInsightsGetSummaryStatsByUser(_ input: Operations.ApiInsightsGetSummaryStatsByUser.Input) async throws -> Operations.ApiInsightsGetSummaryStatsByUser.Output { + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/hooks/{hook_id}/config`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/patch(orgs/update-webhook-config-for-org)`. + public func orgsUpdateWebhookConfigForOrg(_ input: Operations.OrgsUpdateWebhookConfigForOrg.Input) async throws -> Operations.OrgsUpdateWebhookConfigForOrg.Output { try await client.send( input: input, - forOperation: Operations.ApiInsightsGetSummaryStatsByUser.id, + forOperation: Operations.OrgsUpdateWebhookConfigForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/insights/api/summary-stats/users/{}", + template: "/orgs/{}/hooks/{}/config", parameters: [ input.path.org, - input.path.userId + input.path.hookId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .patch ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "min_timestamp", - value: input.query.minTimestamp - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "max_timestamp", - value: input.query.maxTimestamp - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case .none: + body = nil + case let .json(value): + body = try converter.setOptionalRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok.Body + let body: Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2431,7 +2398,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ApiInsightsSummaryStats.self, + Components.Schemas.WebhookConfig.self, from: responseBody, transforming: { value in .json(value) @@ -2453,23 +2420,27 @@ public struct Client: APIProtocol { } ) } - /// Get summary stats by actor + /// List deliveries for an organization webhook /// - /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. + /// Returns a list of webhook deliveries for a webhook configured in an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. - public func apiInsightsGetSummaryStatsByActor(_ input: Operations.ApiInsightsGetSummaryStatsByActor.Input) async throws -> Operations.ApiInsightsGetSummaryStatsByActor.Output { + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/deliveries`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)`. + public func orgsListWebhookDeliveries(_ input: Operations.OrgsListWebhookDeliveries.Input) async throws -> Operations.OrgsListWebhookDeliveries.Output { try await client.send( input: input, - forOperation: Operations.ApiInsightsGetSummaryStatsByActor.id, + forOperation: Operations.OrgsListWebhookDeliveries.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/insights/api/summary-stats/{}/{}", + template: "/orgs/{}/hooks/{}/deliveries", parameters: [ input.path.org, - input.path.actorType, - input.path.actorId + input.path.hookId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -2481,15 +2452,15 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "min_timestamp", - value: input.query.minTimestamp + name: "per_page", + value: input.query.perPage ) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "max_timestamp", - value: input.query.maxTimestamp + name: "cursor", + value: input.query.cursor ) converter.setAcceptHeader( in: &request.headerFields, @@ -2501,7 +2472,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok.Body + let body: Operations.OrgsListWebhookDeliveries.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2511,7 +2482,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ApiInsightsSummaryStats.self, + [Components.Schemas.HookDeliveryItem].self, from: responseBody, transforming: { value in .json(value) @@ -2521,6 +2492,59 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2533,21 +2557,28 @@ public struct Client: APIProtocol { } ) } - /// Get time stats + /// Get a webhook delivery for an organization webhook /// - /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. + /// Returns a delivery for a webhook configured in an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. - public func apiInsightsGetTimeStats(_ input: Operations.ApiInsightsGetTimeStats.Input) async throws -> Operations.ApiInsightsGetTimeStats.Output { + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)`. + public func orgsGetWebhookDelivery(_ input: Operations.OrgsGetWebhookDelivery.Input) async throws -> Operations.OrgsGetWebhookDelivery.Output { try await client.send( input: input, - forOperation: Operations.ApiInsightsGetTimeStats.id, + forOperation: Operations.OrgsGetWebhookDelivery.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/insights/api/time-stats", + template: "/orgs/{}/hooks/{}/deliveries/{}", parameters: [ - input.path.org + input.path.org, + input.path.hookId, + input.path.deliveryId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -2555,27 +2586,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "min_timestamp", - value: input.query.minTimestamp - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "max_timestamp", - value: input.query.maxTimestamp - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "timestamp_increment", - value: input.query.timestampIncrement - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -2586,7 +2596,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApiInsightsGetTimeStats.Output.Ok.Body + let body: Operations.OrgsGetWebhookDelivery.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2596,7 +2606,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ApiInsightsTimeStats.self, + Components.Schemas.HookDelivery.self, from: responseBody, transforming: { value in .json(value) @@ -2606,6 +2616,59 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2618,50 +2681,159 @@ public struct Client: APIProtocol { } ) } - /// Get time stats by user + /// Redeliver a delivery for an organization webhook /// - /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. + /// Redeliver a delivery for a webhook configured in an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. - public func apiInsightsGetTimeStatsByUser(_ input: Operations.ApiInsightsGetTimeStatsByUser.Input) async throws -> Operations.ApiInsightsGetTimeStatsByUser.Output { + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)`. + public func orgsRedeliverWebhookDelivery(_ input: Operations.OrgsRedeliverWebhookDelivery.Input) async throws -> Operations.OrgsRedeliverWebhookDelivery.Output { try await client.send( input: input, - forOperation: Operations.ApiInsightsGetTimeStatsByUser.id, + forOperation: Operations.OrgsRedeliverWebhookDelivery.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/insights/api/time-stats/users/{}", + template: "/orgs/{}/hooks/{}/deliveries/{}/attempts", parameters: [ input.path.org, - input.path.userId + input.path.hookId, + input.path.deliveryId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "min_timestamp", - value: input.query.minTimestamp + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "max_timestamp", - value: input.query.maxTimestamp + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 202: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Accepted.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + OpenAPIRuntime.OpenAPIObjectContainer.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .accepted(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Ping an organization webhook + /// + /// This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) + /// to be sent to the hook. + /// + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/pings`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)`. + public func orgsPingWebhook(_ input: Operations.OrgsPingWebhook.Input) async throws -> Operations.OrgsPingWebhook.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsPingWebhook.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/hooks/{}/pings", + parameters: [ + input.path.org, + input.path.hookId + ] ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "timestamp_increment", - value: input.query.timestampIncrement + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post ) + suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -2670,9 +2842,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 204: + return .noContent(.init()) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApiInsightsGetTimeStatsByUser.Output.Ok.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2682,7 +2856,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ApiInsightsTimeStats.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -2691,7 +2865,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2704,19 +2878,19 @@ public struct Client: APIProtocol { } ) } - /// Get time stats by actor + /// Get route stats by actor /// - /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. + /// Get API request count statistics for an actor broken down by route within a specified time frame. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. - public func apiInsightsGetTimeStatsByActor(_ input: Operations.ApiInsightsGetTimeStatsByActor.Input) async throws -> Operations.ApiInsightsGetTimeStatsByActor.Output { + /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. + public func apiInsightsGetRouteStatsByActor(_ input: Operations.ApiInsightsGetRouteStatsByActor.Input) async throws -> Operations.ApiInsightsGetRouteStatsByActor.Output { try await client.send( input: input, - forOperation: Operations.ApiInsightsGetTimeStatsByActor.id, + forOperation: Operations.ApiInsightsGetRouteStatsByActor.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/insights/api/time-stats/{}/{}", + template: "/orgs/{}/insights/api/route-stats/{}/{}", parameters: [ input.path.org, input.path.actorType, @@ -2746,8 +2920,36 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "timestamp_increment", - value: input.query.timestampIncrement + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "direction", + value: input.query.direction + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sort", + value: input.query.sort + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "api_route_substring", + value: input.query.apiRouteSubstring ) converter.setAcceptHeader( in: &request.headerFields, @@ -2759,7 +2961,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApiInsightsGetTimeStatsByActor.Output.Ok.Body + let body: Operations.ApiInsightsGetRouteStatsByActor.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2769,7 +2971,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ApiInsightsTimeStats.self, + Components.Schemas.ApiInsightsRouteStats.self, from: responseBody, transforming: { value in .json(value) @@ -2791,22 +2993,21 @@ public struct Client: APIProtocol { } ) } - /// Get user stats + /// Get subject stats /// - /// Get API usage statistics within an organization for a user broken down by the type of access. + /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. - public func apiInsightsGetUserStats(_ input: Operations.ApiInsightsGetUserStats.Input) async throws -> Operations.ApiInsightsGetUserStats.Output { + /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. + public func apiInsightsGetSubjectStats(_ input: Operations.ApiInsightsGetSubjectStats.Input) async throws -> Operations.ApiInsightsGetSubjectStats.Output { try await client.send( input: input, - forOperation: Operations.ApiInsightsGetUserStats.id, + forOperation: Operations.ApiInsightsGetSubjectStats.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/insights/api/user-stats/{}", + template: "/orgs/{}/insights/api/subject-stats", parameters: [ - input.path.org, - input.path.userId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -2860,8 +3061,8 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "actor_name_substring", - value: input.query.actorNameSubstring + name: "subject_name_substring", + value: input.query.subjectNameSubstring ) converter.setAcceptHeader( in: &request.headerFields, @@ -2873,7 +3074,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApiInsightsGetUserStats.Output.Ok.Body + let body: Operations.ApiInsightsGetSubjectStats.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2883,7 +3084,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ApiInsightsUserStats.self, + Components.Schemas.ApiInsightsSubjectStats.self, from: responseBody, transforming: { value in .json(value) @@ -2905,24 +3106,19 @@ public struct Client: APIProtocol { } ) } - /// List app installations for an organization - /// - /// Lists all GitHub Apps in an organization. The installation count includes - /// all GitHub Apps installed on repositories in the organization. - /// - /// The authenticated user must be an organization owner to use this endpoint. + /// Get summary stats /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint. + /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. /// - /// - Remark: HTTP `GET /orgs/{org}/installations`. - /// - Remark: Generated from `#/paths//orgs/{org}/installations/get(orgs/list-app-installations)`. - public func orgsListAppInstallations(_ input: Operations.OrgsListAppInstallations.Input) async throws -> Operations.OrgsListAppInstallations.Output { + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. + public func apiInsightsGetSummaryStats(_ input: Operations.ApiInsightsGetSummaryStats.Input) async throws -> Operations.ApiInsightsGetSummaryStats.Output { try await client.send( input: input, - forOperation: Operations.OrgsListAppInstallations.id, + forOperation: Operations.ApiInsightsGetSummaryStats.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/installations", + template: "/orgs/{}/insights/api/summary-stats", parameters: [ input.path.org ] @@ -2936,15 +3132,15 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "per_page", - value: input.query.perPage + name: "min_timestamp", + value: input.query.minTimestamp ) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "page", - value: input.query.page + name: "max_timestamp", + value: input.query.maxTimestamp ) converter.setAcceptHeader( in: &request.headerFields, @@ -2955,13 +3151,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.OrgsListAppInstallations.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListAppInstallations.Output.Ok.Body + let body: Operations.ApiInsightsGetSummaryStats.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2971,7 +3162,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.OrgsListAppInstallations.Output.Ok.Body.JsonPayload.self, + Components.Schemas.ApiInsightsSummaryStats.self, from: responseBody, transforming: { value in .json(value) @@ -2980,10 +3171,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2996,24 +3184,22 @@ public struct Client: APIProtocol { } ) } - /// List pending organization invitations + /// Get summary stats by user /// - /// The return hash contains a `role` field which refers to the Organization - /// Invitation role and will be one of the following values: `direct_member`, `admin`, - /// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub - /// member, the `login` field in the return hash will be `null`. + /// Get overall statistics of API requests within the organization for a user. /// - /// - Remark: HTTP `GET /orgs/{org}/invitations`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`. - public func orgsListPendingInvitations(_ input: Operations.OrgsListPendingInvitations.Input) async throws -> Operations.OrgsListPendingInvitations.Output { + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. + public func apiInsightsGetSummaryStatsByUser(_ input: Operations.ApiInsightsGetSummaryStatsByUser.Input) async throws -> Operations.ApiInsightsGetSummaryStatsByUser.Output { try await client.send( input: input, - forOperation: Operations.OrgsListPendingInvitations.id, + forOperation: Operations.ApiInsightsGetSummaryStatsByUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/invitations", + template: "/orgs/{}/insights/api/summary-stats/users/{}", parameters: [ - input.path.org + input.path.org, + input.path.userId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3025,29 +3211,15 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "role", - value: input.query.role + name: "min_timestamp", + value: input.query.minTimestamp ) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "invitation_source", - value: input.query.invitationSource + name: "max_timestamp", + value: input.query.maxTimestamp ) converter.setAcceptHeader( in: &request.headerFields, @@ -3058,38 +3230,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.OrgsListPendingInvitations.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListPendingInvitations.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.OrganizationInvitation].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3099,7 +3241,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ApiInsightsSummaryStats.self, from: responseBody, transforming: { value in .json(value) @@ -3108,7 +3250,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3121,97 +3263,55 @@ public struct Client: APIProtocol { } ) } - /// Create an organization invitation - /// - /// Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. + /// Get summary stats by actor /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" - /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. /// - /// - Remark: HTTP `POST /orgs/{org}/invitations`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)`. - public func orgsCreateInvitation(_ input: Operations.OrgsCreateInvitation.Input) async throws -> Operations.OrgsCreateInvitation.Output { + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. + public func apiInsightsGetSummaryStatsByActor(_ input: Operations.ApiInsightsGetSummaryStatsByActor.Input) async throws -> Operations.ApiInsightsGetSummaryStatsByActor.Output { try await client.send( input: input, - forOperation: Operations.OrgsCreateInvitation.id, + forOperation: Operations.ApiInsightsGetSummaryStatsByActor.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/invitations", + template: "/orgs/{}/insights/api/summary-stats/{}/{}", parameters: [ - input.path.org + input.path.org, + input.path.actorType, + input.path.actorId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.minTimestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.maxTimestamp + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case .none: - body = nil - case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsCreateInvitation.Output.Created.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.OrganizationInvitation.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - case 404: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3221,7 +3321,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ApiInsightsSummaryStats.self, from: responseBody, transforming: { value in .json(value) @@ -3230,7 +3330,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3243,31 +3343,49 @@ public struct Client: APIProtocol { } ) } - /// Cancel an organization invitation - /// - /// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. + /// Get time stats /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). + /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. /// - /// - Remark: HTTP `DELETE /orgs/{org}/invitations/{invitation_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)`. - public func orgsCancelInvitation(_ input: Operations.OrgsCancelInvitation.Input) async throws -> Operations.OrgsCancelInvitation.Output { + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. + public func apiInsightsGetTimeStats(_ input: Operations.ApiInsightsGetTimeStats.Input) async throws -> Operations.ApiInsightsGetTimeStats.Output { try await client.send( input: input, - forOperation: Operations.OrgsCancelInvitation.id, + forOperation: Operations.ApiInsightsGetTimeStats.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/invitations/{}", + template: "/orgs/{}/insights/api/time-stats", parameters: [ - input.path.org, - input.path.invitationId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.minTimestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.maxTimestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "timestamp_increment", + value: input.query.timestampIncrement + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -3276,33 +3394,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - case 404: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.ApiInsightsGetTimeStats.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3312,7 +3406,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ApiInsightsTimeStats.self, from: responseBody, transforming: { value in .json(value) @@ -3321,7 +3415,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3334,22 +3428,22 @@ public struct Client: APIProtocol { } ) } - /// List organization invitation teams + /// Get time stats by user /// - /// List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. + /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. /// - /// - Remark: HTTP `GET /orgs/{org}/invitations/{invitation_id}/teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)`. - public func orgsListInvitationTeams(_ input: Operations.OrgsListInvitationTeams.Input) async throws -> Operations.OrgsListInvitationTeams.Output { + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. + public func apiInsightsGetTimeStatsByUser(_ input: Operations.ApiInsightsGetTimeStatsByUser.Input) async throws -> Operations.ApiInsightsGetTimeStatsByUser.Output { try await client.send( input: input, - forOperation: Operations.OrgsListInvitationTeams.id, + forOperation: Operations.ApiInsightsGetTimeStatsByUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/invitations/{}/teams", + template: "/orgs/{}/insights/api/time-stats/users/{}", parameters: [ input.path.org, - input.path.invitationId + input.path.userId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3361,15 +3455,22 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "per_page", - value: input.query.perPage + name: "min_timestamp", + value: input.query.minTimestamp ) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "page", - value: input.query.page + name: "max_timestamp", + value: input.query.maxTimestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "timestamp_increment", + value: input.query.timestampIncrement ) converter.setAcceptHeader( in: &request.headerFields, @@ -3380,38 +3481,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.OrgsListInvitationTeams.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListInvitationTeams.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Team].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.ApiInsightsGetTimeStatsByUser.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3421,7 +3492,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ApiInsightsTimeStats.self, from: responseBody, transforming: { value in .json(value) @@ -3430,7 +3501,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3443,21 +3514,23 @@ public struct Client: APIProtocol { } ) } - /// List issue types for an organization + /// Get time stats by actor /// - /// Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint. + /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. /// - /// - Remark: HTTP `GET /orgs/{org}/issue-types`. - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/get(orgs/list-issue-types)`. - public func orgsListIssueTypes(_ input: Operations.OrgsListIssueTypes.Input) async throws -> Operations.OrgsListIssueTypes.Output { + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. + public func apiInsightsGetTimeStatsByActor(_ input: Operations.ApiInsightsGetTimeStatsByActor.Input) async throws -> Operations.ApiInsightsGetTimeStatsByActor.Output { try await client.send( input: input, - forOperation: Operations.OrgsListIssueTypes.id, + forOperation: Operations.ApiInsightsGetTimeStatsByActor.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/issue-types", + template: "/orgs/{}/insights/api/time-stats/{}/{}", parameters: [ - input.path.org + input.path.org, + input.path.actorType, + input.path.actorId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3465,6 +3538,27 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.minTimestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.maxTimestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "timestamp_increment", + value: input.query.timestampIncrement + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -3475,7 +3569,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListIssueTypes.Output.Ok.Body + let body: Operations.ApiInsightsGetTimeStatsByActor.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3485,7 +3579,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.IssueType].self, + Components.Schemas.ApiInsightsTimeStats.self, from: responseBody, transforming: { value in .json(value) @@ -3495,9 +3589,101 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - case 404: + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get user stats + /// + /// Get API usage statistics within an organization for a user broken down by the type of access. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. + public func apiInsightsGetUserStats(_ input: Operations.ApiInsightsGetUserStats.Input) async throws -> Operations.ApiInsightsGetUserStats.Output { + try await client.send( + input: input, + forOperation: Operations.ApiInsightsGetUserStats.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/user-stats/{}", + parameters: [ + input.path.org, + input.path.userId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.minTimestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.maxTimestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "direction", + value: input.query.direction + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sort", + value: input.query.sort + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "actor_name_substring", + value: input.query.actorNameSubstring + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.ApiInsightsGetUserStats.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3507,7 +3693,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ApiInsightsUserStats.self, from: responseBody, transforming: { value in .json(value) @@ -3516,7 +3702,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3529,53 +3715,63 @@ public struct Client: APIProtocol { } ) } - /// Create issue type for an organization + /// List app installations for an organization /// - /// Create a new issue type for an organization. + /// Lists all GitHub Apps in an organization. The installation count includes + /// all GitHub Apps installed on repositories in the organization. /// - /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// The authenticated user must be an organization owner to use this endpoint. /// - /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and - /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/issue-types`. - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)`. - public func orgsCreateIssueType(_ input: Operations.OrgsCreateIssueType.Input) async throws -> Operations.OrgsCreateIssueType.Output { + /// - Remark: HTTP `GET /orgs/{org}/installations`. + /// - Remark: Generated from `#/paths//orgs/{org}/installations/get(orgs/list-app-installations)`. + public func orgsListAppInstallations(_ input: Operations.OrgsListAppInstallations.Input) async throws -> Operations.OrgsListAppInstallations.Output { try await client.send( input: input, - forOperation: Operations.OrgsCreateIssueType.id, + forOperation: Operations.OrgsListAppInstallations.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/issue-types", + template: "/orgs/{}/installations", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.OrgsListAppInstallations.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsCreateIssueType.Output.Ok.Body + let body: Operations.OrgsListAppInstallations.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3585,7 +3781,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.IssueType.self, + Operations.OrgsListAppInstallations.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -3594,10 +3790,91 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 404: + return .ok(.init( + headers: headers, + body: body + )) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List pending organization invitations + /// + /// The return hash contains a `role` field which refers to the Organization + /// Invitation role and will be one of the following values: `direct_member`, `admin`, + /// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub + /// member, the `login` field in the return hash will be `null`. + /// + /// - Remark: HTTP `GET /orgs/{org}/invitations`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`. + public func orgsListPendingInvitations(_ input: Operations.OrgsListPendingInvitations.Input) async throws -> Operations.OrgsListPendingInvitations.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsListPendingInvitations.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/invitations", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "role", + value: input.query.role + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "invitation_source", + value: input.query.invitationSource + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.OrgsListPendingInvitations.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.OrgsListPendingInvitations.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3607,7 +3884,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + [Components.Schemas.OrganizationInvitation].self, from: responseBody, transforming: { value in .json(value) @@ -3616,10 +3893,13 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 422: + return .ok(.init( + headers: headers, + body: body + )) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3629,7 +3909,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -3638,7 +3918,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3651,32 +3931,29 @@ public struct Client: APIProtocol { } ) } - /// Update issue type for an organization - /// - /// Updates an issue type for an organization. + /// Create an organization invitation /// - /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. /// - /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and - /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." /// - /// - Remark: HTTP `PUT /orgs/{org}/issue-types/{issue_type_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)`. - public func orgsUpdateIssueType(_ input: Operations.OrgsUpdateIssueType.Input) async throws -> Operations.OrgsUpdateIssueType.Output { + /// - Remark: HTTP `POST /orgs/{org}/invitations`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)`. + public func orgsCreateInvitation(_ input: Operations.OrgsCreateInvitation.Input) async throws -> Operations.OrgsCreateInvitation.Output { try await client.send( input: input, - forOperation: Operations.OrgsUpdateIssueType.id, + forOperation: Operations.OrgsCreateInvitation.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/issue-types/{}", + template: "/orgs/{}/invitations", parameters: [ - input.path.org, - input.path.issueTypeId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -3685,8 +3962,10 @@ public struct Client: APIProtocol { ) let body: OpenAPIRuntime.HTTPBody? switch input.body { + case .none: + body = nil case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( + body = try converter.setOptionalRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -3696,9 +3975,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsUpdateIssueType.Output.Ok.Body + let body: Operations.OrgsCreateInvitation.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3708,7 +3987,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.IssueType.self, + Components.Schemas.OrganizationInvitation.self, from: responseBody, transforming: { value in .json(value) @@ -3717,10 +3996,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 404: + return .created(.init(body: body)) + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3730,7 +4009,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ValidationError.self, from: responseBody, transforming: { value in .json(value) @@ -3739,10 +4018,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 422: + return .unprocessableContent(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3752,7 +4031,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -3761,7 +4040,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3774,27 +4053,24 @@ public struct Client: APIProtocol { } ) } - /// Delete issue type for an organization - /// - /// Deletes an issue type for an organization. + /// Cancel an organization invitation /// - /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. /// - /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and - /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). /// - /// - Remark: HTTP `DELETE /orgs/{org}/issue-types/{issue_type_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)`. - public func orgsDeleteIssueType(_ input: Operations.OrgsDeleteIssueType.Input) async throws -> Operations.OrgsDeleteIssueType.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/invitations/{invitation_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)`. + public func orgsCancelInvitation(_ input: Operations.OrgsCancelInvitation.Input) async throws -> Operations.OrgsCancelInvitation.Output { try await client.send( input: input, - forOperation: Operations.OrgsDeleteIssueType.id, + forOperation: Operations.OrgsCancelInvitation.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/issue-types/{}", + template: "/orgs/{}/invitations/{}", parameters: [ input.path.org, - input.path.issueTypeId + input.path.invitationId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3814,7 +4090,7 @@ public struct Client: APIProtocol { return .noContent(.init()) case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3824,7 +4100,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, + Components.Schemas.ValidationError.self, from: responseBody, transforming: { value in .json(value) @@ -3868,21 +4144,22 @@ public struct Client: APIProtocol { } ) } - /// List organization members + /// List organization invitation teams /// - /// List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. + /// List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. /// - /// - Remark: HTTP `GET /orgs/{org}/members`. - /// - Remark: Generated from `#/paths//orgs/{org}/members/get(orgs/list-members)`. - public func orgsListMembers(_ input: Operations.OrgsListMembers.Input) async throws -> Operations.OrgsListMembers.Output { + /// - Remark: HTTP `GET /orgs/{org}/invitations/{invitation_id}/teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)`. + public func orgsListInvitationTeams(_ input: Operations.OrgsListInvitationTeams.Input) async throws -> Operations.OrgsListInvitationTeams.Output { try await client.send( input: input, - forOperation: Operations.OrgsListMembers.id, + forOperation: Operations.OrgsListInvitationTeams.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/members", + template: "/orgs/{}/invitations/{}/teams", parameters: [ - input.path.org + input.path.org, + input.path.invitationId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3890,20 +4167,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "filter", - value: input.query.filter - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "role", - value: input.query.role - ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -3927,13 +4190,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.OrgsListMembers.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.OrgsListInvitationTeams.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, name: "Link", as: Components.Headers.Link.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListMembers.Output.Ok.Body + let body: Operations.OrgsListInvitationTeams.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3943,7 +4206,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.SimpleUser].self, + [Components.Schemas.Team].self, from: responseBody, transforming: { value in .json(value) @@ -3956,9 +4219,9 @@ public struct Client: APIProtocol { headers: headers, body: body )) - case 422: + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3968,7 +4231,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -3977,7 +4240,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3990,22 +4253,21 @@ public struct Client: APIProtocol { } ) } - /// Check organization membership for a user + /// List issue types for an organization /// - /// Check if a user is, publicly or privately, a member of the organization. + /// Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/members/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/get(orgs/check-membership-for-user)`. - public func orgsCheckMembershipForUser(_ input: Operations.OrgsCheckMembershipForUser.Input) async throws -> Operations.OrgsCheckMembershipForUser.Output { + /// - Remark: HTTP `GET /orgs/{org}/issue-types`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/get(orgs/list-issue-types)`. + public func orgsListIssueTypes(_ input: Operations.OrgsListIssueTypes.Input) async throws -> Operations.OrgsListIssueTypes.Output { try await client.send( input: input, - forOperation: Operations.OrgsCheckMembershipForUser.id, + forOperation: Operations.OrgsListIssueTypes.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/members/{}", + template: "/orgs/{}/issue-types", parameters: [ - input.path.org, - input.path.username + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4013,69 +4275,39 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 302: - let headers: Operations.OrgsCheckMembershipForUser.Output.Found.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Location", - as: Swift.String.self - )) - return .found(.init(headers: headers)) - case 404: - return .notFound(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsListIssueTypes.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] ) - } - } - ) - } - /// Remove an organization member - /// - /// Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/members/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)`. - public func orgsRemoveMember(_ input: Operations.OrgsRemoveMember.Input) async throws -> Operations.OrgsRemoveMember.Output { - try await client.send( - input: input, - forOperation: Operations.OrgsRemoveMember.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/members/{}", - parameters: [ - input.path.org, - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - case 403: + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.IssueType].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4094,7 +4326,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4107,40 +4339,53 @@ public struct Client: APIProtocol { } ) } - /// Get organization membership for a user + /// Create issue type for an organization /// - /// In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status. + /// Create a new issue type for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/memberships/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/get(orgs/get-membership-for-user)`. - public func orgsGetMembershipForUser(_ input: Operations.OrgsGetMembershipForUser.Input) async throws -> Operations.OrgsGetMembershipForUser.Output { + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/issue-types`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)`. + public func orgsCreateIssueType(_ input: Operations.OrgsCreateIssueType.Input) async throws -> Operations.OrgsCreateIssueType.Output { try await client.send( input: input, - forOperation: Operations.OrgsGetMembershipForUser.id, + forOperation: Operations.OrgsCreateIssueType.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/memberships/{}", + template: "/orgs/{}/issue-types", parameters: [ - input.path.org, - input.path.username + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsGetMembershipForUser.Output.Ok.Body + let body: Operations.OrgsCreateIssueType.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4150,7 +4395,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.OrgMembership.self, + Components.Schemas.IssueType.self, from: responseBody, transforming: { value in .json(value) @@ -4182,9 +4427,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 403: + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Components.Responses.ValidationFailedSimple.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4194,7 +4439,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ValidationErrorSimple.self, from: responseBody, transforming: { value in .json(value) @@ -4203,7 +4448,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4216,30 +4461,27 @@ public struct Client: APIProtocol { } ) } - /// Set organization membership for a user - /// - /// Only authenticated organization owners can add a member to the organization or update the member's role. + /// Update issue type for an organization /// - /// * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user) will be `pending` until they accept the invitation. - /// - /// * Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent. + /// Updates an issue type for an organization. /// - /// **Rate limits** + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). /// - /// To prevent abuse, organization owners are limited to creating 50 organization invitations for an organization within a 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/memberships/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/put(orgs/set-membership-for-user)`. - public func orgsSetMembershipForUser(_ input: Operations.OrgsSetMembershipForUser.Input) async throws -> Operations.OrgsSetMembershipForUser.Output { + /// - Remark: HTTP `PUT /orgs/{org}/issue-types/{issue_type_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)`. + public func orgsUpdateIssueType(_ input: Operations.OrgsUpdateIssueType.Input) async throws -> Operations.OrgsUpdateIssueType.Output { try await client.send( input: input, - forOperation: Operations.OrgsSetMembershipForUser.id, + forOperation: Operations.OrgsUpdateIssueType.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/memberships/{}", + template: "/orgs/{}/issue-types/{}", parameters: [ input.path.org, - input.path.username + input.path.issueTypeId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4253,10 +4495,8 @@ public struct Client: APIProtocol { ) let body: OpenAPIRuntime.HTTPBody? switch input.body { - case .none: - body = nil case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( + body = try converter.setRequiredRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -4268,7 +4508,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsSetMembershipForUser.Output.Ok.Body + let body: Operations.OrgsUpdateIssueType.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4278,7 +4518,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.OrgMembership.self, + Components.Schemas.IssueType.self, from: responseBody, transforming: { value in .json(value) @@ -4288,9 +4528,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - case 422: + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4300,7 +4540,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -4309,10 +4549,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) - case 403: + return .notFound(.init(body: body)) + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Components.Responses.ValidationFailedSimple.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4322,7 +4562,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ValidationErrorSimple.self, from: responseBody, transforming: { value in .json(value) @@ -4331,7 +4571,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4344,24 +4584,27 @@ public struct Client: APIProtocol { } ) } - /// Remove organization membership for a user + /// Delete issue type for an organization /// - /// In order to remove a user's membership with an organization, the authenticated user must be an organization owner. + /// Deletes an issue type for an organization. /// - /// If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). /// - /// - Remark: HTTP `DELETE /orgs/{org}/memberships/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)`. - public func orgsRemoveMembershipForUser(_ input: Operations.OrgsRemoveMembershipForUser.Input) async throws -> Operations.OrgsRemoveMembershipForUser.Output { + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/issue-types/{issue_type_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)`. + public func orgsDeleteIssueType(_ input: Operations.OrgsDeleteIssueType.Input) async throws -> Operations.OrgsDeleteIssueType.Output { try await client.send( input: input, - forOperation: Operations.OrgsRemoveMembershipForUser.id, + forOperation: Operations.OrgsDeleteIssueType.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/memberships/{}", + template: "/orgs/{}/issue-types/{}", parameters: [ input.path.org, - input.path.username + input.path.issueTypeId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4379,9 +4622,9 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) - case 403: + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Components.Responses.ValidationFailedSimple.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4391,7 +4634,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ValidationErrorSimple.self, from: responseBody, transforming: { value in .json(value) @@ -4400,7 +4643,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) + return .unprocessableContent(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -4435,26 +4678,19 @@ public struct Client: APIProtocol { } ) } - /// Get all organization roles for an organization - /// - /// Lists the organization roles available in this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." - /// - /// To use this endpoint, the authenticated user must be one of: - /// - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. + /// List organization members /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. /// - /// - Remark: HTTP `GET /orgs/{org}/organization-roles`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/get(orgs/list-org-roles)`. - public func orgsListOrgRoles(_ input: Operations.OrgsListOrgRoles.Input) async throws -> Operations.OrgsListOrgRoles.Output { + /// - Remark: HTTP `GET /orgs/{org}/members`. + /// - Remark: Generated from `#/paths//orgs/{org}/members/get(orgs/list-members)`. + public func orgsListMembers(_ input: Operations.OrgsListMembers.Input) async throws -> Operations.OrgsListMembers.Output { try await client.send( input: input, - forOperation: Operations.OrgsListOrgRoles.id, + forOperation: Operations.OrgsListMembers.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/organization-roles", + template: "/orgs/{}/members", parameters: [ input.path.org ] @@ -4464,6 +4700,34 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "filter", + value: input.query.filter + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "role", + value: input.query.role + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -4473,8 +4737,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.OrgsListMembers.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListOrgRoles.Output.Ok.Body + let body: Operations.OrgsListMembers.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4484,29 +4753,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.OrgsListOrgRoles.Output.Ok.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + [Components.Schemas.SimpleUser].self, from: responseBody, transforming: { value in .json(value) @@ -4515,7 +4762,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.ValidationFailed.Body @@ -4550,31 +4800,27 @@ public struct Client: APIProtocol { } ) } - /// Remove all organization roles for a team - /// - /// Removes all assigned organization roles from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. + /// Check organization membership for a user /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Check if a user is, publicly or privately, a member of the organization. /// - /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/teams/{team_slug}`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/delete(orgs/revoke-all-org-roles-team)`. - public func orgsRevokeAllOrgRolesTeam(_ input: Operations.OrgsRevokeAllOrgRolesTeam.Input) async throws -> Operations.OrgsRevokeAllOrgRolesTeam.Output { + /// - Remark: HTTP `GET /orgs/{org}/members/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/get(orgs/check-membership-for-user)`. + public func orgsCheckMembershipForUser(_ input: Operations.OrgsCheckMembershipForUser.Input) async throws -> Operations.OrgsCheckMembershipForUser.Output { try await client.send( input: input, - forOperation: Operations.OrgsRevokeAllOrgRolesTeam.id, + forOperation: Operations.OrgsCheckMembershipForUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/organization-roles/teams/{}", + template: "/orgs/{}/members/{}", parameters: [ input.path.org, - input.path.teamSlug + input.path.username ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) return (request, nil) @@ -4583,6 +4829,15 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) + case 302: + let headers: Operations.OrgsCheckMembershipForUser.Output.Found.Headers = .init(location: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Location", + as: Swift.String.self + )) + return .found(.init(headers: headers)) + case 404: + return .notFound(.init()) default: return .undocumented( statusCode: response.status.code, @@ -4595,44 +4850,64 @@ public struct Client: APIProtocol { } ) } - /// Assign an organization role to a team - /// - /// Assigns an organization role to a team in an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// Remove an organization member /// - /// The authenticated user must be an administrator for the organization to use this endpoint. + /// Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. /// - /// - Remark: HTTP `PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)`. - public func orgsAssignTeamToOrgRole(_ input: Operations.OrgsAssignTeamToOrgRole.Input) async throws -> Operations.OrgsAssignTeamToOrgRole.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/members/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)`. + public func orgsRemoveMember(_ input: Operations.OrgsRemoveMember.Input) async throws -> Operations.OrgsRemoveMember.Output { try await client.send( input: input, - forOperation: Operations.OrgsAssignTeamToOrgRole.id, + forOperation: Operations.OrgsRemoveMember.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/organization-roles/teams/{}/{}", + template: "/orgs/{}/members/{}", parameters: [ input.path.org, - input.path.teamSlug, - input.path.roleId + input.path.username ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .delete ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 204: return .noContent(.init()) - case 404: - return .notFound(.init()) - case 422: - return .unprocessableContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4645,40 +4920,103 @@ public struct Client: APIProtocol { } ) } - /// Remove an organization role from a team - /// - /// Removes an organization role from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. + /// Get organization membership for a user /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status. /// - /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/delete(orgs/revoke-org-role-team)`. - public func orgsRevokeOrgRoleTeam(_ input: Operations.OrgsRevokeOrgRoleTeam.Input) async throws -> Operations.OrgsRevokeOrgRoleTeam.Output { + /// - Remark: HTTP `GET /orgs/{org}/memberships/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/get(orgs/get-membership-for-user)`. + public func orgsGetMembershipForUser(_ input: Operations.OrgsGetMembershipForUser.Input) async throws -> Operations.OrgsGetMembershipForUser.Output { try await client.send( input: input, - forOperation: Operations.OrgsRevokeOrgRoleTeam.id, + forOperation: Operations.OrgsGetMembershipForUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/organization-roles/teams/{}/{}", + template: "/orgs/{}/memberships/{}", parameters: [ input.path.org, - input.path.teamSlug, - input.path.roleId + input.path.username ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsGetMembershipForUser.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.OrgMembership.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4691,23 +5029,27 @@ public struct Client: APIProtocol { } ) } - /// Remove all organization roles for a user + /// Set organization membership for a user /// - /// Revokes all assigned organization roles from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// Only authenticated organization owners can add a member to the organization or update the member's role. /// - /// The authenticated user must be an administrator for the organization to use this endpoint. + /// * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user) will be `pending` until they accept the invitation. + /// + /// * Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// **Rate limits** /// - /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/users/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/delete(orgs/revoke-all-org-roles-user)`. - public func orgsRevokeAllOrgRolesUser(_ input: Operations.OrgsRevokeAllOrgRolesUser.Input) async throws -> Operations.OrgsRevokeAllOrgRolesUser.Output { + /// To prevent abuse, organization owners are limited to creating 50 organization invitations for an organization within a 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. + /// + /// - Remark: HTTP `PUT /orgs/{org}/memberships/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/put(orgs/set-membership-for-user)`. + public func orgsSetMembershipForUser(_ input: Operations.OrgsSetMembershipForUser.Input) async throws -> Operations.OrgsSetMembershipForUser.Output { try await client.send( input: input, - forOperation: Operations.OrgsRevokeAllOrgRolesUser.id, + forOperation: Operations.OrgsSetMembershipForUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/organization-roles/users/{}", + template: "/orgs/{}/memberships/{}", parameters: [ input.path.org, input.path.username @@ -4715,65 +5057,94 @@ public struct Client: APIProtocol { ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .put ) suppressMutabilityWarning(&request) - return (request, nil) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case .none: + body = nil + case let .json(value): + body = try converter.setOptionalRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsSetMembershipForUser.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] ) - } - } - ) - } - /// Assign an organization role to a user - /// - /// Assigns an organization role to a member of an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `PUT /orgs/{org}/organization-roles/users/{username}/{role_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)`. - public func orgsAssignUserToOrgRole(_ input: Operations.OrgsAssignUserToOrgRole.Input) async throws -> Operations.OrgsAssignUserToOrgRole.Output { - try await client.send( - input: input, - forOperation: Operations.OrgsAssignUserToOrgRole.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/organization-roles/users/{}/{}", - parameters: [ - input.path.org, - input.path.username, - input.path.roleId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .put - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - case 404: - return .notFound(.init()) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.OrgMembership.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) case 422: - return .unprocessableContent(.init()) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4786,27 +5157,27 @@ public struct Client: APIProtocol { } ) } - /// Remove an organization role from a user + /// Remove organization membership for a user /// - /// Remove an organization role from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// In order to remove a user's membership with an organization, the authenticated user must be an organization owner. /// - /// The authenticated user must be an administrator for the organization to use this endpoint. + /// If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. /// - /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/delete(orgs/revoke-org-role-user)`. - public func orgsRevokeOrgRoleUser(_ input: Operations.OrgsRevokeOrgRoleUser.Input) async throws -> Operations.OrgsRevokeOrgRoleUser.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/memberships/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)`. + public func orgsRemoveMembershipForUser(_ input: Operations.OrgsRemoveMembershipForUser.Input) async throws -> Operations.OrgsRemoveMembershipForUser.Output { try await client.send( input: input, - forOperation: Operations.OrgsRevokeOrgRoleUser.id, + forOperation: Operations.OrgsRemoveMembershipForUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/organization-roles/users/{}/{}", + template: "/orgs/{}/memberships/{}", parameters: [ input.path.org, - input.path.username, - input.path.roleId + input.path.username ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4814,12 +5185,60 @@ public struct Client: APIProtocol { method: .delete ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 204: return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -4832,9 +5251,9 @@ public struct Client: APIProtocol { } ) } - /// Get an organization role + /// Get all organization roles for an organization /// - /// Gets an organization role that is available to this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// Lists the organization roles available in this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." /// /// To use this endpoint, the authenticated user must be one of: /// @@ -4843,18 +5262,17 @@ public struct Client: APIProtocol { /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/organization-roles/{role_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/get(orgs/get-org-role)`. - public func orgsGetOrgRole(_ input: Operations.OrgsGetOrgRole.Input) async throws -> Operations.OrgsGetOrgRole.Output { + /// - Remark: HTTP `GET /orgs/{org}/organization-roles`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/get(orgs/list-org-roles)`. + public func orgsListOrgRoles(_ input: Operations.OrgsListOrgRoles.Input) async throws -> Operations.OrgsListOrgRoles.Output { try await client.send( input: input, - forOperation: Operations.OrgsGetOrgRole.id, + forOperation: Operations.OrgsListOrgRoles.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/organization-roles/{}", + template: "/orgs/{}/organization-roles", parameters: [ - input.path.org, - input.path.roleId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -4872,7 +5290,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsGetOrgRole.Output.Ok.Body + let body: Operations.OrgsListOrgRoles.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -4882,7 +5300,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.OrganizationRole.self, + Operations.OrgsListOrgRoles.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -4948,89 +5366,1239 @@ public struct Client: APIProtocol { } ) } - /// List teams that are assigned to an organization role + /// Remove all organization roles for a team /// - /// Lists the teams that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// Removes all assigned organization roles from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." /// - /// To use this endpoint, you must be an administrator for the organization. + /// The authenticated user must be an administrator for the organization to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/organization-roles/{role_id}/teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/teams/get(orgs/list-org-role-teams)`. - public func orgsListOrgRoleTeams(_ input: Operations.OrgsListOrgRoleTeams.Input) async throws -> Operations.OrgsListOrgRoleTeams.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/delete(orgs/revoke-all-org-roles-team)`. + public func orgsRevokeAllOrgRolesTeam(_ input: Operations.OrgsRevokeAllOrgRolesTeam.Input) async throws -> Operations.OrgsRevokeAllOrgRolesTeam.Output { try await client.send( input: input, - forOperation: Operations.OrgsListOrgRoleTeams.id, + forOperation: Operations.OrgsRevokeAllOrgRolesTeam.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/organization-roles/{}/teams", + template: "/orgs/{}/organization-roles/teams/{}", parameters: [ input.path.org, - input.path.roleId + input.path.teamSlug ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let headers: Operations.OrgsListOrgRoleTeams.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListOrgRoleTeams.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.TeamRoleAssignment].self, - from: responseBody, - transforming: { value in - .json(value) + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Assign an organization role to a team + /// + /// Assigns an organization role to a team in an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// + /// The authenticated user must be an administrator for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)`. + public func orgsAssignTeamToOrgRole(_ input: Operations.OrgsAssignTeamToOrgRole.Input) async throws -> Operations.OrgsAssignTeamToOrgRole.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsAssignTeamToOrgRole.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/organization-roles/teams/{}/{}", + parameters: [ + input.path.org, + input.path.teamSlug, + input.path.roleId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 404: + return .notFound(.init()) + case 422: + return .unprocessableContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove an organization role from a team + /// + /// Removes an organization role from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// + /// The authenticated user must be an administrator for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/delete(orgs/revoke-org-role-team)`. + public func orgsRevokeOrgRoleTeam(_ input: Operations.OrgsRevokeOrgRoleTeam.Input) async throws -> Operations.OrgsRevokeOrgRoleTeam.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsRevokeOrgRoleTeam.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/organization-roles/teams/{}/{}", + parameters: [ + input.path.org, + input.path.teamSlug, + input.path.roleId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove all organization roles for a user + /// + /// Revokes all assigned organization roles from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// + /// The authenticated user must be an administrator for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/users/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/delete(orgs/revoke-all-org-roles-user)`. + public func orgsRevokeAllOrgRolesUser(_ input: Operations.OrgsRevokeAllOrgRolesUser.Input) async throws -> Operations.OrgsRevokeAllOrgRolesUser.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsRevokeAllOrgRolesUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/organization-roles/users/{}", + parameters: [ + input.path.org, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Assign an organization role to a user + /// + /// Assigns an organization role to a member of an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// + /// The authenticated user must be an administrator for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/organization-roles/users/{username}/{role_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)`. + public func orgsAssignUserToOrgRole(_ input: Operations.OrgsAssignUserToOrgRole.Input) async throws -> Operations.OrgsAssignUserToOrgRole.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsAssignUserToOrgRole.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/organization-roles/users/{}/{}", + parameters: [ + input.path.org, + input.path.username, + input.path.roleId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 404: + return .notFound(.init()) + case 422: + return .unprocessableContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove an organization role from a user + /// + /// Remove an organization role from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// + /// The authenticated user must be an administrator for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/delete(orgs/revoke-org-role-user)`. + public func orgsRevokeOrgRoleUser(_ input: Operations.OrgsRevokeOrgRoleUser.Input) async throws -> Operations.OrgsRevokeOrgRoleUser.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsRevokeOrgRoleUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/organization-roles/users/{}/{}", + parameters: [ + input.path.org, + input.path.username, + input.path.roleId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get an organization role + /// + /// Gets an organization role that is available to this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// + /// To use this endpoint, the authenticated user must be one of: + /// + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/organization-roles/{role_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/get(orgs/get-org-role)`. + public func orgsGetOrgRole(_ input: Operations.OrgsGetOrgRole.Input) async throws -> Operations.OrgsGetOrgRole.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsGetOrgRole.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/organization-roles/{}", + parameters: [ + input.path.org, + input.path.roleId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsGetOrgRole.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.OrganizationRole.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List teams that are assigned to an organization role + /// + /// Lists the teams that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// + /// To use this endpoint, you must be an administrator for the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/organization-roles/{role_id}/teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/teams/get(orgs/list-org-role-teams)`. + public func orgsListOrgRoleTeams(_ input: Operations.OrgsListOrgRoleTeams.Input) async throws -> Operations.OrgsListOrgRoleTeams.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsListOrgRoleTeams.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/organization-roles/{}/teams", + parameters: [ + input.path.org, + input.path.roleId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.OrgsListOrgRoleTeams.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsListOrgRoleTeams.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.TeamRoleAssignment].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 404: + return .notFound(.init()) + case 422: + return .unprocessableContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List users that are assigned to an organization role + /// + /// Lists organization members that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// + /// To use this endpoint, you must be an administrator for the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/organization-roles/{role_id}/users`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/users/get(orgs/list-org-role-users)`. + public func orgsListOrgRoleUsers(_ input: Operations.OrgsListOrgRoleUsers.Input) async throws -> Operations.OrgsListOrgRoleUsers.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsListOrgRoleUsers.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/organization-roles/{}/users", + parameters: [ + input.path.org, + input.path.roleId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.OrgsListOrgRoleUsers.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsListOrgRoleUsers.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.UserRoleAssignment].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 404: + return .notFound(.init()) + case 422: + return .unprocessableContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List outside collaborators for an organization + /// + /// List all users who are outside collaborators of an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/outside_collaborators`. + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/get(orgs/list-outside-collaborators)`. + public func orgsListOutsideCollaborators(_ input: Operations.OrgsListOutsideCollaborators.Input) async throws -> Operations.OrgsListOutsideCollaborators.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsListOutsideCollaborators.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/outside_collaborators", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "filter", + value: input.query.filter + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.OrgsListOutsideCollaborators.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsListOutsideCollaborators.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.SimpleUser].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Convert an organization member to outside collaborator + /// + /// When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." + /// + /// - Remark: HTTP `PUT /orgs/{org}/outside_collaborators/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)`. + public func orgsConvertMemberToOutsideCollaborator(_ input: Operations.OrgsConvertMemberToOutsideCollaborator.Input) async throws -> Operations.OrgsConvertMemberToOutsideCollaborator.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsConvertMemberToOutsideCollaborator.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/outside_collaborators/{}", + parameters: [ + input.path.org, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case .none: + body = nil + case let .json(value): + body = try converter.setOptionalRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 202: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .accepted(.init(body: body)) + case 204: + return .noContent(.init()) + case 403: + return .forbidden(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove outside collaborator from an organization + /// + /// Removing a user from this list will remove them from all the organization's repositories. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/outside_collaborators/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/delete(orgs/remove-outside-collaborator)`. + public func orgsRemoveOutsideCollaborator(_ input: Operations.OrgsRemoveOutsideCollaborator.Input) async throws -> Operations.OrgsRemoveOutsideCollaborator.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsRemoveOutsideCollaborator.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/outside_collaborators/{}", + parameters: [ + input.path.org, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List requests to access organization resources with fine-grained personal access tokens + /// + /// Lists requests from organization members to access organization resources with a fine-grained personal access token. + /// + /// Only GitHub Apps can use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/personal-access-token-requests`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/get(orgs/list-pat-grant-requests)`. + public func orgsListPatGrantRequests(_ input: Operations.OrgsListPatGrantRequests.Input) async throws -> Operations.OrgsListPatGrantRequests.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsListPatGrantRequests.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/personal-access-token-requests", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sort", + value: input.query.sort + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "direction", + value: input.query.direction + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "owner", + value: input.query.owner + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "repository", + value: input.query.repository + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "permission", + value: input.query.permission + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "last_used_before", + value: input.query.lastUsedBefore + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "last_used_after", + value: input.query.lastUsedAfter + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "token_id", + value: input.query.tokenId + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 200: + let headers: Operations.OrgsListPatGrantRequests.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsListPatGrantRequests.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.OrganizationProgrammaticAccessGrantRequest].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Review requests to access organization resources with fine-grained personal access tokens + /// + /// Approves or denies multiple pending requests to access organization resources via a fine-grained personal access token. + /// + /// Only GitHub Apps can use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/personal-access-token-requests`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/post(orgs/review-pat-grant-requests-in-bulk)`. + public func orgsReviewPatGrantRequestsInBulk(_ input: Operations.OrgsReviewPatGrantRequestsInBulk.Input) async throws -> Operations.OrgsReviewPatGrantRequestsInBulk.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsReviewPatGrantRequestsInBulk.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/personal-access-token-requests", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 202: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Accepted.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + OpenAPIRuntime.OpenAPIObjectContainer.self, + from: responseBody, + transforming: { value in + .json(value) } ) default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) - case 404: - return .notFound(.init()) - case 422: - return .unprocessableContent(.init()) + return .accepted(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5043,63 +6611,51 @@ public struct Client: APIProtocol { } ) } - /// List users that are assigned to an organization role - /// - /// Lists organization members that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// Review a request to access organization resources with a fine-grained personal access token /// - /// To use this endpoint, you must be an administrator for the organization. + /// Approves or denies a pending request to access organization resources via a fine-grained personal access token. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Only GitHub Apps can use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/organization-roles/{role_id}/users`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/users/get(orgs/list-org-role-users)`. - public func orgsListOrgRoleUsers(_ input: Operations.OrgsListOrgRoleUsers.Input) async throws -> Operations.OrgsListOrgRoleUsers.Output { + /// - Remark: HTTP `POST /orgs/{org}/personal-access-token-requests/{pat_request_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)`. + public func orgsReviewPatGrantRequest(_ input: Operations.OrgsReviewPatGrantRequest.Input) async throws -> Operations.OrgsReviewPatGrantRequest.Output { try await client.send( input: input, - forOperation: Operations.OrgsListOrgRoleUsers.id, + forOperation: Operations.OrgsReviewPatGrantRequest.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/organization-roles/{}/users", + template: "/orgs/{}/personal-access-token-requests/{}", parameters: [ input.path.org, - input.path.roleId + input.path.patRequestId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let headers: Operations.OrgsListOrgRoleUsers.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) + case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListOrgRoleUsers.Output.Ok.Body + let body: Components.Responses.InternalError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5109,7 +6665,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.UserRoleAssignment].self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -5118,14 +6674,75 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) - case 404: - return .notFound(.init()) + return .internalServerError(.init(body: body)) case 422: - return .unprocessableContent(.init()) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -5138,21 +6755,24 @@ public struct Client: APIProtocol { } ) } - /// List outside collaborators for an organization + /// List repositories requested to be accessed by a fine-grained personal access token /// - /// List all users who are outside collaborators of an organization. + /// Lists the repositories a fine-grained personal access token request is requesting access to. /// - /// - Remark: HTTP `GET /orgs/{org}/outside_collaborators`. - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/get(orgs/list-outside-collaborators)`. - public func orgsListOutsideCollaborators(_ input: Operations.OrgsListOutsideCollaborators.Input) async throws -> Operations.OrgsListOutsideCollaborators.Output { + /// Only GitHub Apps can use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/get(orgs/list-pat-grant-request-repositories)`. + public func orgsListPatGrantRequestRepositories(_ input: Operations.OrgsListPatGrantRequestRepositories.Input) async throws -> Operations.OrgsListPatGrantRequestRepositories.Output { try await client.send( input: input, - forOperation: Operations.OrgsListOutsideCollaborators.id, + forOperation: Operations.OrgsListPatGrantRequestRepositories.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/outside_collaborators", + template: "/orgs/{}/personal-access-token-requests/{}/repositories", parameters: [ - input.path.org + input.path.org, + input.path.patRequestId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -5160,13 +6780,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "filter", - value: input.query.filter - ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -5189,14 +6802,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let headers: Operations.OrgsListOutsideCollaborators.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) + case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListOutsideCollaborators.Output.Ok.Body + let body: Components.Responses.InternalError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5206,76 +6814,19 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.SimpleUser].self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) } ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Convert an organization member to outside collaborator - /// - /// When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." - /// - /// - Remark: HTTP `PUT /orgs/{org}/outside_collaborators/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)`. - public func orgsConvertMemberToOutsideCollaborator(_ input: Operations.OrgsConvertMemberToOutsideCollaborator.Input) async throws -> Operations.OrgsConvertMemberToOutsideCollaborator.Output { - try await client.send( - input: input, - forOperation: Operations.OrgsConvertMemberToOutsideCollaborator.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/outside_collaborators/{}", - parameters: [ - input.path.org, - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .put - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case .none: - body = nil - case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 202: + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5285,7 +6836,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -5294,14 +6845,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .accepted(.init(body: body)) - case 204: - return .noContent(.init()) + return .notFound(.init(body: body)) case 403: - return .forbidden(.init()) - case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5320,55 +6867,15 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Remove outside collaborator from an organization - /// - /// Removing a user from this list will remove them from all the organization's repositories. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/outside_collaborators/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/delete(orgs/remove-outside-collaborator)`. - public func orgsRemoveOutsideCollaborator(_ input: Operations.OrgsRemoveOutsideCollaborator.Input) async throws -> Operations.OrgsRemoveOutsideCollaborator.Output { - try await client.send( - input: input, - forOperation: Operations.OrgsRemoveOutsideCollaborator.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/outside_collaborators/{}", - parameters: [ - input.path.org, - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - case 422: + return .forbidden(.init(body: body)) + case 200: + let headers: Operations.OrgsListPatGrantRequestRepositories.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent.Body + let body: Operations.OrgsListPatGrantRequestRepositories.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5378,7 +6885,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent.Body.JsonPayload.self, + [Components.Schemas.MinimalRepository].self, from: responseBody, transforming: { value in .json(value) @@ -5387,7 +6894,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) default: return .undocumented( statusCode: response.status.code, @@ -5400,21 +6910,21 @@ public struct Client: APIProtocol { } ) } - /// List requests to access organization resources with fine-grained personal access tokens + /// List fine-grained personal access tokens with access to organization resources /// - /// Lists requests from organization members to access organization resources with a fine-grained personal access token. + /// Lists approved fine-grained personal access tokens owned by organization members that can access organization resources. /// /// Only GitHub Apps can use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/personal-access-token-requests`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/get(orgs/list-pat-grant-requests)`. - public func orgsListPatGrantRequests(_ input: Operations.OrgsListPatGrantRequests.Input) async throws -> Operations.OrgsListPatGrantRequests.Output { + /// - Remark: HTTP `GET /orgs/{org}/personal-access-tokens`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/get(orgs/list-pat-grants)`. + public func orgsListPatGrants(_ input: Operations.OrgsListPatGrants.Input) async throws -> Operations.OrgsListPatGrants.Output { try await client.send( input: input, - forOperation: Operations.OrgsListPatGrantRequests.id, + forOperation: Operations.OrgsListPatGrants.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/personal-access-token-requests", + template: "/orgs/{}/personal-access-tokens", parameters: [ input.path.org ] @@ -5591,13 +7101,13 @@ public struct Client: APIProtocol { } return .forbidden(.init(body: body)) case 200: - let headers: Operations.OrgsListPatGrantRequests.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.OrgsListPatGrants.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, name: "Link", as: Components.Headers.Link.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListPatGrantRequests.Output.Ok.Body + let body: Operations.OrgsListPatGrants.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5607,7 +7117,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.OrganizationProgrammaticAccessGrantRequest].self, + [Components.Schemas.OrganizationProgrammaticAccessGrant].self, from: responseBody, transforming: { value in .json(value) @@ -5632,21 +7142,21 @@ public struct Client: APIProtocol { } ) } - /// Review requests to access organization resources with fine-grained personal access tokens + /// Update the access to organization resources via fine-grained personal access tokens /// - /// Approves or denies multiple pending requests to access organization resources via a fine-grained personal access token. + /// Updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access. /// /// Only GitHub Apps can use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/personal-access-token-requests`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/post(orgs/review-pat-grant-requests-in-bulk)`. - public func orgsReviewPatGrantRequestsInBulk(_ input: Operations.OrgsReviewPatGrantRequestsInBulk.Input) async throws -> Operations.OrgsReviewPatGrantRequestsInBulk.Output { + /// - Remark: HTTP `POST /orgs/{org}/personal-access-tokens`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/post(orgs/update-pat-accesses)`. + public func orgsUpdatePatAccesses(_ input: Operations.OrgsUpdatePatAccesses.Input) async throws -> Operations.OrgsUpdatePatAccesses.Output { try await client.send( input: input, - forOperation: Operations.OrgsReviewPatGrantRequestsInBulk.id, + forOperation: Operations.OrgsUpdatePatAccesses.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/personal-access-token-requests", + template: "/orgs/{}/personal-access-tokens", parameters: [ input.path.org ] @@ -5695,28 +7205,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .internalServerError(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -5739,129 +7227,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) case 202: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Accepted.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - OpenAPIRuntime.OpenAPIObjectContainer.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .accepted(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Review a request to access organization resources with a fine-grained personal access token - /// - /// Approves or denies a pending request to access organization resources via a fine-grained personal access token. - /// - /// Only GitHub Apps can use this endpoint. - /// - /// - Remark: HTTP `POST /orgs/{org}/personal-access-token-requests/{pat_request_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)`. - public func orgsReviewPatGrantRequest(_ input: Operations.OrgsReviewPatGrantRequest.Input) async throws -> Operations.OrgsReviewPatGrantRequest.Output { - try await client.send( - input: input, - forOperation: Operations.OrgsReviewPatGrantRequest.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/personal-access-token-requests/{}", - parameters: [ - input.path.org, - input.path.patRequestId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 500: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.InternalError.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .internalServerError(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.Accepted.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5871,7 +7239,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + OpenAPIRuntime.OpenAPIObjectContainer.self, from: responseBody, transforming: { value in .json(value) @@ -5880,10 +7248,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) - case 404: + return .accepted(.init(body: body)) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5902,10 +7270,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 403: + return .forbidden(.init(body: body)) + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -5915,7 +7283,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ValidationError.self, from: responseBody, transforming: { value in .json(value) @@ -5924,9 +7292,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 204: - return .noContent(.init()) + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5939,50 +7305,45 @@ public struct Client: APIProtocol { } ) } - /// List repositories requested to be accessed by a fine-grained personal access token + /// Update the access a fine-grained personal access token has to organization resources /// - /// Lists the repositories a fine-grained personal access token request is requesting access to. + /// Updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access. /// /// Only GitHub Apps can use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/get(orgs/list-pat-grant-request-repositories)`. - public func orgsListPatGrantRequestRepositories(_ input: Operations.OrgsListPatGrantRequestRepositories.Input) async throws -> Operations.OrgsListPatGrantRequestRepositories.Output { + /// - Remark: HTTP `POST /orgs/{org}/personal-access-tokens/{pat_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)`. + public func orgsUpdatePatAccess(_ input: Operations.OrgsUpdatePatAccess.Input) async throws -> Operations.OrgsUpdatePatAccess.Output { try await client.send( input: input, - forOperation: Operations.OrgsListPatGrantRequestRepositories.id, + forOperation: Operations.OrgsUpdatePatAccess.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/personal-access-token-requests/{}/repositories", + template: "/orgs/{}/personal-access-tokens/{}", parameters: [ input.path.org, - input.path.patRequestId + input.path.patId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { @@ -6030,6 +7391,8 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 204: + return .noContent(.init()) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -6052,14 +7415,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .forbidden(.init(body: body)) - case 200: - let headers: Operations.OrgsListPatGrantRequestRepositories.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListPatGrantRequestRepositories.Output.Ok.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6069,7 +7427,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.MinimalRepository].self, + Components.Schemas.ValidationError.self, from: responseBody, transforming: { value in .json(value) @@ -6078,10 +7436,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -6094,23 +7449,24 @@ public struct Client: APIProtocol { } ) } - /// List fine-grained personal access tokens with access to organization resources + /// List repositories a fine-grained personal access token has access to /// - /// Lists approved fine-grained personal access tokens owned by organization members that can access organization resources. + /// Lists the repositories a fine-grained personal access token has access to. /// /// Only GitHub Apps can use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/personal-access-tokens`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/get(orgs/list-pat-grants)`. - public func orgsListPatGrants(_ input: Operations.OrgsListPatGrants.Input) async throws -> Operations.OrgsListPatGrants.Output { + /// - Remark: HTTP `GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/repositories/get(orgs/list-pat-grant-repositories)`. + public func orgsListPatGrantRepositories(_ input: Operations.OrgsListPatGrantRepositories.Input) async throws -> Operations.OrgsListPatGrantRepositories.Output { try await client.send( input: input, - forOperation: Operations.OrgsListPatGrants.id, + forOperation: Operations.OrgsListPatGrantRepositories.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/personal-access-tokens", + template: "/orgs/{}/personal-access-tokens/{}/repositories", parameters: [ - input.path.org + input.path.org, + input.path.patId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -6132,62 +7488,6 @@ public struct Client: APIProtocol { name: "page", value: input.query.page ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "sort", - value: input.query.sort - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "direction", - value: input.query.direction - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "owner", - value: input.query.owner - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "repository", - value: input.query.repository - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "permission", - value: input.query.permission - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "last_used_before", - value: input.query.lastUsedBefore - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "last_used_after", - value: input.query.lastUsedAfter - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "token_id", - value: input.query.tokenId - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -6218,28 +7518,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .internalServerError(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -6285,13 +7563,13 @@ public struct Client: APIProtocol { } return .forbidden(.init(body: body)) case 200: - let headers: Operations.OrgsListPatGrants.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.OrgsListPatGrantRepositories.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, name: "Link", as: Components.Headers.Link.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListPatGrants.Output.Ok.Body + let body: Operations.OrgsListPatGrantRepositories.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6301,7 +7579,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.OrganizationProgrammaticAccessGrant].self, + [Components.Schemas.MinimalRepository].self, from: responseBody, transforming: { value in .json(value) @@ -6326,94 +7604,40 @@ public struct Client: APIProtocol { } ) } - /// Update the access to organization resources via fine-grained personal access tokens - /// - /// Updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access. + /// Get all custom properties for an organization /// - /// Only GitHub Apps can use this endpoint. + /// Gets all custom properties defined for an organization. + /// Organization members can read these properties. /// - /// - Remark: HTTP `POST /orgs/{org}/personal-access-tokens`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/post(orgs/update-pat-accesses)`. - public func orgsUpdatePatAccesses(_ input: Operations.OrgsUpdatePatAccesses.Input) async throws -> Operations.OrgsUpdatePatAccesses.Output { + /// - Remark: HTTP `GET /orgs/{org}/properties/schema`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)`. + public func orgsCustomPropertiesForReposGetOrganizationDefinitions(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output { try await client.send( input: input, - forOperation: Operations.OrgsUpdatePatAccesses.id, + forOperation: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/personal-access-tokens", + template: "/orgs/{}/properties/schema", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 500: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.InternalError.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .internalServerError(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 202: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Accepted.Body + let body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6423,7 +7647,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - OpenAPIRuntime.OpenAPIObjectContainer.self, + [Components.Schemas.CustomProperty].self, from: responseBody, transforming: { value in .json(value) @@ -6432,7 +7656,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .accepted(.init(body: body)) + return .ok(.init(body: body)) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -6455,9 +7679,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .forbidden(.init(body: body)) - case 422: + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6467,7 +7691,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -6476,7 +7700,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -6489,29 +7713,34 @@ public struct Client: APIProtocol { } ) } - /// Update the access a fine-grained personal access token has to organization resources + /// Create or update custom properties for an organization /// - /// Updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access. + /// Creates new or updates existing custom properties defined for an organization in a batch. /// - /// Only GitHub Apps can use this endpoint. + /// If the property already exists, the existing property will be replaced with the new values. + /// Missing optional values will fall back to default values, previous values will be overwritten. + /// E.g. if a property exists with `values_editable_by: org_and_repo_actors` and it's updated without specifying `values_editable_by`, it will be updated to default value `org_actors`. /// - /// - Remark: HTTP `POST /orgs/{org}/personal-access-tokens/{pat_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)`. - public func orgsUpdatePatAccess(_ input: Operations.OrgsUpdatePatAccess.Input) async throws -> Operations.OrgsUpdatePatAccess.Output { + /// To use this endpoint, the authenticated user must be one of: + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/properties/schema`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output { try await client.send( input: input, - forOperation: Operations.OrgsUpdatePatAccess.id, + forOperation: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/personal-access-tokens/{}", + template: "/orgs/{}/properties/schema", parameters: [ - input.path.org, - input.path.patId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .patch ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -6531,31 +7760,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 500: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.InternalError.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .internalServerError(.init(body: body)) - case 404: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6565,7 +7772,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + [Components.Schemas.CustomProperty].self, from: responseBody, transforming: { value in .json(value) @@ -6574,9 +7781,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 204: - return .noContent(.init()) + return .ok(.init(body: body)) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -6599,9 +7804,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .forbidden(.init(body: body)) - case 422: + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6611,7 +7816,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -6620,7 +7825,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -6633,24 +7838,23 @@ public struct Client: APIProtocol { } ) } - /// List repositories a fine-grained personal access token has access to - /// - /// Lists the repositories a fine-grained personal access token has access to. + /// Get a custom property for an organization /// - /// Only GitHub Apps can use this endpoint. + /// Gets a custom property that is defined for an organization. + /// Organization members can read these properties. /// - /// - Remark: HTTP `GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/repositories/get(orgs/list-pat-grant-repositories)`. - public func orgsListPatGrantRepositories(_ input: Operations.OrgsListPatGrantRepositories.Input) async throws -> Operations.OrgsListPatGrantRepositories.Output { + /// - Remark: HTTP `GET /orgs/{org}/properties/schema/{custom_property_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)`. + public func orgsCustomPropertiesForReposGetOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output { try await client.send( input: input, - forOperation: Operations.OrgsListPatGrantRepositories.id, + forOperation: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/personal-access-tokens/{}/repositories", + template: "/orgs/{}/properties/schema/{}", parameters: [ input.path.org, - input.path.patId + input.path.customPropertyName ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -6658,20 +7862,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -6680,31 +7870,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 500: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.InternalError.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .internalServerError(.init(body: body)) - case 404: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6714,7 +7882,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.CustomProperty.self, from: responseBody, transforming: { value in .json(value) @@ -6723,7 +7891,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .ok(.init(body: body)) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -6746,14 +7914,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .forbidden(.init(body: body)) - case 200: - let headers: Operations.OrgsListPatGrantRepositories.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListPatGrantRepositories.Output.Ok.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6763,7 +7926,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.MinimalRepository].self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -6772,10 +7935,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -6788,40 +7948,53 @@ public struct Client: APIProtocol { } ) } - /// Get all custom properties for an organization + /// Create or update a custom property for an organization /// - /// Gets all custom properties defined for an organization. - /// Organization members can read these properties. + /// Creates a new or updates an existing custom property that is defined for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)`. - public func orgsGetAllCustomProperties(_ input: Operations.OrgsGetAllCustomProperties.Input) async throws -> Operations.OrgsGetAllCustomProperties.Output { + /// To use this endpoint, the authenticated user must be one of: + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. + /// + /// - Remark: HTTP `PUT /orgs/{org}/properties/schema/{custom_property_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output { try await client.send( input: input, - forOperation: Operations.OrgsGetAllCustomProperties.id, + forOperation: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/properties/schema", + template: "/orgs/{}/properties/schema/{}", parameters: [ - input.path.org + input.path.org, + input.path.customPropertyName ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsGetAllCustomProperties.Output.Ok.Body + let body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6831,7 +8004,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.CustomProperty].self, + Components.Schemas.CustomProperty.self, from: responseBody, transforming: { value in .json(value) @@ -6897,75 +8070,43 @@ public struct Client: APIProtocol { } ) } - /// Create or update custom properties for an organization - /// - /// Creates new or updates existing custom properties defined for an organization in a batch. + /// Remove a custom property for an organization /// - /// If the property already exists, the existing property will be replaced with the new values. - /// Missing optional values will fall back to default values, previous values will be overwritten. - /// E.g. if a property exists with `values_editable_by: org_and_repo_actors` and it's updated without specifying `values_editable_by`, it will be updated to default value `org_actors`. + /// Removes a custom property that is defined for an organization. /// /// To use this endpoint, the authenticated user must be one of: /// - An administrator for the organization. /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// - /// - Remark: HTTP `PATCH /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)`. - public func orgsCreateOrUpdateCustomProperties(_ input: Operations.OrgsCreateOrUpdateCustomProperties.Input) async throws -> Operations.OrgsCreateOrUpdateCustomProperties.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/properties/schema/{custom_property_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)`. + public func orgsCustomPropertiesForReposDeleteOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Output { try await client.send( input: input, - forOperation: Operations.OrgsCreateOrUpdateCustomProperties.id, + forOperation: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/properties/schema", + template: "/orgs/{}/properties/schema/{}", parameters: [ - input.path.org + input.path.org, + input.path.customPropertyName ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsCreateOrUpdateCustomProperties.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.CustomProperty].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) + case 204: + return .noContent(.init()) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -7022,30 +8163,50 @@ public struct Client: APIProtocol { } ) } - /// Get a custom property for an organization + /// List custom property values for organization repositories /// - /// Gets a custom property that is defined for an organization. + /// Lists organization repositories with all of their custom property values. /// Organization members can read these properties. /// - /// - Remark: HTTP `GET /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)`. - public func orgsGetCustomProperty(_ input: Operations.OrgsGetCustomProperty.Input) async throws -> Operations.OrgsGetCustomProperty.Output { + /// - Remark: HTTP `GET /orgs/{org}/properties/values`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)`. + public func orgsCustomPropertiesForReposGetOrganizationValues(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output { try await client.send( input: input, - forOperation: Operations.OrgsGetCustomProperty.id, + forOperation: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/properties/schema/{}", + template: "/orgs/{}/properties/values", parameters: [ - input.path.org, - input.path.customPropertyName + input.path.org ] ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "repository_query", + value: input.query.repositoryQuery ) - suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -7055,8 +8216,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsGetCustomProperty.Output.Ok.Body + let body: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7066,7 +8232,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.CustomProperty.self, + [Components.Schemas.OrgRepoCustomPropertyValues].self, from: responseBody, transforming: { value in .json(value) @@ -7075,7 +8241,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -7132,31 +8301,35 @@ public struct Client: APIProtocol { } ) } - /// Create or update a custom property for an organization + /// Create or update custom property values for organization repositories /// - /// Creates a new or updates an existing custom property that is defined for an organization. + /// Create new or update existing custom property values for repositories in a batch that belong to an organization. + /// Each target repository will have its custom property values updated to match the values provided in the request. + /// + /// A maximum of 30 repositories can be updated in a single request. + /// + /// Using a value of `null` for a custom property will remove or 'unset' the property value from the repository. /// /// To use this endpoint, the authenticated user must be one of: - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. /// - /// - Remark: HTTP `PUT /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)`. - public func orgsCreateOrUpdateCustomProperty(_ input: Operations.OrgsCreateOrUpdateCustomProperty.Input) async throws -> Operations.OrgsCreateOrUpdateCustomProperty.Output { + /// - Remark: HTTP `PATCH /orgs/{org}/properties/values`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationValues(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Output { try await client.send( input: input, - forOperation: Operations.OrgsCreateOrUpdateCustomProperty.id, + forOperation: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/properties/schema/{}", + template: "/orgs/{}/properties/values", parameters: [ - input.path.org, - input.path.customPropertyName + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .patch ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -7176,9 +8349,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 204: + return .noContent(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsCreateOrUpdateCustomProperty.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7188,7 +8363,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.CustomProperty.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -7197,10 +8372,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 403: + return .forbidden(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7219,10 +8394,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 404: + return .notFound(.init(body: body)) + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7232,7 +8407,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ValidationError.self, from: responseBody, transforming: { value in .json(value) @@ -7241,7 +8416,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -7254,33 +8429,42 @@ public struct Client: APIProtocol { } ) } - /// Remove a custom property for an organization - /// - /// Removes a custom property that is defined for an organization. + /// List public organization members /// - /// To use this endpoint, the authenticated user must be one of: - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. + /// Members of an organization can choose to have their membership publicized or not. /// - /// - Remark: HTTP `DELETE /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)`. - public func orgsRemoveCustomProperty(_ input: Operations.OrgsRemoveCustomProperty.Input) async throws -> Operations.OrgsRemoveCustomProperty.Output { + /// - Remark: HTTP `GET /orgs/{org}/public_members`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/get(orgs/list-public-members)`. + public func orgsListPublicMembers(_ input: Operations.OrgsListPublicMembers.Input) async throws -> Operations.OrgsListPublicMembers.Output { try await client.send( input: input, - forOperation: Operations.OrgsRemoveCustomProperty.id, + forOperation: Operations.OrgsListPublicMembers.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/properties/schema/{}", + template: "/orgs/{}/public_members", parameters: [ - input.path.org, - input.path.customPropertyName + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -7289,11 +8473,14 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 403: + case 200: + let headers: Operations.OrgsListPublicMembers.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Operations.OrgsListPublicMembers.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7303,7 +8490,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + [Components.Schemas.SimpleUser].self, from: responseBody, transforming: { value in .json(value) @@ -7312,10 +8499,103 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Check public organization membership for a user + /// + /// Check if the provided user is a public member of the organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/public_members/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/get(orgs/check-public-membership-for-user)`. + public func orgsCheckPublicMembershipForUser(_ input: Operations.OrgsCheckPublicMembershipForUser.Input) async throws -> Operations.OrgsCheckPublicMembershipForUser.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsCheckPublicMembershipForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/public_members/{}", + parameters: [ + input.path.org, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) case 404: + return .notFound(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set public organization membership for the authenticated user + /// + /// The user can publicize their own membership. (A user cannot publicize the membership for another user.) + /// + /// Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." + /// + /// - Remark: HTTP `PUT /orgs/{org}/public_members/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/put(orgs/set-public-membership-for-authenticated-user)`. + public func orgsSetPublicMembershipForAuthenticatedUser(_ input: Operations.OrgsSetPublicMembershipForAuthenticatedUser.Input) async throws -> Operations.OrgsSetPublicMembershipForAuthenticatedUser.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsSetPublicMembershipForAuthenticatedUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/public_members/{}", + parameters: [ + input.path.org, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7334,7 +8614,48 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .forbidden(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove public organization membership for the authenticated user + /// + /// Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/public_members/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/delete(orgs/remove-public-membership-for-authenticated-user)`. + public func orgsRemovePublicMembershipForAuthenticatedUser(_ input: Operations.OrgsRemovePublicMembershipForAuthenticatedUser.Input) async throws -> Operations.OrgsRemovePublicMembershipForAuthenticatedUser.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsRemovePublicMembershipForAuthenticatedUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/public_members/{}", + parameters: [ + input.path.org, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -7347,22 +8668,22 @@ public struct Client: APIProtocol { } ) } - /// List custom property values for organization repositories + /// Get organization ruleset history /// - /// Lists organization repositories with all of their custom property values. - /// Organization members can read these properties. + /// Get the history of an organization ruleset. /// - /// - Remark: HTTP `GET /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)`. - public func orgsListCustomPropertiesValuesForRepos(_ input: Operations.OrgsListCustomPropertiesValuesForRepos.Input) async throws -> Operations.OrgsListCustomPropertiesValuesForRepos.Output { + /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)`. + public func orgsGetOrgRulesetHistory(_ input: Operations.OrgsGetOrgRulesetHistory.Input) async throws -> Operations.OrgsGetOrgRulesetHistory.Output { try await client.send( input: input, - forOperation: Operations.OrgsListCustomPropertiesValuesForRepos.id, + forOperation: Operations.OrgsGetOrgRulesetHistory.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/properties/values", + template: "/orgs/{}/rulesets/{}/history", parameters: [ - input.path.org + input.path.org, + input.path.rulesetId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -7384,13 +8705,6 @@ public struct Client: APIProtocol { name: "page", value: input.query.page ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "repository_query", - value: input.query.repositoryQuery - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -7400,13 +8714,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Body + let body: Operations.OrgsGetOrgRulesetHistory.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7416,7 +8725,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.OrgRepoCustomPropertyValues].self, + [Components.Schemas.RulesetVersion].self, from: responseBody, transforming: { value in .json(value) @@ -7425,13 +8734,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) - case 403: + return .ok(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7450,10 +8756,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 404: + return .notFound(.init(body: body)) + case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.InternalError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7472,7 +8778,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .internalServerError(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -7485,59 +8791,41 @@ public struct Client: APIProtocol { } ) } - /// Create or update custom property values for organization repositories - /// - /// Create new or update existing custom property values for repositories in a batch that belong to an organization. - /// Each target repository will have its custom property values updated to match the values provided in the request. - /// - /// A maximum of 30 repositories can be updated in a single request. - /// - /// Using a value of `null` for a custom property will remove or 'unset' the property value from the repository. + /// Get organization ruleset version /// - /// To use this endpoint, the authenticated user must be one of: - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. + /// Get a version of an organization ruleset. /// - /// - Remark: HTTP `PATCH /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)`. - public func orgsCreateOrUpdateCustomPropertiesValuesForRepos(_ input: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input) async throws -> Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Output { + /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)`. + public func orgsGetOrgRulesetVersion(_ input: Operations.OrgsGetOrgRulesetVersion.Input) async throws -> Operations.OrgsGetOrgRulesetVersion.Output { try await client.send( input: input, - forOperation: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.id, + forOperation: Operations.OrgsGetOrgRulesetVersion.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/properties/values", + template: "/orgs/{}/rulesets/{}/history/{}", parameters: [ - input.path.org + input.path.org, + input.path.rulesetId, + input.path.versionId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 403: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Operations.OrgsGetOrgRulesetVersion.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7547,7 +8835,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.RulesetVersionWithState.self, from: responseBody, transforming: { value in .json(value) @@ -7556,7 +8844,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) + return .ok(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -7579,9 +8867,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 422: + case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.InternalError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7591,7 +8879,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -7600,7 +8888,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .internalServerError(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -7613,19 +8901,21 @@ public struct Client: APIProtocol { } ) } - /// List public organization members + /// List security manager teams /// - /// Members of an organization can choose to have their membership publicized or not. + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// - /// - Remark: HTTP `GET /orgs/{org}/public_members`. - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/get(orgs/list-public-members)`. - public func orgsListPublicMembers(_ input: Operations.OrgsListPublicMembers.Input) async throws -> Operations.OrgsListPublicMembers.Output { + /// - Remark: HTTP `GET /orgs/{org}/security-managers`. + /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/get(orgs/list-security-manager-teams)`. + @available(*, deprecated) + public func orgsListSecurityManagerTeams(_ input: Operations.OrgsListSecurityManagerTeams.Input) async throws -> Operations.OrgsListSecurityManagerTeams.Output { try await client.send( input: input, - forOperation: Operations.OrgsListPublicMembers.id, + forOperation: Operations.OrgsListSecurityManagerTeams.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/public_members", + template: "/orgs/{}/security-managers", parameters: [ input.path.org ] @@ -7635,20 +8925,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -7658,13 +8934,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.OrgsListPublicMembers.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListPublicMembers.Output.Ok.Body + let body: Operations.OrgsListSecurityManagerTeams.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7674,7 +8945,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.SimpleUser].self, + [Components.Schemas.TeamSimple].self, from: responseBody, transforming: { value in .json(value) @@ -7683,53 +8954,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Check public organization membership for a user - /// - /// Check if the provided user is a public member of the organization. - /// - /// - Remark: HTTP `GET /orgs/{org}/public_members/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/get(orgs/check-public-membership-for-user)`. - public func orgsCheckPublicMembershipForUser(_ input: Operations.OrgsCheckPublicMembershipForUser.Input) async throws -> Operations.OrgsCheckPublicMembershipForUser.Output { - try await client.send( - input: input, - forOperation: Operations.OrgsCheckPublicMembershipForUser.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/public_members/{}", - parameters: [ - input.path.org, - input.path.username - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - case 404: - return .notFound(.init()) + return .ok(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -7742,24 +8967,24 @@ public struct Client: APIProtocol { } ) } - /// Set public organization membership for the authenticated user - /// - /// The user can publicize their own membership. (A user cannot publicize the membership for another user.) + /// Add a security manager team /// - /// Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// - /// - Remark: HTTP `PUT /orgs/{org}/public_members/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/put(orgs/set-public-membership-for-authenticated-user)`. - public func orgsSetPublicMembershipForAuthenticatedUser(_ input: Operations.OrgsSetPublicMembershipForAuthenticatedUser.Input) async throws -> Operations.OrgsSetPublicMembershipForAuthenticatedUser.Output { + /// - Remark: HTTP `PUT /orgs/{org}/security-managers/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/put(orgs/add-security-manager-team)`. + @available(*, deprecated) + public func orgsAddSecurityManagerTeam(_ input: Operations.OrgsAddSecurityManagerTeam.Input) async throws -> Operations.OrgsAddSecurityManagerTeam.Output { try await client.send( input: input, - forOperation: Operations.OrgsSetPublicMembershipForAuthenticatedUser.id, + forOperation: Operations.OrgsAddSecurityManagerTeam.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/public_members/{}", + template: "/orgs/{}/security-managers/teams/{}", parameters: [ input.path.org, - input.path.username + input.path.teamSlug ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -7767,38 +8992,12 @@ public struct Client: APIProtocol { method: .put ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 204: return .noContent(.init()) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -7811,22 +9010,24 @@ public struct Client: APIProtocol { } ) } - /// Remove public organization membership for the authenticated user + /// Remove a security manager team /// - /// Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default. + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// - /// - Remark: HTTP `DELETE /orgs/{org}/public_members/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/delete(orgs/remove-public-membership-for-authenticated-user)`. - public func orgsRemovePublicMembershipForAuthenticatedUser(_ input: Operations.OrgsRemovePublicMembershipForAuthenticatedUser.Input) async throws -> Operations.OrgsRemovePublicMembershipForAuthenticatedUser.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/security-managers/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/delete(orgs/remove-security-manager-team)`. + @available(*, deprecated) + public func orgsRemoveSecurityManagerTeam(_ input: Operations.OrgsRemoveSecurityManagerTeam.Input) async throws -> Operations.OrgsRemoveSecurityManagerTeam.Output { try await client.send( input: input, - forOperation: Operations.OrgsRemovePublicMembershipForAuthenticatedUser.id, + forOperation: Operations.OrgsRemoveSecurityManagerTeam.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/public_members/{}", + template: "/orgs/{}/security-managers/teams/{}", parameters: [ input.path.org, - input.path.username + input.path.teamSlug ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -7852,22 +9053,23 @@ public struct Client: APIProtocol { } ) } - /// Get organization ruleset history + /// Get immutable releases settings for an organization /// - /// Get the history of an organization ruleset. + /// Gets the immutable releases policy for repositories in an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history`. - /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)`. - public func orgsGetOrgRulesetHistory(_ input: Operations.OrgsGetOrgRulesetHistory.Input) async throws -> Operations.OrgsGetOrgRulesetHistory.Output { + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/get(orgs/get-immutable-releases-settings)`. + public func orgsGetImmutableReleasesSettings(_ input: Operations.OrgsGetImmutableReleasesSettings.Input) async throws -> Operations.OrgsGetImmutableReleasesSettings.Output { try await client.send( input: input, - forOperation: Operations.OrgsGetOrgRulesetHistory.id, + forOperation: Operations.OrgsGetImmutableReleasesSettings.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/rulesets/{}/history", + template: "/orgs/{}/settings/immutable-releases", parameters: [ - input.path.org, - input.path.rulesetId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -7875,20 +9077,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -7899,7 +9087,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsGetOrgRulesetHistory.Output.Ok.Body + let body: Operations.OrgsGetImmutableReleasesSettings.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -7909,7 +9097,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.RulesetVersion].self, + Components.Schemas.ImmutableReleasesOrganizationSettings.self, from: responseBody, transforming: { value in .json(value) @@ -7919,50 +9107,57 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 500: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.InternalError.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .internalServerError(.init(body: body)) + } + } + ) + } + /// Set immutable releases settings for an organization + /// + /// Sets the immutable releases policy for repositories in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/put(orgs/set-immutable-releases-settings)`. + public func orgsSetImmutableReleasesSettings(_ input: Operations.OrgsSetImmutableReleasesSettings.Input) async throws -> Operations.OrgsSetImmutableReleasesSettings.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsSetImmutableReleasesSettings.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/settings/immutable-releases", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -7975,23 +9170,23 @@ public struct Client: APIProtocol { } ) } - /// Get organization ruleset version + /// List selected repositories for immutable releases enforcement /// - /// Get a version of an organization ruleset. + /// List all of the repositories that have been selected for immutable releases enforcement in an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)`. - public func orgsGetOrgRulesetVersion(_ input: Operations.OrgsGetOrgRulesetVersion.Input) async throws -> Operations.OrgsGetOrgRulesetVersion.Output { + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/get(orgs/get-immutable-releases-settings-repositories)`. + public func orgsGetImmutableReleasesSettingsRepositories(_ input: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input) async throws -> Operations.OrgsGetImmutableReleasesSettingsRepositories.Output { try await client.send( input: input, - forOperation: Operations.OrgsGetOrgRulesetVersion.id, + forOperation: Operations.OrgsGetImmutableReleasesSettingsRepositories.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/rulesets/{}/history/{}", + template: "/orgs/{}/settings/immutable-releases/repositories", parameters: [ - input.path.org, - input.path.rulesetId, - input.path.versionId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -7999,6 +9194,20 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -8009,7 +9218,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsGetOrgRulesetVersion.Output.Ok.Body + let body: Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -8019,7 +9228,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.RulesetVersionWithState.self, + Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -8029,50 +9238,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 500: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.InternalError.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .internalServerError(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -8085,60 +9250,45 @@ public struct Client: APIProtocol { } ) } - /// List security manager teams + /// Set selected repositories for immutable releases enforcement /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. + /// Replaces all repositories that have been selected for immutable releases enforcement in an organization. To use this endpoint, the organization immutable releases policy for `enforced_repositories` must be configured to `selected`. /// - /// - Remark: HTTP `GET /orgs/{org}/security-managers`. - /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/get(orgs/list-security-manager-teams)`. - @available(*, deprecated) - public func orgsListSecurityManagerTeams(_ input: Operations.OrgsListSecurityManagerTeams.Input) async throws -> Operations.OrgsListSecurityManagerTeams.Output { + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/put(orgs/set-immutable-releases-settings-repositories)`. + public func orgsSetImmutableReleasesSettingsRepositories(_ input: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input) async throws -> Operations.OrgsSetImmutableReleasesSettingsRepositories.Output { try await client.send( input: input, - forOperation: Operations.OrgsListSecurityManagerTeams.id, + forOperation: Operations.OrgsSetImmutableReleasesSettingsRepositories.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/security-managers", + template: "/orgs/{}/settings/immutable-releases/repositories", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.OrgsListSecurityManagerTeams.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.TeamSimple].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) + case 204: + return .noContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -8151,24 +9301,24 @@ public struct Client: APIProtocol { } ) } - /// Add a security manager team + /// Enable a selected repository for immutable releases in an organization /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. + /// Adds a repository to the list of selected repositories that are enforced for immutable releases in an organization. To use this endpoint, the organization immutable releases policy for `enforced_repositories` must be configured to `selected`. /// - /// - Remark: HTTP `PUT /orgs/{org}/security-managers/teams/{team_slug}`. - /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/put(orgs/add-security-manager-team)`. - @available(*, deprecated) - public func orgsAddSecurityManagerTeam(_ input: Operations.OrgsAddSecurityManagerTeam.Input) async throws -> Operations.OrgsAddSecurityManagerTeam.Output { + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/put(orgs/enable-selected-repository-immutable-releases-organization)`. + public func orgsEnableSelectedRepositoryImmutableReleasesOrganization(_ input: Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Input) async throws -> Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Output { try await client.send( input: input, - forOperation: Operations.OrgsAddSecurityManagerTeam.id, + forOperation: Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/security-managers/teams/{}", + template: "/orgs/{}/settings/immutable-releases/repositories/{}", parameters: [ input.path.org, - input.path.teamSlug + input.path.repositoryId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -8194,24 +9344,24 @@ public struct Client: APIProtocol { } ) } - /// Remove a security manager team + /// Disable a selected repository for immutable releases in an organization /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. + /// Removes a repository from the list of selected repositories that are enforced for immutable releases in an organization. To use this endpoint, the organization immutable releases policy for `enforced_repositories` must be configured to `selected`. /// - /// - Remark: HTTP `DELETE /orgs/{org}/security-managers/teams/{team_slug}`. - /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/delete(orgs/remove-security-manager-team)`. - @available(*, deprecated) - public func orgsRemoveSecurityManagerTeam(_ input: Operations.OrgsRemoveSecurityManagerTeam.Input) async throws -> Operations.OrgsRemoveSecurityManagerTeam.Output { + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/delete(orgs/disable-selected-repository-immutable-releases-organization)`. + public func orgsDisableSelectedRepositoryImmutableReleasesOrganization(_ input: Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Input) async throws -> Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Output { try await client.send( input: input, - forOperation: Operations.OrgsRemoveSecurityManagerTeam.id, + forOperation: Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/security-managers/teams/{}", + template: "/orgs/{}/settings/immutable-releases/repositories/{}", parameters: [ input.path.org, - input.path.teamSlug + input.path.repositoryId ] ) var request: HTTPTypes.HTTPRequest = .init( diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index a540655a4bf..7a80e82c578 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -21,6 +21,35 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /organizations`. /// - Remark: Generated from `#/paths//organizations/get(orgs/list)`. func orgsList(_ input: Operations.OrgsList.Input) async throws -> Operations.OrgsList.Output + /// Get all custom property values for an organization + /// + /// Gets all custom property values that are set for an organization. + /// + /// The organization must belong to an enterprise. + /// + /// Access requirements: + /// - Organization admins + /// - OAuth tokens and personal access tokens (classic) with the `read:org` scope + /// - Actors with the organization-level "read custom properties for an organization" fine-grained permission or above + /// + /// - Remark: HTTP `GET /organizations/{org}/org-properties/values`. + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/get(orgs/custom-properties-for-orgs-get-organization-values)`. + func orgsCustomPropertiesForOrgsGetOrganizationValues(_ input: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Output + /// Create or update custom property values for an organization + /// + /// Create new or update existing custom property values for an organization. + /// To remove a custom property value from an organization, set the property value to `null`. + /// + /// The organization must belong to an enterprise. + /// + /// Access requirements: + /// - Organization admins + /// - OAuth tokens and personal access tokens (classic) with the `admin:org` scope + /// - Actors with the organization-level "edit custom properties for an organization" fine-grained permission + /// + /// - Remark: HTTP `PATCH /organizations/{org}/org-properties/values`. + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)`. + func orgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues(_ input: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Output /// Get an organization /// /// Gets information about an organization. @@ -66,6 +95,64 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /orgs/{org}`. /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)`. func orgsDelete(_ input: Operations.OrgsDelete.Input) async throws -> Operations.OrgsDelete.Output + /// Create artifact metadata storage record + /// + /// Create metadata storage records for artifacts associated with an organization. + /// This endpoint will create a new artifact storage record on behalf of any artifact matching the provided digest and + /// associated with a repository owned by the organization. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/storage-record`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)`. + func orgsCreateArtifactStorageRecord(_ input: Operations.OrgsCreateArtifactStorageRecord.Input) async throws -> Operations.OrgsCreateArtifactStorageRecord.Output + /// List artifact storage records + /// + /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. + /// + /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. + func orgsListArtifactStorageRecords(_ input: Operations.OrgsListArtifactStorageRecords.Input) async throws -> Operations.OrgsListArtifactStorageRecords.Output + /// List attestations by bulk subject digests + /// + /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /orgs/{org}/attestations/bulk-list`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/bulk-list/post(orgs/list-attestations-bulk)`. + func orgsListAttestationsBulk(_ input: Operations.OrgsListAttestationsBulk.Input) async throws -> Operations.OrgsListAttestationsBulk.Output + /// Delete attestations in bulk + /// + /// Delete artifact attestations in bulk by either subject digests or unique ID. + /// + /// - Remark: HTTP `POST /orgs/{org}/attestations/delete-request`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)`. + func orgsDeleteAttestationsBulk(_ input: Operations.OrgsDeleteAttestationsBulk.Input) async throws -> Operations.OrgsDeleteAttestationsBulk.Output + /// Delete attestations by subject digest + /// + /// Delete an artifact attestation by subject digest. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/digest/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)`. + func orgsDeleteAttestationsBySubjectDigest(_ input: Operations.OrgsDeleteAttestationsBySubjectDigest.Input) async throws -> Operations.OrgsDeleteAttestationsBySubjectDigest.Output + /// List attestation repositories + /// + /// List repositories owned by the provided organization that have created at least one attested artifact + /// Results will be sorted in ascending order by repository ID + /// + /// - Remark: HTTP `GET /orgs/{org}/attestations/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/repositories/get(orgs/list-attestation-repositories)`. + func orgsListAttestationRepositories(_ input: Operations.OrgsListAttestationRepositories.Input) async throws -> Operations.OrgsListAttestationRepositories.Output + /// Delete attestations by ID + /// + /// Delete an artifact attestation by unique ID that is associated with a repository owned by an org. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/{attestation_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)`. + func orgsDeleteAttestationsById(_ input: Operations.OrgsDeleteAttestationsById.Input) async throws -> Operations.OrgsDeleteAttestationsById.Output /// List attestations /// /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. @@ -422,6 +509,9 @@ public protocol APIProtocol: Sendable { /// /// Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. /// + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. + /// /// - Remark: HTTP `DELETE /orgs/{org}/members/{username}`. /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)`. func orgsRemoveMember(_ input: Operations.OrgsRemoveMember.Input) async throws -> Operations.OrgsRemoveMember.Output @@ -453,6 +543,9 @@ public protocol APIProtocol: Sendable { /// /// If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. /// + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. + /// /// - Remark: HTTP `DELETE /orgs/{org}/memberships/{username}`. /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)`. func orgsRemoveMembershipForUser(_ input: Operations.OrgsRemoveMembershipForUser.Input) async throws -> Operations.OrgsRemoveMembershipForUser.Output @@ -671,8 +764,8 @@ public protocol APIProtocol: Sendable { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)`. - func orgsGetAllCustomProperties(_ input: Operations.OrgsGetAllCustomProperties.Input) async throws -> Operations.OrgsGetAllCustomProperties.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)`. + func orgsCustomPropertiesForReposGetOrganizationDefinitions(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output /// Create or update custom properties for an organization /// /// Creates new or updates existing custom properties defined for an organization in a batch. @@ -686,16 +779,16 @@ public protocol APIProtocol: Sendable { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)`. - func orgsCreateOrUpdateCustomProperties(_ input: Operations.OrgsCreateOrUpdateCustomProperties.Input) async throws -> Operations.OrgsCreateOrUpdateCustomProperties.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)`. + func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output /// Get a custom property for an organization /// /// Gets a custom property that is defined for an organization. /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)`. - func orgsGetCustomProperty(_ input: Operations.OrgsGetCustomProperty.Input) async throws -> Operations.OrgsGetCustomProperty.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)`. + func orgsCustomPropertiesForReposGetOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output /// Create or update a custom property for an organization /// /// Creates a new or updates an existing custom property that is defined for an organization. @@ -705,8 +798,8 @@ public protocol APIProtocol: Sendable { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PUT /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)`. - func orgsCreateOrUpdateCustomProperty(_ input: Operations.OrgsCreateOrUpdateCustomProperty.Input) async throws -> Operations.OrgsCreateOrUpdateCustomProperty.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)`. + func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output /// Remove a custom property for an organization /// /// Removes a custom property that is defined for an organization. @@ -716,16 +809,16 @@ public protocol APIProtocol: Sendable { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `DELETE /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)`. - func orgsRemoveCustomProperty(_ input: Operations.OrgsRemoveCustomProperty.Input) async throws -> Operations.OrgsRemoveCustomProperty.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)`. + func orgsCustomPropertiesForReposDeleteOrganizationDefinition(_ input: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input) async throws -> Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Output /// List custom property values for organization repositories /// /// Lists organization repositories with all of their custom property values. /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)`. - func orgsListCustomPropertiesValuesForRepos(_ input: Operations.OrgsListCustomPropertiesValuesForRepos.Input) async throws -> Operations.OrgsListCustomPropertiesValuesForRepos.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)`. + func orgsCustomPropertiesForReposGetOrganizationValues(_ input: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output /// Create or update custom property values for organization repositories /// /// Create new or update existing custom property values for repositories in a batch that belong to an organization. @@ -740,8 +833,8 @@ public protocol APIProtocol: Sendable { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)`. - func orgsCreateOrUpdateCustomPropertiesValuesForRepos(_ input: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input) async throws -> Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Output + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)`. + func orgsCustomPropertiesForReposCreateOrUpdateOrganizationValues(_ input: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Output /// List public organization members /// /// Members of an organization can choose to have their membership publicized or not. @@ -813,6 +906,60 @@ public protocol APIProtocol: Sendable { /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/delete(orgs/remove-security-manager-team)`. @available(*, deprecated) func orgsRemoveSecurityManagerTeam(_ input: Operations.OrgsRemoveSecurityManagerTeam.Input) async throws -> Operations.OrgsRemoveSecurityManagerTeam.Output + /// Get immutable releases settings for an organization + /// + /// Gets the immutable releases policy for repositories in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/get(orgs/get-immutable-releases-settings)`. + func orgsGetImmutableReleasesSettings(_ input: Operations.OrgsGetImmutableReleasesSettings.Input) async throws -> Operations.OrgsGetImmutableReleasesSettings.Output + /// Set immutable releases settings for an organization + /// + /// Sets the immutable releases policy for repositories in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/put(orgs/set-immutable-releases-settings)`. + func orgsSetImmutableReleasesSettings(_ input: Operations.OrgsSetImmutableReleasesSettings.Input) async throws -> Operations.OrgsSetImmutableReleasesSettings.Output + /// List selected repositories for immutable releases enforcement + /// + /// List all of the repositories that have been selected for immutable releases enforcement in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/get(orgs/get-immutable-releases-settings-repositories)`. + func orgsGetImmutableReleasesSettingsRepositories(_ input: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input) async throws -> Operations.OrgsGetImmutableReleasesSettingsRepositories.Output + /// Set selected repositories for immutable releases enforcement + /// + /// Replaces all repositories that have been selected for immutable releases enforcement in an organization. To use this endpoint, the organization immutable releases policy for `enforced_repositories` must be configured to `selected`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/put(orgs/set-immutable-releases-settings-repositories)`. + func orgsSetImmutableReleasesSettingsRepositories(_ input: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input) async throws -> Operations.OrgsSetImmutableReleasesSettingsRepositories.Output + /// Enable a selected repository for immutable releases in an organization + /// + /// Adds a repository to the list of selected repositories that are enforced for immutable releases in an organization. To use this endpoint, the organization immutable releases policy for `enforced_repositories` must be configured to `selected`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/put(orgs/enable-selected-repository-immutable-releases-organization)`. + func orgsEnableSelectedRepositoryImmutableReleasesOrganization(_ input: Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Input) async throws -> Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Output + /// Disable a selected repository for immutable releases in an organization + /// + /// Removes a repository from the list of selected repositories that are enforced for immutable releases in an organization. To use this endpoint, the organization immutable releases policy for `enforced_repositories` must be configured to `selected`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/delete(orgs/disable-selected-repository-immutable-releases-organization)`. + func orgsDisableSelectedRepositoryImmutableReleasesOrganization(_ input: Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Input) async throws -> Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Output /// Enable or disable a security feature for an organization /// /// > [!WARNING] @@ -892,6 +1039,53 @@ extension APIProtocol { headers: headers )) } + /// Get all custom property values for an organization + /// + /// Gets all custom property values that are set for an organization. + /// + /// The organization must belong to an enterprise. + /// + /// Access requirements: + /// - Organization admins + /// - OAuth tokens and personal access tokens (classic) with the `read:org` scope + /// - Actors with the organization-level "read custom properties for an organization" fine-grained permission or above + /// + /// - Remark: HTTP `GET /organizations/{org}/org-properties/values`. + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/get(orgs/custom-properties-for-orgs-get-organization-values)`. + public func orgsCustomPropertiesForOrgsGetOrganizationValues( + path: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input.Path, + headers: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input.Headers = .init() + ) async throws -> Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Output { + try await orgsCustomPropertiesForOrgsGetOrganizationValues(Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input( + path: path, + headers: headers + )) + } + /// Create or update custom property values for an organization + /// + /// Create new or update existing custom property values for an organization. + /// To remove a custom property value from an organization, set the property value to `null`. + /// + /// The organization must belong to an enterprise. + /// + /// Access requirements: + /// - Organization admins + /// - OAuth tokens and personal access tokens (classic) with the `admin:org` scope + /// - Actors with the organization-level "edit custom properties for an organization" fine-grained permission + /// + /// - Remark: HTTP `PATCH /organizations/{org}/org-properties/values`. + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)`. + public func orgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues( + path: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Path, + headers: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Body + ) async throws -> Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Output { + try await orgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues(Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input( + path: path, + headers: headers, + body: body + )) + } /// Get an organization /// /// Gets information about an organization. @@ -963,6 +1157,130 @@ extension APIProtocol { headers: headers )) } + /// Create artifact metadata storage record + /// + /// Create metadata storage records for artifacts associated with an organization. + /// This endpoint will create a new artifact storage record on behalf of any artifact matching the provided digest and + /// associated with a repository owned by the organization. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/storage-record`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)`. + public func orgsCreateArtifactStorageRecord( + path: Operations.OrgsCreateArtifactStorageRecord.Input.Path, + headers: Operations.OrgsCreateArtifactStorageRecord.Input.Headers = .init(), + body: Operations.OrgsCreateArtifactStorageRecord.Input.Body + ) async throws -> Operations.OrgsCreateArtifactStorageRecord.Output { + try await orgsCreateArtifactStorageRecord(Operations.OrgsCreateArtifactStorageRecord.Input( + path: path, + headers: headers, + body: body + )) + } + /// List artifact storage records + /// + /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. + /// + /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. + public func orgsListArtifactStorageRecords( + path: Operations.OrgsListArtifactStorageRecords.Input.Path, + headers: Operations.OrgsListArtifactStorageRecords.Input.Headers = .init() + ) async throws -> Operations.OrgsListArtifactStorageRecords.Output { + try await orgsListArtifactStorageRecords(Operations.OrgsListArtifactStorageRecords.Input( + path: path, + headers: headers + )) + } + /// List attestations by bulk subject digests + /// + /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /orgs/{org}/attestations/bulk-list`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/bulk-list/post(orgs/list-attestations-bulk)`. + public func orgsListAttestationsBulk( + path: Operations.OrgsListAttestationsBulk.Input.Path, + query: Operations.OrgsListAttestationsBulk.Input.Query = .init(), + headers: Operations.OrgsListAttestationsBulk.Input.Headers = .init(), + body: Operations.OrgsListAttestationsBulk.Input.Body + ) async throws -> Operations.OrgsListAttestationsBulk.Output { + try await orgsListAttestationsBulk(Operations.OrgsListAttestationsBulk.Input( + path: path, + query: query, + headers: headers, + body: body + )) + } + /// Delete attestations in bulk + /// + /// Delete artifact attestations in bulk by either subject digests or unique ID. + /// + /// - Remark: HTTP `POST /orgs/{org}/attestations/delete-request`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)`. + public func orgsDeleteAttestationsBulk( + path: Operations.OrgsDeleteAttestationsBulk.Input.Path, + headers: Operations.OrgsDeleteAttestationsBulk.Input.Headers = .init(), + body: Operations.OrgsDeleteAttestationsBulk.Input.Body + ) async throws -> Operations.OrgsDeleteAttestationsBulk.Output { + try await orgsDeleteAttestationsBulk(Operations.OrgsDeleteAttestationsBulk.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete attestations by subject digest + /// + /// Delete an artifact attestation by subject digest. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/digest/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)`. + public func orgsDeleteAttestationsBySubjectDigest( + path: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Path, + headers: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Headers = .init() + ) async throws -> Operations.OrgsDeleteAttestationsBySubjectDigest.Output { + try await orgsDeleteAttestationsBySubjectDigest(Operations.OrgsDeleteAttestationsBySubjectDigest.Input( + path: path, + headers: headers + )) + } + /// List attestation repositories + /// + /// List repositories owned by the provided organization that have created at least one attested artifact + /// Results will be sorted in ascending order by repository ID + /// + /// - Remark: HTTP `GET /orgs/{org}/attestations/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/repositories/get(orgs/list-attestation-repositories)`. + public func orgsListAttestationRepositories( + path: Operations.OrgsListAttestationRepositories.Input.Path, + query: Operations.OrgsListAttestationRepositories.Input.Query = .init(), + headers: Operations.OrgsListAttestationRepositories.Input.Headers = .init() + ) async throws -> Operations.OrgsListAttestationRepositories.Output { + try await orgsListAttestationRepositories(Operations.OrgsListAttestationRepositories.Input( + path: path, + query: query, + headers: headers + )) + } + /// Delete attestations by ID + /// + /// Delete an artifact attestation by unique ID that is associated with a repository owned by an org. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/{attestation_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)`. + public func orgsDeleteAttestationsById( + path: Operations.OrgsDeleteAttestationsById.Input.Path, + headers: Operations.OrgsDeleteAttestationsById.Input.Headers = .init() + ) async throws -> Operations.OrgsDeleteAttestationsById.Output { + try await orgsDeleteAttestationsById(Operations.OrgsDeleteAttestationsById.Input( + path: path, + headers: headers + )) + } /// List attestations /// /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. @@ -1651,6 +1969,9 @@ extension APIProtocol { /// /// Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. /// + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. + /// /// - Remark: HTTP `DELETE /orgs/{org}/members/{username}`. /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)`. public func orgsRemoveMember( @@ -1708,6 +2029,9 @@ extension APIProtocol { /// /// If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. /// + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. + /// /// - Remark: HTTP `DELETE /orgs/{org}/memberships/{username}`. /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)`. public func orgsRemoveMembershipForUser( @@ -2090,12 +2414,12 @@ extension APIProtocol { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)`. - public func orgsGetAllCustomProperties( - path: Operations.OrgsGetAllCustomProperties.Input.Path, - headers: Operations.OrgsGetAllCustomProperties.Input.Headers = .init() - ) async throws -> Operations.OrgsGetAllCustomProperties.Output { - try await orgsGetAllCustomProperties(Operations.OrgsGetAllCustomProperties.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)`. + public func orgsCustomPropertiesForReposGetOrganizationDefinitions( + path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Headers = .init() + ) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output { + try await orgsCustomPropertiesForReposGetOrganizationDefinitions(Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input( path: path, headers: headers )) @@ -2113,13 +2437,13 @@ extension APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)`. - public func orgsCreateOrUpdateCustomProperties( - path: Operations.OrgsCreateOrUpdateCustomProperties.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomProperties.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomProperties.Input.Body - ) async throws -> Operations.OrgsCreateOrUpdateCustomProperties.Output { - try await orgsCreateOrUpdateCustomProperties(Operations.OrgsCreateOrUpdateCustomProperties.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions( + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Body + ) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output { + try await orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input( path: path, headers: headers, body: body @@ -2131,12 +2455,12 @@ extension APIProtocol { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)`. - public func orgsGetCustomProperty( - path: Operations.OrgsGetCustomProperty.Input.Path, - headers: Operations.OrgsGetCustomProperty.Input.Headers = .init() - ) async throws -> Operations.OrgsGetCustomProperty.Output { - try await orgsGetCustomProperty(Operations.OrgsGetCustomProperty.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)`. + public func orgsCustomPropertiesForReposGetOrganizationDefinition( + path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Headers = .init() + ) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output { + try await orgsCustomPropertiesForReposGetOrganizationDefinition(Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input( path: path, headers: headers )) @@ -2150,13 +2474,13 @@ extension APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `PUT /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)`. - public func orgsCreateOrUpdateCustomProperty( - path: Operations.OrgsCreateOrUpdateCustomProperty.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomProperty.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomProperty.Input.Body - ) async throws -> Operations.OrgsCreateOrUpdateCustomProperty.Output { - try await orgsCreateOrUpdateCustomProperty(Operations.OrgsCreateOrUpdateCustomProperty.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition( + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Body + ) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output { + try await orgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input( path: path, headers: headers, body: body @@ -2171,12 +2495,12 @@ extension APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// /// - Remark: HTTP `DELETE /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)`. - public func orgsRemoveCustomProperty( - path: Operations.OrgsRemoveCustomProperty.Input.Path, - headers: Operations.OrgsRemoveCustomProperty.Input.Headers = .init() - ) async throws -> Operations.OrgsRemoveCustomProperty.Output { - try await orgsRemoveCustomProperty(Operations.OrgsRemoveCustomProperty.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)`. + public func orgsCustomPropertiesForReposDeleteOrganizationDefinition( + path: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Headers = .init() + ) async throws -> Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Output { + try await orgsCustomPropertiesForReposDeleteOrganizationDefinition(Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input( path: path, headers: headers )) @@ -2187,13 +2511,13 @@ extension APIProtocol { /// Organization members can read these properties. /// /// - Remark: HTTP `GET /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)`. - public func orgsListCustomPropertiesValuesForRepos( - path: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Path, - query: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Query = .init(), - headers: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Headers = .init() - ) async throws -> Operations.OrgsListCustomPropertiesValuesForRepos.Output { - try await orgsListCustomPropertiesValuesForRepos(Operations.OrgsListCustomPropertiesValuesForRepos.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)`. + public func orgsCustomPropertiesForReposGetOrganizationValues( + path: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Path, + query: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Query = .init(), + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Headers = .init() + ) async throws -> Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output { + try await orgsCustomPropertiesForReposGetOrganizationValues(Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input( path: path, query: query, headers: headers @@ -2213,13 +2537,13 @@ extension APIProtocol { /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. /// /// - Remark: HTTP `PATCH /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)`. - public func orgsCreateOrUpdateCustomPropertiesValuesForRepos( - path: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Body - ) async throws -> Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Output { - try await orgsCreateOrUpdateCustomPropertiesValuesForRepos(Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input( + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)`. + public func orgsCustomPropertiesForReposCreateOrUpdateOrganizationValues( + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Body + ) async throws -> Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Output { + try await orgsCustomPropertiesForReposCreateOrUpdateOrganizationValues(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input( path: path, headers: headers, body: body @@ -2348,6 +2672,98 @@ extension APIProtocol { public func orgsRemoveSecurityManagerTeam(path: Operations.OrgsRemoveSecurityManagerTeam.Input.Path) async throws -> Operations.OrgsRemoveSecurityManagerTeam.Output { try await orgsRemoveSecurityManagerTeam(Operations.OrgsRemoveSecurityManagerTeam.Input(path: path)) } + /// Get immutable releases settings for an organization + /// + /// Gets the immutable releases policy for repositories in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/get(orgs/get-immutable-releases-settings)`. + public func orgsGetImmutableReleasesSettings( + path: Operations.OrgsGetImmutableReleasesSettings.Input.Path, + headers: Operations.OrgsGetImmutableReleasesSettings.Input.Headers = .init() + ) async throws -> Operations.OrgsGetImmutableReleasesSettings.Output { + try await orgsGetImmutableReleasesSettings(Operations.OrgsGetImmutableReleasesSettings.Input( + path: path, + headers: headers + )) + } + /// Set immutable releases settings for an organization + /// + /// Sets the immutable releases policy for repositories in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/put(orgs/set-immutable-releases-settings)`. + public func orgsSetImmutableReleasesSettings( + path: Operations.OrgsSetImmutableReleasesSettings.Input.Path, + body: Operations.OrgsSetImmutableReleasesSettings.Input.Body + ) async throws -> Operations.OrgsSetImmutableReleasesSettings.Output { + try await orgsSetImmutableReleasesSettings(Operations.OrgsSetImmutableReleasesSettings.Input( + path: path, + body: body + )) + } + /// List selected repositories for immutable releases enforcement + /// + /// List all of the repositories that have been selected for immutable releases enforcement in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/get(orgs/get-immutable-releases-settings-repositories)`. + public func orgsGetImmutableReleasesSettingsRepositories( + path: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Path, + query: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Query = .init(), + headers: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Headers = .init() + ) async throws -> Operations.OrgsGetImmutableReleasesSettingsRepositories.Output { + try await orgsGetImmutableReleasesSettingsRepositories(Operations.OrgsGetImmutableReleasesSettingsRepositories.Input( + path: path, + query: query, + headers: headers + )) + } + /// Set selected repositories for immutable releases enforcement + /// + /// Replaces all repositories that have been selected for immutable releases enforcement in an organization. To use this endpoint, the organization immutable releases policy for `enforced_repositories` must be configured to `selected`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/put(orgs/set-immutable-releases-settings-repositories)`. + public func orgsSetImmutableReleasesSettingsRepositories( + path: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input.Path, + body: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input.Body + ) async throws -> Operations.OrgsSetImmutableReleasesSettingsRepositories.Output { + try await orgsSetImmutableReleasesSettingsRepositories(Operations.OrgsSetImmutableReleasesSettingsRepositories.Input( + path: path, + body: body + )) + } + /// Enable a selected repository for immutable releases in an organization + /// + /// Adds a repository to the list of selected repositories that are enforced for immutable releases in an organization. To use this endpoint, the organization immutable releases policy for `enforced_repositories` must be configured to `selected`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/put(orgs/enable-selected-repository-immutable-releases-organization)`. + public func orgsEnableSelectedRepositoryImmutableReleasesOrganization(path: Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Input.Path) async throws -> Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Output { + try await orgsEnableSelectedRepositoryImmutableReleasesOrganization(Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Input(path: path)) + } + /// Disable a selected repository for immutable releases in an organization + /// + /// Removes a repository from the list of selected repositories that are enforced for immutable releases in an organization. To use this endpoint, the organization immutable releases policy for `enforced_repositories` must be configured to `selected`. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/delete(orgs/disable-selected-repository-immutable-releases-organization)`. + public func orgsDisableSelectedRepositoryImmutableReleasesOrganization(path: Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Input.Path) async throws -> Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Output { + try await orgsDisableSelectedRepositoryImmutableReleasesOrganization(Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Input(path: path)) + } /// Enable or disable a security feature for an organization /// /// > [!WARNING] @@ -3647,6 +4063,17 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/workflows`. public var workflows: Components.Schemas.AppPermissions.WorkflowsPayload? + /// The level of permission to grant the access token to view and edit custom properties for an organization, when allowed by the property. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/custom_properties_for_organizations`. + @frozen public enum CustomPropertiesForOrganizationsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + } + /// The level of permission to grant the access token to view and edit custom properties for an organization, when allowed by the property. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/custom_properties_for_organizations`. + public var customPropertiesForOrganizations: Components.Schemas.AppPermissions.CustomPropertiesForOrganizationsPayload? /// The level of permission to grant the access token for organization teams and members. /// /// - Remark: Generated from `#/components/schemas/app-permissions/members`. @@ -3691,7 +4118,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_custom_org_roles`. public var organizationCustomOrgRoles: Components.Schemas.AppPermissions.OrganizationCustomOrgRolesPayload? - /// The level of permission to grant the access token for custom property management. + /// The level of permission to grant the access token for repository custom properties management at the organization level. /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_custom_properties`. @frozen public enum OrganizationCustomPropertiesPayload: String, Codable, Hashable, Sendable, CaseIterable { @@ -3699,7 +4126,7 @@ public enum Components { case write = "write" case admin = "admin" } - /// The level of permission to grant the access token for custom property management. + /// The level of permission to grant the access token for repository custom properties management at the organization level. /// /// - Remark: Generated from `#/components/schemas/app-permissions/organization_custom_properties`. public var organizationCustomProperties: Components.Schemas.AppPermissions.OrganizationCustomPropertiesPayload? @@ -3920,6 +4347,18 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/app-permissions/starring`. public var starring: Components.Schemas.AppPermissions.StarringPayload? + /// The level of permission to grant the access token for organization custom properties management at the enterprise level. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/enterprise_custom_properties_for_organizations`. + @frozen public enum EnterpriseCustomPropertiesForOrganizationsPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + case admin = "admin" + } + /// The level of permission to grant the access token for organization custom properties management at the enterprise level. + /// + /// - Remark: Generated from `#/components/schemas/app-permissions/enterprise_custom_properties_for_organizations`. + public var enterpriseCustomPropertiesForOrganizations: Components.Schemas.AppPermissions.EnterpriseCustomPropertiesForOrganizationsPayload? /// Creates a new `AppPermissions`. /// /// - Parameters: @@ -3946,11 +4385,12 @@ public enum Components { /// - statuses: The level of permission to grant the access token for commit statuses. /// - vulnerabilityAlerts: The level of permission to grant the access token to manage Dependabot alerts. /// - workflows: The level of permission to grant the access token to update GitHub Actions workflow files. + /// - customPropertiesForOrganizations: The level of permission to grant the access token to view and edit custom properties for an organization, when allowed by the property. /// - members: The level of permission to grant the access token for organization teams and members. /// - organizationAdministration: The level of permission to grant the access token to manage access to an organization. /// - organizationCustomRoles: The level of permission to grant the access token for custom repository roles management. /// - organizationCustomOrgRoles: The level of permission to grant the access token for custom organization roles management. - /// - organizationCustomProperties: The level of permission to grant the access token for custom property management. + /// - organizationCustomProperties: The level of permission to grant the access token for repository custom properties management at the organization level. /// - organizationCopilotSeatManagement: The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in public preview and is subject to change. /// - organizationAnnouncementBanners: The level of permission to grant the access token to view and manage announcement banners for an organization. /// - organizationEvents: The level of permission to grant the access token to view events triggered by an activity in an organization. @@ -3971,6 +4411,7 @@ public enum Components { /// - interactionLimits: The level of permission to grant the access token to view and manage interaction limits on a repository. /// - profile: The level of permission to grant the access token to manage the profile settings belonging to a user. /// - starring: The level of permission to grant the access token to list and manage repositories a user is starring. + /// - enterpriseCustomPropertiesForOrganizations: The level of permission to grant the access token for organization custom properties management at the enterprise level. public init( actions: Components.Schemas.AppPermissions.ActionsPayload? = nil, administration: Components.Schemas.AppPermissions.AdministrationPayload? = nil, @@ -3995,6 +4436,7 @@ public enum Components { statuses: Components.Schemas.AppPermissions.StatusesPayload? = nil, vulnerabilityAlerts: Components.Schemas.AppPermissions.VulnerabilityAlertsPayload? = nil, workflows: Components.Schemas.AppPermissions.WorkflowsPayload? = nil, + customPropertiesForOrganizations: Components.Schemas.AppPermissions.CustomPropertiesForOrganizationsPayload? = nil, members: Components.Schemas.AppPermissions.MembersPayload? = nil, organizationAdministration: Components.Schemas.AppPermissions.OrganizationAdministrationPayload? = nil, organizationCustomRoles: Components.Schemas.AppPermissions.OrganizationCustomRolesPayload? = nil, @@ -4019,7 +4461,8 @@ public enum Components { gpgKeys: Components.Schemas.AppPermissions.GpgKeysPayload? = nil, interactionLimits: Components.Schemas.AppPermissions.InteractionLimitsPayload? = nil, profile: Components.Schemas.AppPermissions.ProfilePayload? = nil, - starring: Components.Schemas.AppPermissions.StarringPayload? = nil + starring: Components.Schemas.AppPermissions.StarringPayload? = nil, + enterpriseCustomPropertiesForOrganizations: Components.Schemas.AppPermissions.EnterpriseCustomPropertiesForOrganizationsPayload? = nil ) { self.actions = actions self.administration = administration @@ -4044,6 +4487,7 @@ public enum Components { self.statuses = statuses self.vulnerabilityAlerts = vulnerabilityAlerts self.workflows = workflows + self.customPropertiesForOrganizations = customPropertiesForOrganizations self.members = members self.organizationAdministration = organizationAdministration self.organizationCustomRoles = organizationCustomRoles @@ -4069,6 +4513,7 @@ public enum Components { self.interactionLimits = interactionLimits self.profile = profile self.starring = starring + self.enterpriseCustomPropertiesForOrganizations = enterpriseCustomPropertiesForOrganizations } public enum CodingKeys: String, CodingKey { case actions @@ -4094,6 +4539,7 @@ public enum Components { case statuses case vulnerabilityAlerts = "vulnerability_alerts" case workflows + case customPropertiesForOrganizations = "custom_properties_for_organizations" case members case organizationAdministration = "organization_administration" case organizationCustomRoles = "organization_custom_roles" @@ -4119,6 +4565,7 @@ public enum Components { case interactionLimits = "interaction_limits" case profile case starring + case enterpriseCustomPropertiesForOrganizations = "enterprise_custom_properties_for_organizations" } } /// A GitHub user. @@ -4340,6 +4787,8 @@ public enum Components { public var htmlUrl: Swift.String /// - Remark: Generated from `#/components/schemas/installation/app_id`. public var appId: Swift.Int + /// - Remark: Generated from `#/components/schemas/installation/client_id`. + public var clientId: Swift.String? /// The ID of the user or organization this token is being scoped to. /// /// - Remark: Generated from `#/components/schemas/installation/target_id`. @@ -4378,6 +4827,7 @@ public enum Components { /// - repositoriesUrl: /// - htmlUrl: /// - appId: + /// - clientId: /// - targetId: The ID of the user or organization this token is being scoped to. /// - targetType: /// - permissions: @@ -4399,6 +4849,7 @@ public enum Components { repositoriesUrl: Swift.String, htmlUrl: Swift.String, appId: Swift.Int, + clientId: Swift.String? = nil, targetId: Swift.Int, targetType: Swift.String, permissions: Components.Schemas.AppPermissions, @@ -4420,6 +4871,7 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.htmlUrl = htmlUrl self.appId = appId + self.clientId = clientId self.targetId = targetId self.targetType = targetType self.permissions = permissions @@ -4442,6 +4894,7 @@ public enum Components { case repositoriesUrl = "repositories_url" case htmlUrl = "html_url" case appId = "app_id" + case clientId = "client_id" case targetId = "target_id" case targetType = "target_type" case permissions @@ -4500,6 +4953,91 @@ public enum Components { case htmlUrl = "html_url" } } + /// A GitHub organization. + /// + /// - Remark: Generated from `#/components/schemas/organization-simple`. + public struct OrganizationSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/organization-simple/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/organization-simple/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/repos_url`. + public var reposUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/hooks_url`. + public var hooksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/issues_url`. + public var issuesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/members_url`. + public var membersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/public_members_url`. + public var publicMembersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/avatar_url`. + public var avatarUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-simple/description`. + public var description: Swift.String? + /// Creates a new `OrganizationSimple`. + /// + /// - Parameters: + /// - login: + /// - id: + /// - nodeId: + /// - url: + /// - reposUrl: + /// - eventsUrl: + /// - hooksUrl: + /// - issuesUrl: + /// - membersUrl: + /// - publicMembersUrl: + /// - avatarUrl: + /// - description: + public init( + login: Swift.String, + id: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + reposUrl: Swift.String, + eventsUrl: Swift.String, + hooksUrl: Swift.String, + issuesUrl: Swift.String, + membersUrl: Swift.String, + publicMembersUrl: Swift.String, + avatarUrl: Swift.String, + description: Swift.String? = nil + ) { + self.login = login + self.id = id + self.nodeId = nodeId + self.url = url + self.reposUrl = reposUrl + self.eventsUrl = eventsUrl + self.hooksUrl = hooksUrl + self.issuesUrl = issuesUrl + self.membersUrl = membersUrl + self.publicMembersUrl = publicMembersUrl + self.avatarUrl = avatarUrl + self.description = description + } + public enum CodingKeys: String, CodingKey { + case login + case id + case nodeId = "node_id" + case url + case reposUrl = "repos_url" + case eventsUrl = "events_url" + case hooksUrl = "hooks_url" + case issuesUrl = "issues_url" + case membersUrl = "members_url" + case publicMembersUrl = "public_members_url" + case avatarUrl = "avatar_url" + case description + } + } /// The type of issue. /// /// - Remark: Generated from `#/components/schemas/issue-type`. @@ -4592,6 +5130,11 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -4612,6 +5155,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -4757,7 +5305,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: @@ -5053,12 +5601,36 @@ public enum Components { public var webCommitSignoffRequired: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/security_and_analysis`. public var securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? - /// Creates a new `MinimalRepository`. + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. /// - /// - Parameters: - /// - id: - /// - nodeId: - /// - name: + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public struct CustomPropertiesPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CustomPropertiesPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public var customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? + /// Creates a new `MinimalRepository`. + /// + /// - Parameters: + /// - id: + /// - nodeId: + /// - name: /// - fullName: /// - owner: /// - _private: @@ -5143,6 +5715,7 @@ public enum Components { /// - allowForking: /// - webCommitSignoffRequired: /// - securityAndAnalysis: + /// - customProperties: The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. public init( id: Swift.Int64, nodeId: Swift.String, @@ -5230,7 +5803,8 @@ public enum Components { watchers: Swift.Int? = nil, allowForking: Swift.Bool? = nil, webCommitSignoffRequired: Swift.Bool? = nil, - securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil + securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil, + customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -5319,6 +5893,7 @@ public enum Components { self.allowForking = allowForking self.webCommitSignoffRequired = webCommitSignoffRequired self.securityAndAnalysis = securityAndAnalysis + self.customProperties = customProperties } public enum CodingKeys: String, CodingKey { case id @@ -5408,91 +5983,73 @@ public enum Components { case allowForking = "allow_forking" case webCommitSignoffRequired = "web_commit_signoff_required" case securityAndAnalysis = "security_and_analysis" + case customProperties = "custom_properties" } } - /// A GitHub organization. + /// Custom property name and associated value /// - /// - Remark: Generated from `#/components/schemas/organization-simple`. - public struct OrganizationSimple: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/organization-simple/login`. - public var login: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/organization-simple/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/repos_url`. - public var reposUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/events_url`. - public var eventsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/hooks_url`. - public var hooksUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/issues_url`. - public var issuesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/members_url`. - public var membersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/public_members_url`. - public var publicMembersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/avatar_url`. - public var avatarUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/organization-simple/description`. - public var description: Swift.String? - /// Creates a new `OrganizationSimple`. + /// - Remark: Generated from `#/components/schemas/custom-property-value`. + public struct CustomPropertyValue: Codable, Hashable, Sendable { + /// The name of the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-value/property_name`. + public var propertyName: Swift.String + /// The value assigned to the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case2`. + case case2([Swift.String]) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The value assigned to the property + /// + /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. + public var value: Components.Schemas.CustomPropertyValue.ValuePayload? + /// Creates a new `CustomPropertyValue`. /// /// - Parameters: - /// - login: - /// - id: - /// - nodeId: - /// - url: - /// - reposUrl: - /// - eventsUrl: - /// - hooksUrl: - /// - issuesUrl: - /// - membersUrl: - /// - publicMembersUrl: - /// - avatarUrl: - /// - description: + /// - propertyName: The name of the property + /// - value: The value assigned to the property public init( - login: Swift.String, - id: Swift.Int, - nodeId: Swift.String, - url: Swift.String, - reposUrl: Swift.String, - eventsUrl: Swift.String, - hooksUrl: Swift.String, - issuesUrl: Swift.String, - membersUrl: Swift.String, - publicMembersUrl: Swift.String, - avatarUrl: Swift.String, - description: Swift.String? = nil + propertyName: Swift.String, + value: Components.Schemas.CustomPropertyValue.ValuePayload? = nil ) { - self.login = login - self.id = id - self.nodeId = nodeId - self.url = url - self.reposUrl = reposUrl - self.eventsUrl = eventsUrl - self.hooksUrl = hooksUrl - self.issuesUrl = issuesUrl - self.membersUrl = membersUrl - self.publicMembersUrl = publicMembersUrl - self.avatarUrl = avatarUrl - self.description = description + self.propertyName = propertyName + self.value = value } public enum CodingKeys: String, CodingKey { - case login - case id - case nodeId = "node_id" - case url - case reposUrl = "repos_url" - case eventsUrl = "events_url" - case hooksUrl = "hooks_url" - case issuesUrl = "issues_url" - case membersUrl = "members_url" - case publicMembersUrl = "public_members_url" - case avatarUrl = "avatar_url" - case description + case propertyName = "property_name" + case value } } /// Organization Full @@ -5614,6 +6171,10 @@ public enum Components { public var plan: Components.Schemas.OrganizationFull.PlanPayload? /// - Remark: Generated from `#/components/schemas/organization-full/default_repository_permission`. public var defaultRepositoryPermission: Swift.String? + /// The default branch for repositories created in this organization. + /// + /// - Remark: Generated from `#/components/schemas/organization-full/default_repository_branch`. + public var defaultRepositoryBranch: Swift.String? /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_repositories`. public var membersCanCreateRepositories: Swift.Bool? /// - Remark: Generated from `#/components/schemas/organization-full/two_factor_requirement_enabled`. @@ -5632,6 +6193,22 @@ public enum Components { public var membersCanCreatePublicPages: Swift.Bool? /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_private_pages`. public var membersCanCreatePrivatePages: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/members_can_delete_repositories`. + public var membersCanDeleteRepositories: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/members_can_change_repo_visibility`. + public var membersCanChangeRepoVisibility: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/members_can_invite_outside_collaborators`. + public var membersCanInviteOutsideCollaborators: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/members_can_delete_issues`. + public var membersCanDeleteIssues: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/display_commenter_full_name_setting_enabled`. + public var displayCommenterFullNameSettingEnabled: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/readers_can_create_discussions`. + public var readersCanCreateDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/members_can_create_teams`. + public var membersCanCreateTeams: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-full/members_can_view_dependency_insights`. + public var membersCanViewDependencyInsights: Swift.Bool? /// - Remark: Generated from `#/components/schemas/organization-full/members_can_fork_private_repositories`. public var membersCanForkPrivateRepositories: Swift.Bool? /// - Remark: Generated from `#/components/schemas/organization-full/web_commit_signoff_required`. @@ -5746,6 +6323,7 @@ public enum Components { /// - billingEmail: /// - plan: /// - defaultRepositoryPermission: + /// - defaultRepositoryBranch: The default branch for repositories created in this organization. /// - membersCanCreateRepositories: /// - twoFactorRequirementEnabled: /// - membersAllowedRepositoryCreationType: @@ -5755,6 +6333,14 @@ public enum Components { /// - membersCanCreatePages: /// - membersCanCreatePublicPages: /// - membersCanCreatePrivatePages: + /// - membersCanDeleteRepositories: + /// - membersCanChangeRepoVisibility: + /// - membersCanInviteOutsideCollaborators: + /// - membersCanDeleteIssues: + /// - displayCommenterFullNameSettingEnabled: + /// - readersCanCreateDiscussions: + /// - membersCanCreateTeams: + /// - membersCanViewDependencyInsights: /// - membersCanForkPrivateRepositories: /// - webCommitSignoffRequired: /// - advancedSecurityEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. @@ -5805,6 +6391,7 @@ public enum Components { billingEmail: Swift.String? = nil, plan: Components.Schemas.OrganizationFull.PlanPayload? = nil, defaultRepositoryPermission: Swift.String? = nil, + defaultRepositoryBranch: Swift.String? = nil, membersCanCreateRepositories: Swift.Bool? = nil, twoFactorRequirementEnabled: Swift.Bool? = nil, membersAllowedRepositoryCreationType: Swift.String? = nil, @@ -5814,6 +6401,14 @@ public enum Components { membersCanCreatePages: Swift.Bool? = nil, membersCanCreatePublicPages: Swift.Bool? = nil, membersCanCreatePrivatePages: Swift.Bool? = nil, + membersCanDeleteRepositories: Swift.Bool? = nil, + membersCanChangeRepoVisibility: Swift.Bool? = nil, + membersCanInviteOutsideCollaborators: Swift.Bool? = nil, + membersCanDeleteIssues: Swift.Bool? = nil, + displayCommenterFullNameSettingEnabled: Swift.Bool? = nil, + readersCanCreateDiscussions: Swift.Bool? = nil, + membersCanCreateTeams: Swift.Bool? = nil, + membersCanViewDependencyInsights: Swift.Bool? = nil, membersCanForkPrivateRepositories: Swift.Bool? = nil, webCommitSignoffRequired: Swift.Bool? = nil, advancedSecurityEnabledForNewRepositories: Swift.Bool? = nil, @@ -5864,6 +6459,7 @@ public enum Components { self.billingEmail = billingEmail self.plan = plan self.defaultRepositoryPermission = defaultRepositoryPermission + self.defaultRepositoryBranch = defaultRepositoryBranch self.membersCanCreateRepositories = membersCanCreateRepositories self.twoFactorRequirementEnabled = twoFactorRequirementEnabled self.membersAllowedRepositoryCreationType = membersAllowedRepositoryCreationType @@ -5873,6 +6469,14 @@ public enum Components { self.membersCanCreatePages = membersCanCreatePages self.membersCanCreatePublicPages = membersCanCreatePublicPages self.membersCanCreatePrivatePages = membersCanCreatePrivatePages + self.membersCanDeleteRepositories = membersCanDeleteRepositories + self.membersCanChangeRepoVisibility = membersCanChangeRepoVisibility + self.membersCanInviteOutsideCollaborators = membersCanInviteOutsideCollaborators + self.membersCanDeleteIssues = membersCanDeleteIssues + self.displayCommenterFullNameSettingEnabled = displayCommenterFullNameSettingEnabled + self.readersCanCreateDiscussions = readersCanCreateDiscussions + self.membersCanCreateTeams = membersCanCreateTeams + self.membersCanViewDependencyInsights = membersCanViewDependencyInsights self.membersCanForkPrivateRepositories = membersCanForkPrivateRepositories self.webCommitSignoffRequired = webCommitSignoffRequired self.advancedSecurityEnabledForNewRepositories = advancedSecurityEnabledForNewRepositories @@ -5924,6 +6528,7 @@ public enum Components { case billingEmail = "billing_email" case plan case defaultRepositoryPermission = "default_repository_permission" + case defaultRepositoryBranch = "default_repository_branch" case membersCanCreateRepositories = "members_can_create_repositories" case twoFactorRequirementEnabled = "two_factor_requirement_enabled" case membersAllowedRepositoryCreationType = "members_allowed_repository_creation_type" @@ -5933,6 +6538,14 @@ public enum Components { case membersCanCreatePages = "members_can_create_pages" case membersCanCreatePublicPages = "members_can_create_public_pages" case membersCanCreatePrivatePages = "members_can_create_private_pages" + case membersCanDeleteRepositories = "members_can_delete_repositories" + case membersCanChangeRepoVisibility = "members_can_change_repo_visibility" + case membersCanInviteOutsideCollaborators = "members_can_invite_outside_collaborators" + case membersCanDeleteIssues = "members_can_delete_issues" + case displayCommenterFullNameSettingEnabled = "display_commenter_full_name_setting_enabled" + case readersCanCreateDiscussions = "readers_can_create_discussions" + case membersCanCreateTeams = "members_can_create_teams" + case membersCanViewDependencyInsights = "members_can_view_dependency_insights" case membersCanForkPrivateRepositories = "members_can_fork_private_repositories" case webCommitSignoffRequired = "web_commit_signoff_required" case advancedSecurityEnabledForNewRepositories = "advanced_security_enabled_for_new_repositories" @@ -5995,6 +6608,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -6011,6 +6643,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -6024,7 +6659,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -6039,6 +6677,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -6054,6 +6695,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -6127,6 +6771,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -6145,6 +6808,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -6160,6 +6826,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -6175,6 +6844,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -6191,6 +6863,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -6781,6 +7456,15 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/org-membership/role`. public var role: Components.Schemas.OrgMembership.RolePayload + /// Whether the user has direct membership in the organization. + /// + /// - Remark: Generated from `#/components/schemas/org-membership/direct_membership`. + public var directMembership: Swift.Bool? + /// The slugs of the enterprise teams providing the user with indirect membership in the organization. + /// A limit of 100 enterprise team slugs is returned. + /// + /// - Remark: Generated from `#/components/schemas/org-membership/enterprise_teams_providing_indirect_membership`. + public var enterpriseTeamsProvidingIndirectMembership: [Swift.String]? /// - Remark: Generated from `#/components/schemas/org-membership/organization_url`. public var organizationUrl: Swift.String /// - Remark: Generated from `#/components/schemas/org-membership/organization`. @@ -6810,6 +7494,8 @@ public enum Components { /// - url: /// - state: The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. /// - role: The user's membership type in the organization. + /// - directMembership: Whether the user has direct membership in the organization. + /// - enterpriseTeamsProvidingIndirectMembership: The slugs of the enterprise teams providing the user with indirect membership in the organization. /// - organizationUrl: /// - organization: /// - user: @@ -6818,6 +7504,8 @@ public enum Components { url: Swift.String, state: Components.Schemas.OrgMembership.StatePayload, role: Components.Schemas.OrgMembership.RolePayload, + directMembership: Swift.Bool? = nil, + enterpriseTeamsProvidingIndirectMembership: [Swift.String]? = nil, organizationUrl: Swift.String, organization: Components.Schemas.OrganizationSimple, user: Components.Schemas.NullableSimpleUser? = nil, @@ -6826,6 +7514,8 @@ public enum Components { self.url = url self.state = state self.role = role + self.directMembership = directMembership + self.enterpriseTeamsProvidingIndirectMembership = enterpriseTeamsProvidingIndirectMembership self.organizationUrl = organizationUrl self.organization = organization self.user = user @@ -6835,6 +7525,8 @@ public enum Components { case url case state case role + case directMembership = "direct_membership" + case enterpriseTeamsProvidingIndirectMembership = "enterprise_teams_providing_indirect_membership" case organizationUrl = "organization_url" case organization case user @@ -7027,6 +7719,25 @@ public enum Components { public var repositoriesUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team-role-assignment/parent`. public var parent: Components.Schemas.NullableTeamSimple? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-role-assignment/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-role-assignment/type`. + public var _type: Components.Schemas.TeamRoleAssignment._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-role-assignment/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-role-assignment/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `TeamRoleAssignment`. /// /// - Parameters: @@ -7045,6 +7756,9 @@ public enum Components { /// - membersUrl: /// - repositoriesUrl: /// - parent: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( assignment: Components.Schemas.TeamRoleAssignment.AssignmentPayload? = nil, id: Swift.Int, @@ -7060,7 +7774,10 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, - parent: Components.Schemas.NullableTeamSimple? = nil + parent: Components.Schemas.NullableTeamSimple? = nil, + _type: Components.Schemas.TeamRoleAssignment._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.assignment = assignment self.id = id @@ -7077,6 +7794,9 @@ public enum Components { self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl self.parent = parent + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case assignment @@ -7094,6 +7814,9 @@ public enum Components { case membersUrl = "members_url" case repositoriesUrl = "repositories_url" case parent + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -7142,6 +7865,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-simple/type`. + public var _type: Components.Schemas.TeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `TeamSimple`. /// /// - Parameters: @@ -7158,6 +7900,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -7171,7 +7916,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.TeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -7186,6 +7934,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -7201,6 +7952,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// The Relationship a User has with a role. @@ -8025,72 +8779,6 @@ public enum Components { case valuesEditableBy = "values_editable_by" } } - /// Custom property name and associated value - /// - /// - Remark: Generated from `#/components/schemas/custom-property-value`. - public struct CustomPropertyValue: Codable, Hashable, Sendable { - /// The name of the property - /// - /// - Remark: Generated from `#/components/schemas/custom-property-value/property_name`. - public var propertyName: Swift.String - /// The value assigned to the property - /// - /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. - @frozen public enum ValuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/components/schemas/custom-property-value/value/case2`. - case case2([Swift.String]) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// The value assigned to the property - /// - /// - Remark: Generated from `#/components/schemas/custom-property-value/value`. - public var value: Components.Schemas.CustomPropertyValue.ValuePayload? - /// Creates a new `CustomPropertyValue`. - /// - /// - Parameters: - /// - propertyName: The name of the property - /// - value: The value assigned to the property - public init( - propertyName: Swift.String, - value: Components.Schemas.CustomPropertyValue.ValuePayload? = nil - ) { - self.propertyName = propertyName - self.value = value - } - public enum CodingKeys: String, CodingKey { - case propertyName = "property_name" - case value - } - } /// List of custom property values for a repository /// /// - Remark: Generated from `#/components/schemas/org-repo-custom-property-values`. @@ -8234,8 +8922,45 @@ public enum Components { try self.value2.encode(to: encoder) } } - } - /// Types generated from the `#/components/parameters` section of the OpenAPI document. + /// Check immutable releases settings for an organization. + /// + /// - Remark: Generated from `#/components/schemas/immutable-releases-organization-settings`. + public struct ImmutableReleasesOrganizationSettings: Codable, Hashable, Sendable { + /// The policy that controls how immutable releases are enforced in the organization. + /// + /// - Remark: Generated from `#/components/schemas/immutable-releases-organization-settings/enforced_repositories`. + @frozen public enum EnforcedRepositoriesPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case none = "none" + case selected = "selected" + } + /// The policy that controls how immutable releases are enforced in the organization. + /// + /// - Remark: Generated from `#/components/schemas/immutable-releases-organization-settings/enforced_repositories`. + public var enforcedRepositories: Components.Schemas.ImmutableReleasesOrganizationSettings.EnforcedRepositoriesPayload + /// The API URL to use to get or set the selected repositories for immutable releases enforcement, when `enforced_repositories` is set to `selected`. + /// + /// - Remark: Generated from `#/components/schemas/immutable-releases-organization-settings/selected_repositories_url`. + public var selectedRepositoriesUrl: Swift.String? + /// Creates a new `ImmutableReleasesOrganizationSettings`. + /// + /// - Parameters: + /// - enforcedRepositories: The policy that controls how immutable releases are enforced in the organization. + /// - selectedRepositoriesUrl: The API URL to use to get or set the selected repositories for immutable releases enforcement, when `enforced_repositories` is set to `selected`. + public init( + enforcedRepositories: Components.Schemas.ImmutableReleasesOrganizationSettings.EnforcedRepositoriesPayload, + selectedRepositoriesUrl: Swift.String? = nil + ) { + self.enforcedRepositories = enforcedRepositories + self.selectedRepositoriesUrl = selectedRepositoriesUrl + } + public enum CodingKeys: String, CodingKey { + case enforcedRepositories = "enforced_repositories" + case selectedRepositoriesUrl = "selected_repositories_url" + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. public enum Parameters { /// 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)." /// @@ -8266,18 +8991,26 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int - /// An organization ID. Only return organizations with an ID greater than this ID. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/components/parameters/since-org`. - public typealias SinceOrg = Swift.Int + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// The organization name. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/org`. public typealias Org = Swift.String - /// The handle for the GitHub user account. + /// The slug of the team name. /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias TeamSlug = Swift.String + /// An organization ID. Only return organizations with an ID greater than this ID. + /// + /// - Remark: Generated from `#/components/parameters/since-org`. + public typealias SinceOrg = Swift.Int + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/components/parameters/repository-id`. + public typealias RepositoryId = Swift.Int /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// /// - Remark: Generated from `#/components/parameters/hook-id`. @@ -8357,10 +9090,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/issue-type-id`. public typealias IssueTypeId = Swift.Int - /// The slug of the team name. - /// - /// - Remark: Generated from `#/components/parameters/team-slug`. - public typealias TeamSlug = Swift.String /// The unique identifier of the role. /// /// - Remark: Generated from `#/components/parameters/role-id`. @@ -8918,28 +9647,27 @@ public enum Operations { } } } - /// Get an organization + /// Get all custom property values for an organization /// - /// Gets information about an organization. - /// - /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, outside collaborators, guest collaborators, repository collaborators, or everyone with access to any repository within the organization to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). - /// - /// To see the full details about an organization, the authenticated user must be an organization owner. + /// Gets all custom property values that are set for an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization. + /// The organization must belong to an enterprise. /// - /// To see information about an organization's GitHub plan, GitHub Apps need the `Organization plan` permission. + /// Access requirements: + /// - Organization admins + /// - OAuth tokens and personal access tokens (classic) with the `read:org` scope + /// - Actors with the organization-level "read custom properties for an organization" fine-grained permission or above /// - /// - Remark: HTTP `GET /orgs/{org}`. - /// - Remark: Generated from `#/paths//orgs/{org}/get(orgs/get)`. - public enum OrgsGet { - public static let id: Swift.String = "orgs/get" + /// - Remark: HTTP `GET /organizations/{org}/org-properties/values`. + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/get(orgs/custom-properties-for-orgs-get-organization-values)`. + public enum OrgsCustomPropertiesForOrgsGetOrganizationValues { + public static let id: Swift.String = "orgs/custom-properties-for-orgs-get-organization-values" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/GET/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/GET/path/org`. + /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -8949,27 +9677,27 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsGet.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/GET/header`. + public var path: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsGet.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsGet.Input.Path, - headers: Operations.OrgsGet.Input.Headers = .init() + path: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input.Path, + headers: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -8977,15 +9705,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.OrganizationFull) + /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/GET/responses/200/content/application\/json`. + case json([Components.Schemas.CustomPropertyValue]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.OrganizationFull { + public var json: [Components.Schemas.CustomPropertyValue] { get throws { switch self { case let .json(body): @@ -8995,26 +9723,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsGet.Output.Ok.Body + public var body: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsGet.Output.Ok.Body) { + public init(body: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/get(orgs/get)/responses/200`. + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/get(orgs/custom-properties-for-orgs-get-organization-values)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGet.Output.Ok) + case ok(Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsGet.Output.Ok { + public var ok: Operations.OrgsCustomPropertiesForOrgsGetOrganizationValues.Output.Ok { get throws { switch self { case let .ok(response): @@ -9027,9 +9755,32 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/get(orgs/custom-properties-for-orgs-get-organization-values)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/get(orgs/get)/responses/404`. + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/get(orgs/custom-properties-for-orgs-get-organization-values)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -9081,30 +9832,28 @@ public enum Operations { } } } - /// Update an organization - /// - /// > [!WARNING] - /// > **Closing down notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). + /// Create or update custom property values for an organization /// - /// > [!WARNING] - /// > **Closing down notice:** Code security product enablement for new repositories through the organization API is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). - /// - /// Updates the organization's profile and member privileges. + /// Create new or update existing custom property values for an organization. + /// To remove a custom property value from an organization, set the property value to `null`. /// - /// The authenticated user must be an organization owner to use this endpoint. + /// The organization must belong to an enterprise. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. + /// Access requirements: + /// - Organization admins + /// - OAuth tokens and personal access tokens (classic) with the `admin:org` scope + /// - Actors with the organization-level "edit custom properties for an organization" fine-grained permission /// - /// - Remark: HTTP `PATCH /orgs/{org}`. - /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)`. - public enum OrgsUpdate { - public static let id: Swift.String = "orgs/update" + /// - Remark: HTTP `PATCH /organizations/{org}/org-properties/values`. + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)`. + public enum OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues { + public static let id: Swift.String = "orgs/custom-properties-for-orgs-create-or-update-organization-values" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/path`. + /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/PATCH/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/path/org`. + /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/PATCH/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -9114,362 +9863,3409 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsUpdate.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/header`. + public var path: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Path + /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsUpdate.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody`. + public var headers: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Headers + /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json`. + /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/PATCH/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// Billing email address. This address is not publicized. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/billing_email`. - public var billingEmail: Swift.String? - /// The company name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/company`. - public var company: Swift.String? - /// The publicly visible email address. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/email`. - public var email: Swift.String? - /// The Twitter username of the company. + /// A list of custom property names and associated values to apply to the organization. /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/twitter_username`. - public var twitterUsername: Swift.String? - /// The location. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/location`. - public var location: Swift.String? - /// The shorthand name of the company. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/name`. - public var name: Swift.String? - /// The description of the company. The maximum size is 160 characters. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/description`. - public var description: Swift.String? - /// Whether an organization can use organization projects. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/has_organization_projects`. - public var hasOrganizationProjects: Swift.Bool? - /// Whether repositories that belong to the organization can use repository projects. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/has_repository_projects`. - public var hasRepositoryProjects: Swift.Bool? - /// Default permission level members have for organization repositories. + /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/PATCH/requestBody/json/properties`. + public var properties: [Components.Schemas.CustomPropertyValue] + /// Creates a new `JsonPayload`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/default_repository_permission`. - @frozen public enum DefaultRepositoryPermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case read = "read" - case write = "write" - case admin = "admin" - case none = "none" + /// - Parameters: + /// - properties: A list of custom property names and associated values to apply to the organization. + public init(properties: [Components.Schemas.CustomPropertyValue]) { + self.properties = properties } - /// Default permission level members have for organization repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/default_repository_permission`. - public var defaultRepositoryPermission: Operations.OrgsUpdate.Input.Body.JsonPayload.DefaultRepositoryPermissionPayload? - /// Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_repositories`. - public var membersCanCreateRepositories: Swift.Bool? - /// Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_internal_repositories`. - public var membersCanCreateInternalRepositories: Swift.Bool? - /// Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_private_repositories`. - public var membersCanCreatePrivateRepositories: Swift.Bool? - /// Whether organization members can create public repositories, which are visible to anyone. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_public_repositories`. - public var membersCanCreatePublicRepositories: Swift.Bool? - /// Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. - /// **Note:** This parameter is closing down and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_allowed_repository_creation_type`. - @frozen public enum MembersAllowedRepositoryCreationTypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case _private = "private" - case none = "none" + public enum CodingKeys: String, CodingKey { + case properties } - /// Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. - /// **Note:** This parameter is closing down and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_allowed_repository_creation_type`. - public var membersAllowedRepositoryCreationType: Operations.OrgsUpdate.Input.Body.JsonPayload.MembersAllowedRepositoryCreationTypePayload? - /// Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_pages`. - public var membersCanCreatePages: Swift.Bool? - /// Whether organization members can create public GitHub Pages sites. Existing published sites will not be impacted. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_public_pages`. - public var membersCanCreatePublicPages: Swift.Bool? - /// Whether organization members can create private GitHub Pages sites. Existing published sites will not be impacted. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_private_pages`. - public var membersCanCreatePrivatePages: Swift.Bool? - /// Whether organization members can fork private organization repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_fork_private_repositories`. - public var membersCanForkPrivateRepositories: Swift.Bool? - /// Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/web_commit_signoff_required`. - public var webCommitSignoffRequired: Swift.Bool? - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/blog`. - public var blog: Swift.String? - /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - /// Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to this organization. - /// - /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." - /// - /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/advanced_security_enabled_for_new_repositories`. - @available(*, deprecated) - public var advancedSecurityEnabledForNewRepositories: Swift.Bool? - /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - /// Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization. - /// - /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." - /// - /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/dependabot_alerts_enabled_for_new_repositories`. - @available(*, deprecated) - public var dependabotAlertsEnabledForNewRepositories: Swift.Bool? - /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - /// Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization. - /// - /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." - /// - /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/dependabot_security_updates_enabled_for_new_repositories`. - @available(*, deprecated) - public var dependabotSecurityUpdatesEnabledForNewRepositories: Swift.Bool? - /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - /// Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization. - /// - /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." - /// - /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/dependency_graph_enabled_for_new_repositories`. - @available(*, deprecated) - public var dependencyGraphEnabledForNewRepositories: Swift.Bool? - /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - /// Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization. - /// - /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." - /// - /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_enabled_for_new_repositories`. - @available(*, deprecated) - public var secretScanningEnabledForNewRepositories: Swift.Bool? - /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - /// Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization. - /// - /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." - /// - /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_push_protection_enabled_for_new_repositories`. - @available(*, deprecated) - public var secretScanningPushProtectionEnabledForNewRepositories: Swift.Bool? - /// Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_push_protection_custom_link_enabled`. - public var secretScanningPushProtectionCustomLinkEnabled: Swift.Bool? - /// If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. + } + /// - Remark: Generated from `#/paths/organizations/{org}/org-properties/values/PATCH/requestBody/content/application\/json`. + case json(Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Body.JsonPayload) + } + public var body: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Path, + headers: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// No Content when custom property values are successfully created or updated + /// + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Output.NoContent) + /// No Content when custom property values are successfully created or updated + /// + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsCustomPropertiesForOrgsCreateOrUpdateOrganizationValues.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//organizations/{org}/org-properties/values/patch(orgs/custom-properties-for-orgs-create-or-update-organization-values)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get an organization + /// + /// Gets information about an organization. + /// + /// When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, outside collaborators, guest collaborators, repository collaborators, or everyone with access to any repository within the organization to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). + /// + /// To see the full details about an organization, the authenticated user must be an organization owner. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization. + /// + /// To see information about an organization's GitHub plan, GitHub Apps need the `Organization plan` permission. + /// + /// - Remark: HTTP `GET /orgs/{org}`. + /// - Remark: Generated from `#/paths//orgs/{org}/get(orgs/get)`. + public enum OrgsGet { + public static let id: Swift.String = "orgs/get" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsGet.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsGet.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OrgsGet.Input.Path, + headers: Operations.OrgsGet.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.OrganizationFull) + /// The associated value of the enum case if `self` is `.json`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_push_protection_custom_link`. - public var secretScanningPushProtectionCustomLink: Swift.String? - /// Controls whether or not deploy keys may be added and used for repositories in the organization. + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.OrganizationFull { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsGet.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsGet.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/get(orgs/get)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsGet.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsGet.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/get(orgs/get)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update an organization + /// + /// > [!WARNING] + /// > **Closing down notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). + /// + /// > [!WARNING] + /// > **Closing down notice:** Code security product enablement for new repositories through the organization API is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/). + /// + /// Updates the organization's profile and member privileges. + /// + /// The authenticated user must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}`. + /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)`. + public enum OrgsUpdate { + public static let id: Swift.String = "orgs/update" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsUpdate.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsUpdate.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Billing email address. This address is not publicized. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/billing_email`. + public var billingEmail: Swift.String? + /// The company name. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/company`. + public var company: Swift.String? + /// The publicly visible email address. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/email`. + public var email: Swift.String? + /// The Twitter username of the company. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/twitter_username`. + public var twitterUsername: Swift.String? + /// The location. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/location`. + public var location: Swift.String? + /// The shorthand name of the company. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// The description of the company. The maximum size is 160 characters. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/description`. + public var description: Swift.String? + /// Whether an organization can use organization projects. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/has_organization_projects`. + public var hasOrganizationProjects: Swift.Bool? + /// Whether repositories that belong to the organization can use repository projects. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/has_repository_projects`. + public var hasRepositoryProjects: Swift.Bool? + /// Default permission level members have for organization repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/default_repository_permission`. + @frozen public enum DefaultRepositoryPermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + case admin = "admin" + case none = "none" + } + /// Default permission level members have for organization repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/default_repository_permission`. + public var defaultRepositoryPermission: Operations.OrgsUpdate.Input.Body.JsonPayload.DefaultRepositoryPermissionPayload? + /// Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_repositories`. + public var membersCanCreateRepositories: Swift.Bool? + /// Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_internal_repositories`. + public var membersCanCreateInternalRepositories: Swift.Bool? + /// Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_private_repositories`. + public var membersCanCreatePrivateRepositories: Swift.Bool? + /// Whether organization members can create public repositories, which are visible to anyone. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_public_repositories`. + public var membersCanCreatePublicRepositories: Swift.Bool? + /// Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. + /// **Note:** This parameter is closing down and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_allowed_repository_creation_type`. + @frozen public enum MembersAllowedRepositoryCreationTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case _private = "private" + case none = "none" + } + /// Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. + /// **Note:** This parameter is closing down and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_allowed_repository_creation_type`. + public var membersAllowedRepositoryCreationType: Operations.OrgsUpdate.Input.Body.JsonPayload.MembersAllowedRepositoryCreationTypePayload? + /// Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_pages`. + public var membersCanCreatePages: Swift.Bool? + /// Whether organization members can create public GitHub Pages sites. Existing published sites will not be impacted. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_public_pages`. + public var membersCanCreatePublicPages: Swift.Bool? + /// Whether organization members can create private GitHub Pages sites. Existing published sites will not be impacted. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_create_private_pages`. + public var membersCanCreatePrivatePages: Swift.Bool? + /// Whether organization members can fork private organization repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/members_can_fork_private_repositories`. + public var membersCanForkPrivateRepositories: Swift.Bool? + /// Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/web_commit_signoff_required`. + public var webCommitSignoffRequired: Swift.Bool? + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/blog`. + public var blog: Swift.String? + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// + /// Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to this organization. + /// + /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// + /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/advanced_security_enabled_for_new_repositories`. + @available(*, deprecated) + public var advancedSecurityEnabledForNewRepositories: Swift.Bool? + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// + /// Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization. + /// + /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// + /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/dependabot_alerts_enabled_for_new_repositories`. + @available(*, deprecated) + public var dependabotAlertsEnabledForNewRepositories: Swift.Bool? + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// + /// Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization. + /// + /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// + /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/dependabot_security_updates_enabled_for_new_repositories`. + @available(*, deprecated) + public var dependabotSecurityUpdatesEnabledForNewRepositories: Swift.Bool? + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// + /// Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization. + /// + /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// + /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/dependency_graph_enabled_for_new_repositories`. + @available(*, deprecated) + public var dependencyGraphEnabledForNewRepositories: Swift.Bool? + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// + /// Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization. + /// + /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// + /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_enabled_for_new_repositories`. + @available(*, deprecated) + public var secretScanningEnabledForNewRepositories: Swift.Bool? + /// **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// + /// Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization. + /// + /// To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// + /// You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_push_protection_enabled_for_new_repositories`. + @available(*, deprecated) + public var secretScanningPushProtectionEnabledForNewRepositories: Swift.Bool? + /// Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_push_protection_custom_link_enabled`. + public var secretScanningPushProtectionCustomLinkEnabled: Swift.Bool? + /// If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/secret_scanning_push_protection_custom_link`. + public var secretScanningPushProtectionCustomLink: Swift.String? + /// Controls whether or not deploy keys may be added and used for repositories in the organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/deploy_keys_enabled_for_repositories`. + public var deployKeysEnabledForRepositories: Swift.Bool? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - billingEmail: Billing email address. This address is not publicized. + /// - company: The company name. + /// - email: The publicly visible email address. + /// - twitterUsername: The Twitter username of the company. + /// - location: The location. + /// - name: The shorthand name of the company. + /// - description: The description of the company. The maximum size is 160 characters. + /// - hasOrganizationProjects: Whether an organization can use organization projects. + /// - hasRepositoryProjects: Whether repositories that belong to the organization can use repository projects. + /// - defaultRepositoryPermission: Default permission level members have for organization repositories. + /// - membersCanCreateRepositories: Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. + /// - membersCanCreateInternalRepositories: Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + /// - membersCanCreatePrivateRepositories: Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + /// - membersCanCreatePublicRepositories: Whether organization members can create public repositories, which are visible to anyone. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + /// - membersAllowedRepositoryCreationType: Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. + /// - membersCanCreatePages: Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted. + /// - membersCanCreatePublicPages: Whether organization members can create public GitHub Pages sites. Existing published sites will not be impacted. + /// - membersCanCreatePrivatePages: Whether organization members can create private GitHub Pages sites. Existing published sites will not be impacted. + /// - membersCanForkPrivateRepositories: Whether organization members can fork private organization repositories. + /// - webCommitSignoffRequired: Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. + /// - blog: + /// - advancedSecurityEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - dependabotAlertsEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - dependabotSecurityUpdatesEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - dependencyGraphEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - secretScanningEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - secretScanningPushProtectionEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. + /// - secretScanningPushProtectionCustomLinkEnabled: Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. + /// - secretScanningPushProtectionCustomLink: If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. + /// - deployKeysEnabledForRepositories: Controls whether or not deploy keys may be added and used for repositories in the organization. + public init( + billingEmail: Swift.String? = nil, + company: Swift.String? = nil, + email: Swift.String? = nil, + twitterUsername: Swift.String? = nil, + location: Swift.String? = nil, + name: Swift.String? = nil, + description: Swift.String? = nil, + hasOrganizationProjects: Swift.Bool? = nil, + hasRepositoryProjects: Swift.Bool? = nil, + defaultRepositoryPermission: Operations.OrgsUpdate.Input.Body.JsonPayload.DefaultRepositoryPermissionPayload? = nil, + membersCanCreateRepositories: Swift.Bool? = nil, + membersCanCreateInternalRepositories: Swift.Bool? = nil, + membersCanCreatePrivateRepositories: Swift.Bool? = nil, + membersCanCreatePublicRepositories: Swift.Bool? = nil, + membersAllowedRepositoryCreationType: Operations.OrgsUpdate.Input.Body.JsonPayload.MembersAllowedRepositoryCreationTypePayload? = nil, + membersCanCreatePages: Swift.Bool? = nil, + membersCanCreatePublicPages: Swift.Bool? = nil, + membersCanCreatePrivatePages: Swift.Bool? = nil, + membersCanForkPrivateRepositories: Swift.Bool? = nil, + webCommitSignoffRequired: Swift.Bool? = nil, + blog: Swift.String? = nil, + advancedSecurityEnabledForNewRepositories: Swift.Bool? = nil, + dependabotAlertsEnabledForNewRepositories: Swift.Bool? = nil, + dependabotSecurityUpdatesEnabledForNewRepositories: Swift.Bool? = nil, + dependencyGraphEnabledForNewRepositories: Swift.Bool? = nil, + secretScanningEnabledForNewRepositories: Swift.Bool? = nil, + secretScanningPushProtectionEnabledForNewRepositories: Swift.Bool? = nil, + secretScanningPushProtectionCustomLinkEnabled: Swift.Bool? = nil, + secretScanningPushProtectionCustomLink: Swift.String? = nil, + deployKeysEnabledForRepositories: Swift.Bool? = nil + ) { + self.billingEmail = billingEmail + self.company = company + self.email = email + self.twitterUsername = twitterUsername + self.location = location + self.name = name + self.description = description + self.hasOrganizationProjects = hasOrganizationProjects + self.hasRepositoryProjects = hasRepositoryProjects + self.defaultRepositoryPermission = defaultRepositoryPermission + self.membersCanCreateRepositories = membersCanCreateRepositories + self.membersCanCreateInternalRepositories = membersCanCreateInternalRepositories + self.membersCanCreatePrivateRepositories = membersCanCreatePrivateRepositories + self.membersCanCreatePublicRepositories = membersCanCreatePublicRepositories + self.membersAllowedRepositoryCreationType = membersAllowedRepositoryCreationType + self.membersCanCreatePages = membersCanCreatePages + self.membersCanCreatePublicPages = membersCanCreatePublicPages + self.membersCanCreatePrivatePages = membersCanCreatePrivatePages + self.membersCanForkPrivateRepositories = membersCanForkPrivateRepositories + self.webCommitSignoffRequired = webCommitSignoffRequired + self.blog = blog + self.advancedSecurityEnabledForNewRepositories = advancedSecurityEnabledForNewRepositories + self.dependabotAlertsEnabledForNewRepositories = dependabotAlertsEnabledForNewRepositories + self.dependabotSecurityUpdatesEnabledForNewRepositories = dependabotSecurityUpdatesEnabledForNewRepositories + self.dependencyGraphEnabledForNewRepositories = dependencyGraphEnabledForNewRepositories + self.secretScanningEnabledForNewRepositories = secretScanningEnabledForNewRepositories + self.secretScanningPushProtectionEnabledForNewRepositories = secretScanningPushProtectionEnabledForNewRepositories + self.secretScanningPushProtectionCustomLinkEnabled = secretScanningPushProtectionCustomLinkEnabled + self.secretScanningPushProtectionCustomLink = secretScanningPushProtectionCustomLink + self.deployKeysEnabledForRepositories = deployKeysEnabledForRepositories + } + public enum CodingKeys: String, CodingKey { + case billingEmail = "billing_email" + case company + case email + case twitterUsername = "twitter_username" + case location + case name + case description + case hasOrganizationProjects = "has_organization_projects" + case hasRepositoryProjects = "has_repository_projects" + case defaultRepositoryPermission = "default_repository_permission" + case membersCanCreateRepositories = "members_can_create_repositories" + case membersCanCreateInternalRepositories = "members_can_create_internal_repositories" + case membersCanCreatePrivateRepositories = "members_can_create_private_repositories" + case membersCanCreatePublicRepositories = "members_can_create_public_repositories" + case membersAllowedRepositoryCreationType = "members_allowed_repository_creation_type" + case membersCanCreatePages = "members_can_create_pages" + case membersCanCreatePublicPages = "members_can_create_public_pages" + case membersCanCreatePrivatePages = "members_can_create_private_pages" + case membersCanForkPrivateRepositories = "members_can_fork_private_repositories" + case webCommitSignoffRequired = "web_commit_signoff_required" + case blog + case advancedSecurityEnabledForNewRepositories = "advanced_security_enabled_for_new_repositories" + case dependabotAlertsEnabledForNewRepositories = "dependabot_alerts_enabled_for_new_repositories" + case dependabotSecurityUpdatesEnabledForNewRepositories = "dependabot_security_updates_enabled_for_new_repositories" + case dependencyGraphEnabledForNewRepositories = "dependency_graph_enabled_for_new_repositories" + case secretScanningEnabledForNewRepositories = "secret_scanning_enabled_for_new_repositories" + case secretScanningPushProtectionEnabledForNewRepositories = "secret_scanning_push_protection_enabled_for_new_repositories" + case secretScanningPushProtectionCustomLinkEnabled = "secret_scanning_push_protection_custom_link_enabled" + case secretScanningPushProtectionCustomLink = "secret_scanning_push_protection_custom_link" + case deployKeysEnabledForRepositories = "deploy_keys_enabled_for_repositories" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/content/application\/json`. + case json(Operations.OrgsUpdate.Input.Body.JsonPayload) + } + public var body: Operations.OrgsUpdate.Input.Body? + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.OrgsUpdate.Input.Path, + headers: Operations.OrgsUpdate.Input.Headers = .init(), + body: Operations.OrgsUpdate.Input.Body? = nil + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.OrganizationFull) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.OrganizationFull { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsUpdate.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsUpdate.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsUpdate.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsUpdate.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/json`. + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/json/case1`. + case ValidationError(Components.Schemas.ValidationError) + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/json/case2`. + case ValidationErrorSimple(Components.Schemas.ValidationErrorSimple) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .ValidationError(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .ValidationErrorSimple(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .ValidationError(value): + try value.encode(to: encoder) + case let .ValidationErrorSimple(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/application\/json`. + case json(Operations.OrgsUpdate.Output.UnprocessableContent.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.OrgsUpdate.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsUpdate.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsUpdate.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation failed + /// + /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.OrgsUpdate.Output.UnprocessableContent) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.OrgsUpdate.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete an organization + /// + /// Deletes an organization and all its repositories. + /// + /// The organization login will be unavailable for 90 days after deletion. + /// + /// Please review the Terms of Service regarding account deletion before using this endpoint: + /// + /// https://docs.github.com/site-policy/github-terms/github-terms-of-service + /// + /// - Remark: HTTP `DELETE /orgs/{org}`. + /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)`. + public enum OrgsDelete { + public static let id: Swift.String = "orgs/delete" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsDelete.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsDelete.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OrgsDelete.Input.Path, + headers: Operations.OrgsDelete.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// Accepted + /// + /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)/responses/202`. + /// + /// HTTP response code: `202 accepted`. + case accepted(Components.Responses.Accepted) + /// The associated value of the enum case if `self` is `.accepted`. + /// + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Components.Responses.Accepted { + get throws { + switch self { + case let .accepted(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "accepted", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create artifact metadata storage record + /// + /// Create metadata storage records for artifacts associated with an organization. + /// This endpoint will create a new artifact storage record on behalf of any artifact matching the provided digest and + /// associated with a repository owned by the organization. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/storage-record`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)`. + public enum OrgsCreateArtifactStorageRecord { + public static let id: Swift.String = "orgs/create-artifact-storage-record" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsCreateArtifactStorageRecord.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsCreateArtifactStorageRecord.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the artifact. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/name`. + public var name: Swift.String + /// The digest of the artifact (algorithm:hex-encoded-digest). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/digest`. + public var digest: Swift.String + /// The URL where the artifact is stored. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/artifact_url`. + public var artifactUrl: Swift.String? + /// The path of the artifact. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/path`. + public var path: Swift.String? + /// The base URL of the artifact registry. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/registry_url`. + public var registryUrl: Swift.String + /// The repository name within the registry. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/repository`. + public var repository: Swift.String? + /// The status of the artifact (e.g., active, inactive). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case active = "active" + case eol = "eol" + case deleted = "deleted" + } + /// The status of the artifact (e.g., active, inactive). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/status`. + public var status: Operations.OrgsCreateArtifactStorageRecord.Input.Body.JsonPayload.StatusPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the artifact. + /// - digest: The digest of the artifact (algorithm:hex-encoded-digest). + /// - artifactUrl: The URL where the artifact is stored. + /// - path: The path of the artifact. + /// - registryUrl: The base URL of the artifact registry. + /// - repository: The repository name within the registry. + /// - status: The status of the artifact (e.g., active, inactive). + public init( + name: Swift.String, + digest: Swift.String, + artifactUrl: Swift.String? = nil, + path: Swift.String? = nil, + registryUrl: Swift.String, + repository: Swift.String? = nil, + status: Operations.OrgsCreateArtifactStorageRecord.Input.Body.JsonPayload.StatusPayload? = nil + ) { + self.name = name + self.digest = digest + self.artifactUrl = artifactUrl + self.path = path + self.registryUrl = registryUrl + self.repository = repository + self.status = status + } + public enum CodingKeys: String, CodingKey { + case name + case digest + case artifactUrl = "artifact_url" + case path + case registryUrl = "registry_url" + case repository + case status + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/content/application\/json`. + case json(Operations.OrgsCreateArtifactStorageRecord.Input.Body.JsonPayload) + } + public var body: Operations.OrgsCreateArtifactStorageRecord.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.OrgsCreateArtifactStorageRecord.Input.Path, + headers: Operations.OrgsCreateArtifactStorageRecord.Input.Headers = .init(), + body: Operations.OrgsCreateArtifactStorageRecord.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/total_count`. + public var totalCount: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload`. + public struct StorageRecordsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/digest`. + public var digest: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/artifact_url`. + public var artifactUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/registry_url`. + public var registryUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/repository`. + public var repository: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/status`. + public var status: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/created_at`. + public var createdAt: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/updated_at`. + public var updatedAt: Swift.String? + /// Creates a new `StorageRecordsPayloadPayload`. + /// + /// - Parameters: + /// - id: + /// - name: + /// - digest: + /// - artifactUrl: + /// - registryUrl: + /// - repository: + /// - status: + /// - createdAt: + /// - updatedAt: + public init( + id: Swift.Int? = nil, + name: Swift.String? = nil, + digest: Swift.String? = nil, + artifactUrl: Swift.String? = nil, + registryUrl: Swift.String? = nil, + repository: Swift.String? = nil, + status: Swift.String? = nil, + createdAt: Swift.String? = nil, + updatedAt: Swift.String? = nil + ) { + self.id = id + self.name = name + self.digest = digest + self.artifactUrl = artifactUrl + self.registryUrl = registryUrl + self.repository = repository + self.status = status + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case name + case digest + case artifactUrl = "artifact_url" + case registryUrl = "registry_url" + case repository + case status + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/storage_records`. + public typealias StorageRecordsPayload = [Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.StorageRecordsPayloadPayload] + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/storage_records`. + public var storageRecords: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.StorageRecordsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - storageRecords: + public init( + totalCount: Swift.Int? = nil, + storageRecords: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.StorageRecordsPayload? = nil + ) { + self.totalCount = totalCount + self.storageRecords = storageRecords + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case storageRecords = "storage_records" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/application\/json`. + case json(Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body) { + self.body = body + } + } + /// Artifact metadata storage record stored successfully. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsCreateArtifactStorageRecord.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsCreateArtifactStorageRecord.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List artifact storage records + /// + /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. + /// + /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. + public enum OrgsListArtifactStorageRecords { + public static let id: Swift.String = "orgs/list-artifact-storage-records" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/path/org`. + public var org: Components.Parameters.Org + /// The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/path/subject_digest`. + public var subjectDigest: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - subjectDigest: The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. + public init( + org: Components.Parameters.Org, + subjectDigest: Swift.String + ) { + self.org = org + self.subjectDigest = subjectDigest + } + } + public var path: Operations.OrgsListArtifactStorageRecords.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsListArtifactStorageRecords.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OrgsListArtifactStorageRecords.Input.Path, + headers: Operations.OrgsListArtifactStorageRecords.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The number of storage records for this digest and organization + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload`. + public struct StorageRecordsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/digest`. + public var digest: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/artifact_url`. + public var artifactUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/registry_url`. + public var registryUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/repository`. + public var repository: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/status`. + public var status: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/created_at`. + public var createdAt: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/StorageRecordsPayload/updated_at`. + public var updatedAt: Swift.String? + /// Creates a new `StorageRecordsPayloadPayload`. + /// + /// - Parameters: + /// - id: + /// - name: + /// - digest: + /// - artifactUrl: + /// - registryUrl: + /// - repository: + /// - status: + /// - createdAt: + /// - updatedAt: + public init( + id: Swift.Int? = nil, + name: Swift.String? = nil, + digest: Swift.String? = nil, + artifactUrl: Swift.String? = nil, + registryUrl: Swift.String? = nil, + repository: Swift.String? = nil, + status: Swift.String? = nil, + createdAt: Swift.String? = nil, + updatedAt: Swift.String? = nil + ) { + self.id = id + self.name = name + self.digest = digest + self.artifactUrl = artifactUrl + self.registryUrl = registryUrl + self.repository = repository + self.status = status + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case name + case digest + case artifactUrl = "artifact_url" + case registryUrl = "registry_url" + case repository + case status + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/storage_records`. + public typealias StorageRecordsPayload = [Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.StorageRecordsPayloadPayload] + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/json/storage_records`. + public var storageRecords: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.StorageRecordsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: The number of storage records for this digest and organization + /// - storageRecords: + public init( + totalCount: Swift.Int? = nil, + storageRecords: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload.StorageRecordsPayload? = nil + ) { + self.totalCount = totalCount + self.storageRecords = storageRecords + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case storageRecords = "storage_records" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/GET/responses/200/content/application\/json`. + case json(Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsListArtifactStorageRecords.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsListArtifactStorageRecords.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsListArtifactStorageRecords.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List attestations by bulk subject digests + /// + /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /orgs/{org}/attestations/bulk-list`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/bulk-list/post(orgs/list-attestations-bulk)`. + public enum OrgsListAttestationsBulk { + public static let id: Swift.String = "orgs/list-attestations-bulk" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsListAttestationsBulk.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - 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)." + /// - 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil + ) { + self.perPage = perPage + self.before = before + self.after = after + } + } + public var query: Operations.OrgsListAttestationsBulk.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsListAttestationsBulk.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// List of subject digests to fetch attestations for. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/requestBody/json/subject_digests`. + public var subjectDigests: [Swift.String] + /// Optional filter for fetching attestations with a given predicate type. + /// This option accepts `provenance`, `sbom`, `release`, or freeform text + /// for custom predicate types. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/requestBody/json/predicate_type`. + public var predicateType: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - subjectDigests: List of subject digests to fetch attestations for. + /// - predicateType: Optional filter for fetching attestations with a given predicate type. + public init( + subjectDigests: [Swift.String], + predicateType: Swift.String? = nil + ) { + self.subjectDigests = subjectDigests + self.predicateType = predicateType + } + public enum CodingKeys: String, CodingKey { + case subjectDigests = "subject_digests" + case predicateType = "predicate_type" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/requestBody/content/application\/json`. + case json(Operations.OrgsListAttestationsBulk.Input.Body.JsonPayload) + } + public var body: Operations.OrgsListAttestationsBulk.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + /// - body: + public init( + path: Operations.OrgsListAttestationsBulk.Input.Path, + query: Operations.OrgsListAttestationsBulk.Input.Query = .init(), + headers: Operations.OrgsListAttestationsBulk.Input.Headers = .init(), + body: Operations.OrgsListAttestationsBulk.Input.Body + ) { + self.path = path + self.query = query + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Mapping of subject digest to bundles. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests`. + public struct AttestationsSubjectDigestsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload`. + public struct AdditionalPropertiesPayloadPayload: Codable, Hashable, Sendable { + /// The bundle of the attestation. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle`. + public struct BundlePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/mediaType`. + public var mediaType: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/verificationMaterial`. + public struct VerificationMaterialPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `VerificationMaterialPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/verificationMaterial`. + public var verificationMaterial: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.VerificationMaterialPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/dsseEnvelope`. + public struct DsseEnvelopePayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `DsseEnvelopePayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/dsseEnvelope`. + public var dsseEnvelope: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.DsseEnvelopePayload? + /// Creates a new `BundlePayload`. + /// + /// - Parameters: + /// - mediaType: + /// - verificationMaterial: + /// - dsseEnvelope: + public init( + mediaType: Swift.String? = nil, + verificationMaterial: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.VerificationMaterialPayload? = nil, + dsseEnvelope: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.DsseEnvelopePayload? = nil + ) { + self.mediaType = mediaType + self.verificationMaterial = verificationMaterial + self.dsseEnvelope = dsseEnvelope + } + public enum CodingKeys: String, CodingKey { + case mediaType + case verificationMaterial + case dsseEnvelope + } + } + /// The bundle of the attestation. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle`. + public var bundle: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/repository_id`. + public var repositoryId: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle_url`. + public var bundleUrl: Swift.String? + /// Creates a new `AdditionalPropertiesPayloadPayload`. + /// + /// - Parameters: + /// - bundle: The bundle of the attestation. + /// - repositoryId: + /// - bundleUrl: + public init( + bundle: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload? = nil, + repositoryId: Swift.Int? = nil, + bundleUrl: Swift.String? = nil + ) { + self.bundle = bundle + self.repositoryId = repositoryId + self.bundleUrl = bundleUrl + } + public enum CodingKeys: String, CodingKey { + case bundle + case repositoryId = "repository_id" + case bundleUrl = "bundle_url" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/additionalProperties`. + public typealias AdditionalPropertiesPayload = [Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload] + /// A container of undocumented properties. + public var additionalProperties: [String: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayload?] + /// Creates a new `AttestationsSubjectDigestsPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: [String: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayload?] = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Mapping of subject digest to bundles. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests`. + public var attestationsSubjectDigests: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload? + /// Information about the current page. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info`. + public struct PageInfoPayload: Codable, Hashable, Sendable { + /// Indicates whether there is a next page. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info/has_next`. + public var hasNext: Swift.Bool? + /// Indicates whether there is a previous page. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info/has_previous`. + public var hasPrevious: Swift.Bool? + /// The cursor to the next page. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info/next`. + public var next: Swift.String? + /// The cursor to the previous page. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info/previous`. + public var previous: Swift.String? + /// Creates a new `PageInfoPayload`. + /// + /// - Parameters: + /// - hasNext: Indicates whether there is a next page. + /// - hasPrevious: Indicates whether there is a previous page. + /// - next: The cursor to the next page. + /// - previous: The cursor to the previous page. + public init( + hasNext: Swift.Bool? = nil, + hasPrevious: Swift.Bool? = nil, + next: Swift.String? = nil, + previous: Swift.String? = nil + ) { + self.hasNext = hasNext + self.hasPrevious = hasPrevious + self.next = next + self.previous = previous + } + public enum CodingKeys: String, CodingKey { + case hasNext = "has_next" + case hasPrevious = "has_previous" + case next + case previous + } + } + /// Information about the current page. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/json/page_info`. + public var pageInfo: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.PageInfoPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - attestationsSubjectDigests: Mapping of subject digest to bundles. + /// - pageInfo: Information about the current page. + public init( + attestationsSubjectDigests: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload? = nil, + pageInfo: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.PageInfoPayload? = nil + ) { + self.attestationsSubjectDigests = attestationsSubjectDigests + self.pageInfo = pageInfo + } + public enum CodingKeys: String, CodingKey { + case attestationsSubjectDigests = "attestations_subject_digests" + case pageInfo = "page_info" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/bulk-list/POST/responses/200/content/application\/json`. + case json(Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsListAttestationsBulk.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsListAttestationsBulk.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/bulk-list/post(orgs/list-attestations-bulk)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsListAttestationsBulk.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsListAttestationsBulk.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete attestations in bulk + /// + /// Delete artifact attestations in bulk by either subject digests or unique ID. + /// + /// - Remark: HTTP `POST /orgs/{org}/attestations/delete-request`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)`. + public enum OrgsDeleteAttestationsBulk { + public static let id: Swift.String = "orgs/delete-attestations-bulk" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsDeleteAttestationsBulk.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsDeleteAttestationsBulk.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// The request body must include either `subject_digests` or `attestation_ids`, but not both. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json`. + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// List of subject digests associated with the artifact attestations to delete. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case1/subject_digests`. + public var subjectDigests: [Swift.String] + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - subjectDigests: List of subject digests associated with the artifact attestations to delete. + public init(subjectDigests: [Swift.String]) { + self.subjectDigests = subjectDigests + } + public enum CodingKeys: String, CodingKey { + case subjectDigests = "subject_digests" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case1`. + case case1(Operations.OrgsDeleteAttestationsBulk.Input.Body.JsonPayload.Case1Payload) + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// List of unique IDs associated with the artifact attestations to delete. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case2/attestation_ids`. + public var attestationIds: [Swift.Int] + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - attestationIds: List of unique IDs associated with the artifact attestations to delete. + public init(attestationIds: [Swift.Int]) { + self.attestationIds = attestationIds + } + public enum CodingKeys: String, CodingKey { + case attestationIds = "attestation_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case2`. + case case2(Operations.OrgsDeleteAttestationsBulk.Input.Body.JsonPayload.Case2Payload) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/content/application\/json`. + case json(Operations.OrgsDeleteAttestationsBulk.Input.Body.JsonPayload) + } + public var body: Operations.OrgsDeleteAttestationsBulk.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.OrgsDeleteAttestationsBulk.Input.Path, + headers: Operations.OrgsDeleteAttestationsBulk.Input.Headers = .init(), + body: Operations.OrgsDeleteAttestationsBulk.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// Creates a new `Ok`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsDeleteAttestationsBulk.Output.Ok) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)/responses/200`. + /// + /// HTTP response code: `200 ok`. + public static var ok: Self { + .ok(.init()) + } + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsDeleteAttestationsBulk.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete attestations by subject digest + /// + /// Delete an artifact attestation by subject digest. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/digest/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)`. + public enum OrgsDeleteAttestationsBySubjectDigest { + public static let id: Swift.String = "orgs/delete-attestations-by-subject-digest" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// Subject Digest + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/DELETE/path/subject_digest`. + public var subjectDigest: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - subjectDigest: Subject Digest + public init( + org: Components.Parameters.Org, + subjectDigest: Swift.String + ) { + self.org = org + self.subjectDigest = subjectDigest + } + } + public var path: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Path, + headers: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// Creates a new `Ok`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsDeleteAttestationsBySubjectDigest.Output.Ok) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/200`. + /// + /// HTTP response code: `200 ok`. + public static var ok: Self { + .ok(.init()) + } + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsDeleteAttestationsBySubjectDigest.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsDeleteAttestationsBySubjectDigest.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsDeleteAttestationsBySubjectDigest.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List attestation repositories + /// + /// List repositories owned by the provided organization that have created at least one attested artifact + /// Results will be sorted in ascending order by repository ID + /// + /// - Remark: HTTP `GET /orgs/{org}/attestations/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/repositories/get(orgs/list-attestation-repositories)`. + public enum OrgsListAttestationRepositories { + public static let id: Swift.String = "orgs/list-attestation-repositories" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsListAttestationRepositories.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// Optional filter for fetching attestations with a given predicate type. + /// This option accepts `provenance`, `sbom`, `release`, or freeform text + /// for custom predicate types. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/query/predicate_type`. + public var predicateType: Swift.String? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - 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)." + /// - 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)." + /// - predicateType: Optional filter for fetching attestations with a given predicate type. + public init( + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + predicateType: Swift.String? = nil + ) { + self.perPage = perPage + self.before = before + self.after = after + self.predicateType = predicateType + } + } + public var query: Operations.OrgsListAttestationRepositories.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsListAttestationRepositories.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.OrgsListAttestationRepositories.Input.Path, + query: Operations.OrgsListAttestationRepositories.Input.Query = .init(), + headers: Operations.OrgsListAttestationRepositories.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content/JsonPayload`. + public struct JsonPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content/JsonPayload/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content/JsonPayload/name`. + public var name: Swift.String? + /// Creates a new `JsonPayloadPayload`. + /// + /// - Parameters: + /// - id: + /// - name: + public init( + id: Swift.Int? = nil, + name: Swift.String? = nil + ) { + self.id = id + self.name = name + } + public enum CodingKeys: String, CodingKey { + case id + case name + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content/json`. + public typealias JsonPayload = [Operations.OrgsListAttestationRepositories.Output.Ok.Body.JsonPayloadPayload] + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/repositories/GET/responses/200/content/application\/json`. + case json(Operations.OrgsListAttestationRepositories.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.OrgsListAttestationRepositories.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsListAttestationRepositories.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsListAttestationRepositories.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/repositories/get(orgs/list-attestation-repositories)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsListAttestationRepositories.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsListAttestationRepositories.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete attestations by ID + /// + /// Delete an artifact attestation by unique ID that is associated with a repository owned by an org. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/{attestation_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)`. + public enum OrgsDeleteAttestationsById { + public static let id: Swift.String = "orgs/delete-attestations-by-id" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_id}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// Attestation ID + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_id}/DELETE/path/attestation_id`. + public var attestationId: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - attestationId: Attestation ID + public init( + org: Components.Parameters.Org, + attestationId: Swift.Int + ) { + self.org = org + self.attestationId = attestationId + } + } + public var path: Operations.OrgsDeleteAttestationsById.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsDeleteAttestationsById.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OrgsDeleteAttestationsById.Input.Path, + headers: Operations.OrgsDeleteAttestationsById.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// Creates a new `Ok`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsDeleteAttestationsById.Output.Ok) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/200`. + /// + /// HTTP response code: `200 ok`. + public static var ok: Self { + .ok(.init()) + } + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsDeleteAttestationsById.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsDeleteAttestationsById.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsDeleteAttestationsById.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List attestations + /// + /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `GET /orgs/{org}/attestations/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)`. + public enum OrgsListAttestations { + public static let id: Swift.String = "orgs/list-attestations" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/path/org`. + public var org: Components.Parameters.Org + /// The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/path/subject_digest`. + public var subjectDigest: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - subjectDigest: The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. + public init( + org: Components.Parameters.Org, + subjectDigest: Swift.String + ) { + self.org = org + self.subjectDigest = subjectDigest + } + } + public var path: Operations.OrgsListAttestations.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// Optional filter for fetching attestations with a given predicate type. + /// This option accepts `provenance`, `sbom`, `release`, or freeform text + /// for custom predicate types. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/predicate_type`. + public var predicateType: Swift.String? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - 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)." + /// - 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)." + /// - predicateType: Optional filter for fetching attestations with a given predicate type. + public init( + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + predicateType: Swift.String? = nil + ) { + self.perPage = perPage + self.before = before + self.after = after + self.predicateType = predicateType + } + } + public var query: Operations.OrgsListAttestations.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsListAttestations.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.OrgsListAttestations.Input.Path, + query: Operations.OrgsListAttestations.Input.Query = .init(), + headers: Operations.OrgsListAttestations.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload`. + public struct AttestationsPayloadPayload: Codable, Hashable, Sendable { + /// The attestation's Sigstore Bundle. + /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle`. + public struct BundlePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/mediaType`. + public var mediaType: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/verificationMaterial`. + public struct VerificationMaterialPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `VerificationMaterialPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/verificationMaterial`. + public var verificationMaterial: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.VerificationMaterialPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/dsseEnvelope`. + public struct DsseEnvelopePayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `DsseEnvelopePayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/dsseEnvelope`. + public var dsseEnvelope: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.DsseEnvelopePayload? + /// Creates a new `BundlePayload`. + /// + /// - Parameters: + /// - mediaType: + /// - verificationMaterial: + /// - dsseEnvelope: + public init( + mediaType: Swift.String? = nil, + verificationMaterial: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.VerificationMaterialPayload? = nil, + dsseEnvelope: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.DsseEnvelopePayload? = nil + ) { + self.mediaType = mediaType + self.verificationMaterial = verificationMaterial + self.dsseEnvelope = dsseEnvelope + } + public enum CodingKeys: String, CodingKey { + case mediaType + case verificationMaterial + case dsseEnvelope + } + } + /// The attestation's Sigstore Bundle. + /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle`. + public var bundle: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/repository_id`. + public var repositoryId: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle_url`. + public var bundleUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/initiator`. + public var initiator: Swift.String? + /// Creates a new `AttestationsPayloadPayload`. + /// + /// - Parameters: + /// - bundle: The attestation's Sigstore Bundle. + /// - repositoryId: + /// - bundleUrl: + /// - initiator: + public init( + bundle: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload? = nil, + repositoryId: Swift.Int? = nil, + bundleUrl: Swift.String? = nil, + initiator: Swift.String? = nil + ) { + self.bundle = bundle + self.repositoryId = repositoryId + self.bundleUrl = bundleUrl + self.initiator = initiator + } + public enum CodingKeys: String, CodingKey { + case bundle + case repositoryId = "repository_id" + case bundleUrl = "bundle_url" + case initiator + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. + public typealias AttestationsPayload = [Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload] + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. + public var attestations: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - attestations: + public init(attestations: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayload? = nil) { + self.attestations = attestations + } + public enum CodingKeys: String, CodingKey { + case attestations + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/application\/json`. + case json(Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/json/deploy_keys_enabled_for_repositories`. - public var deployKeysEnabledForRepositories: Swift.Bool? - /// Creates a new `JsonPayload`. + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsListAttestations.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsListAttestations.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsListAttestations.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsListAttestations.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List users blocked by an organization + /// + /// List the users blocked by an organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/blocks`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/get(orgs/list-blocked-users)`. + public enum OrgsListBlockedUsers { + public static let id: Swift.String = "orgs/list-blocked-users" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsListBlockedUsers.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.OrgsListBlockedUsers.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsListBlockedUsers.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.OrgsListBlockedUsers.Input.Path, + query: Operations.OrgsListBlockedUsers.Input.Query = .init(), + headers: Operations.OrgsListBlockedUsers.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) + /// The associated value of the enum case if `self` is `.json`. /// - /// - Parameters: - /// - billingEmail: Billing email address. This address is not publicized. - /// - company: The company name. - /// - email: The publicly visible email address. - /// - twitterUsername: The Twitter username of the company. - /// - location: The location. - /// - name: The shorthand name of the company. - /// - description: The description of the company. The maximum size is 160 characters. - /// - hasOrganizationProjects: Whether an organization can use organization projects. - /// - hasRepositoryProjects: Whether repositories that belong to the organization can use repository projects. - /// - defaultRepositoryPermission: Default permission level members have for organization repositories. - /// - membersCanCreateRepositories: Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. - /// - membersCanCreateInternalRepositories: Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. - /// - membersCanCreatePrivateRepositories: Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. - /// - membersCanCreatePublicRepositories: Whether organization members can create public repositories, which are visible to anyone. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. - /// - membersAllowedRepositoryCreationType: Specifies which types of repositories non-admin organization members can create. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. - /// - membersCanCreatePages: Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted. - /// - membersCanCreatePublicPages: Whether organization members can create public GitHub Pages sites. Existing published sites will not be impacted. - /// - membersCanCreatePrivatePages: Whether organization members can create private GitHub Pages sites. Existing published sites will not be impacted. - /// - membersCanForkPrivateRepositories: Whether organization members can fork private organization repositories. - /// - webCommitSignoffRequired: Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. - /// - blog: - /// - advancedSecurityEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - dependabotAlertsEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - dependabotSecurityUpdatesEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - dependencyGraphEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - secretScanningEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - secretScanningPushProtectionEnabledForNewRepositories: **Endpoint closing down notice.** Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. - /// - secretScanningPushProtectionCustomLinkEnabled: Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. - /// - secretScanningPushProtectionCustomLink: If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. - /// - deployKeysEnabledForRepositories: Controls whether or not deploy keys may be added and used for repositories in the organization. - public init( - billingEmail: Swift.String? = nil, - company: Swift.String? = nil, - email: Swift.String? = nil, - twitterUsername: Swift.String? = nil, - location: Swift.String? = nil, - name: Swift.String? = nil, - description: Swift.String? = nil, - hasOrganizationProjects: Swift.Bool? = nil, - hasRepositoryProjects: Swift.Bool? = nil, - defaultRepositoryPermission: Operations.OrgsUpdate.Input.Body.JsonPayload.DefaultRepositoryPermissionPayload? = nil, - membersCanCreateRepositories: Swift.Bool? = nil, - membersCanCreateInternalRepositories: Swift.Bool? = nil, - membersCanCreatePrivateRepositories: Swift.Bool? = nil, - membersCanCreatePublicRepositories: Swift.Bool? = nil, - membersAllowedRepositoryCreationType: Operations.OrgsUpdate.Input.Body.JsonPayload.MembersAllowedRepositoryCreationTypePayload? = nil, - membersCanCreatePages: Swift.Bool? = nil, - membersCanCreatePublicPages: Swift.Bool? = nil, - membersCanCreatePrivatePages: Swift.Bool? = nil, - membersCanForkPrivateRepositories: Swift.Bool? = nil, - webCommitSignoffRequired: Swift.Bool? = nil, - blog: Swift.String? = nil, - advancedSecurityEnabledForNewRepositories: Swift.Bool? = nil, - dependabotAlertsEnabledForNewRepositories: Swift.Bool? = nil, - dependabotSecurityUpdatesEnabledForNewRepositories: Swift.Bool? = nil, - dependencyGraphEnabledForNewRepositories: Swift.Bool? = nil, - secretScanningEnabledForNewRepositories: Swift.Bool? = nil, - secretScanningPushProtectionEnabledForNewRepositories: Swift.Bool? = nil, - secretScanningPushProtectionCustomLinkEnabled: Swift.Bool? = nil, - secretScanningPushProtectionCustomLink: Swift.String? = nil, - deployKeysEnabledForRepositories: Swift.Bool? = nil - ) { - self.billingEmail = billingEmail - self.company = company - self.email = email - self.twitterUsername = twitterUsername - self.location = location - self.name = name - self.description = description - self.hasOrganizationProjects = hasOrganizationProjects - self.hasRepositoryProjects = hasRepositoryProjects - self.defaultRepositoryPermission = defaultRepositoryPermission - self.membersCanCreateRepositories = membersCanCreateRepositories - self.membersCanCreateInternalRepositories = membersCanCreateInternalRepositories - self.membersCanCreatePrivateRepositories = membersCanCreatePrivateRepositories - self.membersCanCreatePublicRepositories = membersCanCreatePublicRepositories - self.membersAllowedRepositoryCreationType = membersAllowedRepositoryCreationType - self.membersCanCreatePages = membersCanCreatePages - self.membersCanCreatePublicPages = membersCanCreatePublicPages - self.membersCanCreatePrivatePages = membersCanCreatePrivatePages - self.membersCanForkPrivateRepositories = membersCanForkPrivateRepositories - self.webCommitSignoffRequired = webCommitSignoffRequired - self.blog = blog - self.advancedSecurityEnabledForNewRepositories = advancedSecurityEnabledForNewRepositories - self.dependabotAlertsEnabledForNewRepositories = dependabotAlertsEnabledForNewRepositories - self.dependabotSecurityUpdatesEnabledForNewRepositories = dependabotSecurityUpdatesEnabledForNewRepositories - self.dependencyGraphEnabledForNewRepositories = dependencyGraphEnabledForNewRepositories - self.secretScanningEnabledForNewRepositories = secretScanningEnabledForNewRepositories - self.secretScanningPushProtectionEnabledForNewRepositories = secretScanningPushProtectionEnabledForNewRepositories - self.secretScanningPushProtectionCustomLinkEnabled = secretScanningPushProtectionCustomLinkEnabled - self.secretScanningPushProtectionCustomLink = secretScanningPushProtectionCustomLink - self.deployKeysEnabledForRepositories = deployKeysEnabledForRepositories + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.SimpleUser] { + get throws { + switch self { + case let .json(body): + return body + } + } } - public enum CodingKeys: String, CodingKey { - case billingEmail = "billing_email" - case company - case email - case twitterUsername = "twitter_username" - case location - case name - case description - case hasOrganizationProjects = "has_organization_projects" - case hasRepositoryProjects = "has_repository_projects" - case defaultRepositoryPermission = "default_repository_permission" - case membersCanCreateRepositories = "members_can_create_repositories" - case membersCanCreateInternalRepositories = "members_can_create_internal_repositories" - case membersCanCreatePrivateRepositories = "members_can_create_private_repositories" - case membersCanCreatePublicRepositories = "members_can_create_public_repositories" - case membersAllowedRepositoryCreationType = "members_allowed_repository_creation_type" - case membersCanCreatePages = "members_can_create_pages" - case membersCanCreatePublicPages = "members_can_create_public_pages" - case membersCanCreatePrivatePages = "members_can_create_private_pages" - case membersCanForkPrivateRepositories = "members_can_fork_private_repositories" - case webCommitSignoffRequired = "web_commit_signoff_required" - case blog - case advancedSecurityEnabledForNewRepositories = "advanced_security_enabled_for_new_repositories" - case dependabotAlertsEnabledForNewRepositories = "dependabot_alerts_enabled_for_new_repositories" - case dependabotSecurityUpdatesEnabledForNewRepositories = "dependabot_security_updates_enabled_for_new_repositories" - case dependencyGraphEnabledForNewRepositories = "dependency_graph_enabled_for_new_repositories" - case secretScanningEnabledForNewRepositories = "secret_scanning_enabled_for_new_repositories" - case secretScanningPushProtectionEnabledForNewRepositories = "secret_scanning_push_protection_enabled_for_new_repositories" - case secretScanningPushProtectionCustomLinkEnabled = "secret_scanning_push_protection_custom_link_enabled" - case secretScanningPushProtectionCustomLink = "secret_scanning_push_protection_custom_link" - case deployKeysEnabledForRepositories = "deploy_keys_enabled_for_repositories" + } + /// Received HTTP response body + public var body: Operations.OrgsListBlockedUsers.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsListBlockedUsers.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/get(orgs/list-blocked-users)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsListBlockedUsers.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsListBlockedUsers.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) } } - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/requestBody/content/application\/json`. - case json(Operations.OrgsUpdate.Input.Body.JsonPayload) } - public var body: Operations.OrgsUpdate.Input.Body? + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Check if a user is blocked by an organization + /// + /// Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. + /// + /// - Remark: HTTP `GET /orgs/{org}/blocks/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)`. + public enum OrgsCheckBlockedUser { + public static let id: Swift.String = "orgs/check-blocked-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/path/org`. + public var org: Components.Parameters.Org + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - username: The handle for the GitHub user account. + public init( + org: Components.Parameters.Org, + username: Components.Parameters.Username + ) { + self.org = org + self.username = username + } + } + public var path: Operations.OrgsCheckBlockedUser.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsCheckBlockedUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.OrgsUpdate.Input.Path, - headers: Operations.OrgsUpdate.Input.Headers = .init(), - body: Operations.OrgsUpdate.Input.Body? = nil + path: Operations.OrgsCheckBlockedUser.Input.Path, + headers: Operations.OrgsCheckBlockedUser.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/200/content`. + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// If the user is blocked + /// + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsCheckBlockedUser.Output.NoContent) + /// If the user is blocked + /// + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsCheckBlockedUser.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.OrganizationFull) + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/responses/404/content/application\/json`. + case json(Components.Schemas.BasicError) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.OrganizationFull { + public var json: Components.Schemas.BasicError { get throws { switch self { case let .json(body): @@ -9479,142 +13275,181 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsUpdate.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.OrgsCheckBlockedUser.Output.NotFound.Body + /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsUpdate.Output.Ok.Body) { + public init(body: Operations.OrgsCheckBlockedUser.Output.NotFound.Body) { self.body = body } } - /// Response + /// If the user is not blocked /// - /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)/responses/404`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsUpdate.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `404 notFound`. + case notFound(Operations.OrgsCheckBlockedUser.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsUpdate.Output.Ok { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.OrgsCheckBlockedUser.Output.NotFound { get throws { switch self { - case let .ok(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "notFound", response: self ) } } } - public struct UnprocessableContent: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/json`. - @frozen public enum JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/json/case1`. - case ValidationError(Components.Schemas.ValidationError) - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/json/case2`. - case ValidationErrorSimple(Components.Schemas.ValidationErrorSimple) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .ValidationError(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .ValidationErrorSimple(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .ValidationError(value): - try value.encode(to: encoder) - case let .ValidationErrorSimple(value): - try value.encode(to: encoder) - } - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/PATCH/responses/422/content/application\/json`. - case json(Operations.OrgsUpdate.Output.UnprocessableContent.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.OrgsUpdate.Output.UnprocessableContent.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) } - /// Received HTTP response body - public var body: Operations.OrgsUpdate.Output.UnprocessableContent.Body - /// Creates a new `UnprocessableContent`. + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Block a user from an organization + /// + /// Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned. + /// + /// - Remark: HTTP `PUT /orgs/{org}/blocks/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)`. + public enum OrgsBlockUser { + public static let id: Swift.String = "orgs/block-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/path/org`. + public var org: Components.Parameters.Org + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OrgsUpdate.Output.UnprocessableContent.Body) { - self.body = body + /// - org: The organization name. The name is not case sensitive. + /// - username: The handle for the GitHub user account. + public init( + org: Components.Parameters.Org, + username: Components.Parameters.Username + ) { + self.org = org + self.username = username + } + } + public var path: Operations.OrgsBlockUser.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept } } - /// Validation failed + public var headers: Operations.OrgsBlockUser.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OrgsBlockUser.Input.Path, + headers: Operations.OrgsBlockUser.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)/responses/204`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.OrgsUpdate.Output.UnprocessableContent) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsBlockUser.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.OrgsUpdate.Output.UnprocessableContent { + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsBlockUser.Output.NoContent { get throws { switch self { - case let .unprocessableContent(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "noContent", response: self ) } } } - /// Conflict + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/patch(orgs/update)/responses/409`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)/responses/422`. /// - /// HTTP response code: `409 conflict`. - case conflict(Components.Responses.Conflict) - /// The associated value of the enum case if `self` is `.conflict`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Components.Responses.Conflict { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .conflict(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "conflict", + expectedStatus: "unprocessableContent", response: self ) } @@ -9651,26 +13486,103 @@ public enum Operations { } } } - /// Delete an organization - /// - /// Deletes an organization and all its repositories. + /// Unblock a user from an organization /// - /// The organization login will be unavailable for 90 days after deletion. + /// Unblocks the given user on behalf of the specified organization. /// - /// Please review the Terms of Service regarding account deletion before using this endpoint: + /// - Remark: HTTP `DELETE /orgs/{org}/blocks/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/delete(orgs/unblock-user)`. + public enum OrgsUnblockUser { + public static let id: Swift.String = "orgs/unblock-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/DELETE/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - username: The handle for the GitHub user account. + public init( + org: Components.Parameters.Org, + username: Components.Parameters.Username + ) { + self.org = org + self.username = username + } + } + public var path: Operations.OrgsUnblockUser.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.OrgsUnblockUser.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/delete(orgs/unblock-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsUnblockUser.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/delete(orgs/unblock-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsUnblockUser.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// List failed organization invitations /// - /// https://docs.github.com/site-policy/github-terms/github-terms-of-service + /// The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure. /// - /// - Remark: HTTP `DELETE /orgs/{org}`. - /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)`. - public enum OrgsDelete { - public static let id: Swift.String = "orgs/delete" + /// - Remark: HTTP `GET /orgs/{org}/failed_invitations`. + /// - Remark: Generated from `#/paths//orgs/{org}/failed_invitations/get(orgs/list-failed-invitations)`. + public enum OrgsListFailedInvitations { + public static let id: Swift.String = "orgs/list-failed-invitations" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -9680,51 +13592,125 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsDelete.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/DELETE/header`. + public var path: Operations.OrgsListFailedInvitations.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.OrgsListFailedInvitations.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsDelete.Input.Headers + public var headers: Operations.OrgsListFailedInvitations.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.OrgsDelete.Input.Path, - headers: Operations.OrgsDelete.Input.Headers = .init() + path: Operations.OrgsListFailedInvitations.Input.Path, + query: Operations.OrgsListFailedInvitations.Input.Query = .init(), + headers: Operations.OrgsListFailedInvitations.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - /// Accepted + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.OrgsListFailedInvitations.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/content/application\/json`. + case json([Components.Schemas.OrganizationInvitation]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.OrganizationInvitation] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsListFailedInvitations.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.OrgsListFailedInvitations.Output.Ok.Headers = .init(), + body: Operations.OrgsListFailedInvitations.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)/responses/202`. + /// - Remark: Generated from `#/paths//orgs/{org}/failed_invitations/get(orgs/list-failed-invitations)/responses/200`. /// - /// HTTP response code: `202 accepted`. - case accepted(Components.Responses.Accepted) - /// The associated value of the enum case if `self` is `.accepted`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsListFailedInvitations.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.accepted`. - /// - SeeAlso: `.accepted`. - public var accepted: Components.Responses.Accepted { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsListFailedInvitations.Output.Ok { get throws { switch self { - case let .accepted(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "accepted", + expectedStatus: "ok", response: self ) } @@ -9732,7 +13718,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/failed_invitations/get(orgs/list-failed-invitations)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -9753,29 +13739,6 @@ public enum Operations { } } } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//orgs/{org}/delete(orgs/delete)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -9807,238 +13770,112 @@ public enum Operations { } } } - /// List attestations + /// List organization webhooks /// - /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. + /// List webhooks for an organization. /// - /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// The authenticated user must be an organization owner to use this endpoint. /// - /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// - Remark: HTTP `GET /orgs/{org}/attestations/{subject_digest}`. - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)`. - public enum OrgsListAttestations { - public static let id: Swift.String = "orgs/list-attestations" + /// - Remark: HTTP `GET /orgs/{org}/hooks`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/get(orgs/list-webhooks)`. + public enum OrgsListWebhooks { + public static let id: Swift.String = "orgs/list-webhooks" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/path/org`. public var org: Components.Parameters.Org - /// The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/path/subject_digest`. - public var subjectDigest: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - subjectDigest: The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. - public init( - org: Components.Parameters.Org, - subjectDigest: Swift.String - ) { - self.org = org - self.subjectDigest = subjectDigest - } - } - public var path: Operations.OrgsListAttestations.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/after`. - public var after: Components.Parameters.PaginationAfter? - /// Optional filter for fetching attestations with a given predicate type. - /// This option accepts `provenance`, `sbom`, or freeform text for custom predicate types. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/query/predicate_type`. - public var predicateType: Swift.String? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - 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)." - /// - 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)." - /// - predicateType: Optional filter for fetching attestations with a given predicate type. - public init( - perPage: Components.Parameters.PerPage? = nil, - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil, - predicateType: Swift.String? = nil - ) { - self.perPage = perPage - self.before = before - self.after = after - self.predicateType = predicateType - } - } - public var query: Operations.OrgsListAttestations.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.OrgsListAttestations.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.OrgsListAttestations.Input.Path, - query: Operations.OrgsListAttestations.Input.Query = .init(), - headers: Operations.OrgsListAttestations.Input.Headers = .init() - ) { - self.path = path - self.query = query - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload`. - public struct AttestationsPayloadPayload: Codable, Hashable, Sendable { - /// The attestation's Sigstore Bundle. - /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle`. - public struct BundlePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/mediaType`. - public var mediaType: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/verificationMaterial`. - public struct VerificationMaterialPayload: Codable, Hashable, Sendable { - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `VerificationMaterialPayload`. - /// - /// - Parameters: - /// - additionalProperties: A container of undocumented properties. - public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { - self.additionalProperties = additionalProperties - } - public init(from decoder: any Decoder) throws { - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) - } - public func encode(to encoder: any Encoder) throws { - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/verificationMaterial`. - public var verificationMaterial: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.VerificationMaterialPayload? - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/dsseEnvelope`. - public struct DsseEnvelopePayload: Codable, Hashable, Sendable { - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `DsseEnvelopePayload`. - /// - /// - Parameters: - /// - additionalProperties: A container of undocumented properties. - public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { - self.additionalProperties = additionalProperties - } - public init(from decoder: any Decoder) throws { - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) - } - public func encode(to encoder: any Encoder) throws { - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle/dsseEnvelope`. - public var dsseEnvelope: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.DsseEnvelopePayload? - /// Creates a new `BundlePayload`. - /// - /// - Parameters: - /// - mediaType: - /// - verificationMaterial: - /// - dsseEnvelope: - public init( - mediaType: Swift.String? = nil, - verificationMaterial: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.VerificationMaterialPayload? = nil, - dsseEnvelope: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload.DsseEnvelopePayload? = nil - ) { - self.mediaType = mediaType - self.verificationMaterial = verificationMaterial - self.dsseEnvelope = dsseEnvelope - } - public enum CodingKeys: String, CodingKey { - case mediaType - case verificationMaterial - case dsseEnvelope - } - } - /// The attestation's Sigstore Bundle. - /// Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle`. - public var bundle: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload? - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/repository_id`. - public var repositoryId: Swift.Int? - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle_url`. - public var bundleUrl: Swift.String? - /// Creates a new `AttestationsPayloadPayload`. - /// - /// - Parameters: - /// - bundle: The attestation's Sigstore Bundle. - /// - repositoryId: - /// - bundleUrl: - public init( - bundle: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload? = nil, - repositoryId: Swift.Int? = nil, - bundleUrl: Swift.String? = nil - ) { - self.bundle = bundle - self.repositoryId = repositoryId - self.bundleUrl = bundleUrl - } - public enum CodingKeys: String, CodingKey { - case bundle - case repositoryId = "repository_id" - case bundleUrl = "bundle_url" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. - public typealias AttestationsPayload = [Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload] - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. - public var attestations: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - attestations: - public init(attestations: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayload? = nil) { - self.attestations = attestations - } - public enum CodingKeys: String, CodingKey { - case attestations - } + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsListWebhooks.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.OrgsListWebhooks.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsListWebhooks.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.OrgsListWebhooks.Input.Path, + query: Operations.OrgsListWebhooks.Input.Query = .init(), + headers: Operations.OrgsListWebhooks.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link } - /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{subject_digest}/GET/responses/200/content/application\/json`. - case json(Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload) + } + /// Received HTTP response headers + public var headers: Operations.OrgsListWebhooks.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/responses/200/content/application\/json`. + case json([Components.Schemas.OrgHook]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.OrgsListAttestations.Output.Ok.Body.JsonPayload { + public var json: [Components.Schemas.OrgHook] { get throws { switch self { case let .json(body): @@ -10048,26 +13885,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListAttestations.Output.Ok.Body + public var body: Operations.OrgsListWebhooks.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.OrgsListAttestations.Output.Ok.Body) { + public init( + headers: Operations.OrgsListWebhooks.Output.Ok.Headers = .init(), + body: Operations.OrgsListWebhooks.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/get(orgs/list-webhooks)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListAttestations.Output.Ok) + case ok(Operations.OrgsListWebhooks.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListAttestations.Output.Ok { + public var ok: Operations.OrgsListWebhooks.Output.Ok { get throws { switch self { case let .ok(response): @@ -10080,6 +13922,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/get(orgs/list-webhooks)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -10111,20 +13976,25 @@ public enum Operations { } } } - /// List users blocked by an organization + /// Create an organization webhook /// - /// List the users blocked by an organization. + /// Create a hook that posts payloads in JSON format. /// - /// - Remark: HTTP `GET /orgs/{org}/blocks`. - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/get(orgs/list-blocked-users)`. - public enum OrgsListBlockedUsers { - public static let id: Swift.String = "orgs/list-blocked-users" + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or + /// edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `POST /orgs/{org}/hooks`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)`. + public enum OrgsCreateWebhook { + public static let id: Swift.String = "orgs/create-webhook" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -10134,70 +14004,158 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsListBlockedUsers.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page - } - } - public var query: Operations.OrgsListBlockedUsers.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/header`. + public var path: Operations.OrgsCreateWebhook.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListBlockedUsers.Input.Headers + public var headers: Operations.OrgsCreateWebhook.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Must be passed as "web". + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/name`. + public var name: Swift.String + /// Key/value pairs to provide settings for this webhook. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config`. + public struct ConfigPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/url`. + public var url: Components.Schemas.WebhookConfigUrl + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/content_type`. + public var contentType: Components.Schemas.WebhookConfigContentType? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/secret`. + public var secret: Components.Schemas.WebhookConfigSecret? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/insecure_ssl`. + public var insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/username`. + public var username: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/password`. + public var password: Swift.String? + /// Creates a new `ConfigPayload`. + /// + /// - Parameters: + /// - url: + /// - contentType: + /// - secret: + /// - insecureSsl: + /// - username: + /// - password: + public init( + url: Components.Schemas.WebhookConfigUrl, + contentType: Components.Schemas.WebhookConfigContentType? = nil, + secret: Components.Schemas.WebhookConfigSecret? = nil, + insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? = nil, + username: Swift.String? = nil, + password: Swift.String? = nil + ) { + self.url = url + self.contentType = contentType + self.secret = secret + self.insecureSsl = insecureSsl + self.username = username + self.password = password + } + public enum CodingKeys: String, CodingKey { + case url + case contentType = "content_type" + case secret + case insecureSsl = "insecure_ssl" + case username + case password + } + } + /// Key/value pairs to provide settings for this webhook. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config`. + public var config: Operations.OrgsCreateWebhook.Input.Body.JsonPayload.ConfigPayload + /// Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/events`. + public var events: [Swift.String]? + /// Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/active`. + public var active: Swift.Bool? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: Must be passed as "web". + /// - config: Key/value pairs to provide settings for this webhook. + /// - events: Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. + /// - active: Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + public init( + name: Swift.String, + config: Operations.OrgsCreateWebhook.Input.Body.JsonPayload.ConfigPayload, + events: [Swift.String]? = nil, + active: Swift.Bool? = nil + ) { + self.name = name + self.config = config + self.events = events + self.active = active + } + public enum CodingKeys: String, CodingKey { + case name + case config + case events + case active + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/content/application\/json`. + case json(Operations.OrgsCreateWebhook.Input.Body.JsonPayload) + } + public var body: Operations.OrgsCreateWebhook.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.OrgsListBlockedUsers.Input.Path, - query: Operations.OrgsListBlockedUsers.Input.Query = .init(), - headers: Operations.OrgsListBlockedUsers.Input.Headers = .init() + path: Operations.OrgsCreateWebhook.Input.Path, + headers: Operations.OrgsCreateWebhook.Input.Headers = .init(), + body: Operations.OrgsCreateWebhook.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/responses/201/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/responses/201/headers/Location`. + public var location: Swift.String? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - location: + public init(location: Swift.String? = nil) { + self.location = location + } + } + /// Received HTTP response headers + public var headers: Operations.OrgsCreateWebhook.Output.Created.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/GET/responses/200/content/application\/json`. - case json([Components.Schemas.SimpleUser]) + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/responses/201/content/application\/json`. + case json(Components.Schemas.OrgHook) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.SimpleUser] { + public var json: Components.Schemas.OrgHook { get throws { switch self { case let .json(body): @@ -10207,33 +14165,84 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListBlockedUsers.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.OrgsCreateWebhook.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.OrgsListBlockedUsers.Output.Ok.Body) { + public init( + headers: Operations.OrgsCreateWebhook.Output.Created.Headers = .init(), + body: Operations.OrgsCreateWebhook.Output.Created.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/get(orgs/list-blocked-users)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListBlockedUsers.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.OrgsCreateWebhook.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListBlockedUsers.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.OrgsCreateWebhook.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", response: self ) } @@ -10270,110 +14279,81 @@ public enum Operations { } } } - /// Check if a user is blocked by an organization + /// Get an organization webhook /// - /// Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. + /// Returns a webhook configured in an organization. To get only the webhook + /// `config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization). /// - /// - Remark: HTTP `GET /orgs/{org}/blocks/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)`. - public enum OrgsCheckBlockedUser { - public static let id: Swift.String = "orgs/check-blocked-user" + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/get(orgs/get-webhook)`. + public enum OrgsGetWebhook { + public static let id: Swift.String = "orgs/get-webhook" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/path/org`. public var org: Components.Parameters.Org - /// The handle for the GitHub user account. + /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/path/username`. - public var username: Components.Parameters.Username + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/path/hook_id`. + public var hookId: Components.Parameters.HookId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. + /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. public init( org: Components.Parameters.Org, - username: Components.Parameters.Username + hookId: Components.Parameters.HookId ) { self.org = org - self.username = username + self.hookId = hookId } } - public var path: Operations.OrgsCheckBlockedUser.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/header`. + public var path: Operations.OrgsGetWebhook.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsCheckBlockedUser.Input.Headers + public var headers: Operations.OrgsGetWebhook.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsCheckBlockedUser.Input.Path, - headers: Operations.OrgsCheckBlockedUser.Input.Headers = .init() + path: Operations.OrgsGetWebhook.Input.Path, + headers: Operations.OrgsGetWebhook.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// If the user is blocked - /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsCheckBlockedUser.Output.NoContent) - /// If the user is blocked - /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsCheckBlockedUser.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/responses/404/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/GET/responses/404/content/application\/json`. - case json(Components.Schemas.BasicError) + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.OrgHook) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { + public var json: Components.Schemas.OrgHook { get throws { switch self { case let .json(body): @@ -10383,26 +14363,49 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsCheckBlockedUser.Output.NotFound.Body - /// Creates a new `NotFound`. + public var body: Operations.OrgsGetWebhook.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsCheckBlockedUser.Output.NotFound.Body) { + public init(body: Operations.OrgsGetWebhook.Output.Ok.Body) { self.body = body } } - /// If the user is not blocked + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/get(orgs/check-blocked-user)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/get(orgs/get-webhook)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsGetWebhook.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsGetWebhook.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/get(orgs/get-webhook)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.OrgsCheckBlockedUser.Output.NotFound) + case notFound(Components.Responses.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.OrgsCheckBlockedUser.Output.NotFound { + public var notFound: Components.Responses.NotFound { get throws { switch self { case let .notFound(response): @@ -10446,95 +14449,207 @@ public enum Operations { } } } - /// Block a user from an organization + /// Update an organization webhook /// - /// Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned. + /// Updates a webhook configured in an organization. When you update a webhook, + /// the `secret` will be overwritten. If you previously had a `secret` set, you must + /// provide the same `secret` or set a new `secret` or the secret will be removed. If + /// you are only updating individual webhook `config` properties, use "[Update a webhook + /// configuration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)". /// - /// - Remark: HTTP `PUT /orgs/{org}/blocks/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)`. - public enum OrgsBlockUser { - public static let id: Swift.String = "orgs/block-user" + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/hooks/{hook_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)`. + public enum OrgsUpdateWebhook { + public static let id: Swift.String = "orgs/update-webhook" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/path/org`. public var org: Components.Parameters.Org - /// The handle for the GitHub user account. + /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/path/username`. - public var username: Components.Parameters.Username + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/path/hook_id`. + public var hookId: Components.Parameters.HookId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. + /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. public init( org: Components.Parameters.Org, - username: Components.Parameters.Username + hookId: Components.Parameters.HookId ) { self.org = org - self.username = username + self.hookId = hookId } } - public var path: Operations.OrgsBlockUser.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/PUT/header`. + public var path: Operations.OrgsUpdateWebhook.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsBlockUser.Input.Headers + public var headers: Operations.OrgsUpdateWebhook.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Key/value pairs to provide settings for this webhook. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config`. + public struct ConfigPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/url`. + public var url: Components.Schemas.WebhookConfigUrl + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/content_type`. + public var contentType: Components.Schemas.WebhookConfigContentType? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/secret`. + public var secret: Components.Schemas.WebhookConfigSecret? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/insecure_ssl`. + public var insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? + /// Creates a new `ConfigPayload`. + /// + /// - Parameters: + /// - url: + /// - contentType: + /// - secret: + /// - insecureSsl: + public init( + url: Components.Schemas.WebhookConfigUrl, + contentType: Components.Schemas.WebhookConfigContentType? = nil, + secret: Components.Schemas.WebhookConfigSecret? = nil, + insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? = nil + ) { + self.url = url + self.contentType = contentType + self.secret = secret + self.insecureSsl = insecureSsl + } + public enum CodingKeys: String, CodingKey { + case url + case contentType = "content_type" + case secret + case insecureSsl = "insecure_ssl" + } + } + /// Key/value pairs to provide settings for this webhook. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config`. + public var config: Operations.OrgsUpdateWebhook.Input.Body.JsonPayload.ConfigPayload? + /// Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/events`. + public var events: [Swift.String]? + /// Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/active`. + public var active: Swift.Bool? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - config: Key/value pairs to provide settings for this webhook. + /// - events: Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. + /// - active: Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + /// - name: + public init( + config: Operations.OrgsUpdateWebhook.Input.Body.JsonPayload.ConfigPayload? = nil, + events: [Swift.String]? = nil, + active: Swift.Bool? = nil, + name: Swift.String? = nil + ) { + self.config = config + self.events = events + self.active = active + self.name = name + } + public enum CodingKeys: String, CodingKey { + case config + case events + case active + case name + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.OrgsUpdateWebhook.Input.Body.JsonPayload) + } + public var body: Operations.OrgsUpdateWebhook.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.OrgsBlockUser.Input.Path, - headers: Operations.OrgsBlockUser.Input.Headers = .init() + path: Operations.OrgsUpdateWebhook.Input.Path, + headers: Operations.OrgsUpdateWebhook.Input.Headers = .init(), + body: Operations.OrgsUpdateWebhook.Input.Body? = nil ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.OrgHook) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.OrgHook { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsUpdateWebhook.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsUpdateWebhook.Output.Ok.Body) { + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsBlockUser.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsUpdateWebhook.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsBlockUser.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsUpdateWebhook.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } @@ -10542,7 +14657,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/put(orgs/block-user)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -10563,6 +14678,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -10594,45 +14732,67 @@ public enum Operations { } } } - /// Unblock a user from an organization + /// Delete an organization webhook /// - /// Unblocks the given user on behalf of the specified organization. + /// Delete a webhook for an organization. /// - /// - Remark: HTTP `DELETE /orgs/{org}/blocks/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/delete(orgs/unblock-user)`. - public enum OrgsUnblockUser { - public static let id: Swift.String = "orgs/unblock-user" + /// The authenticated user must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/hooks/{hook_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)`. + public enum OrgsDeleteWebhook { + public static let id: Swift.String = "orgs/delete-webhook" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The handle for the GitHub user account. + /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// - /// - Remark: Generated from `#/paths/orgs/{org}/blocks/{username}/DELETE/path/username`. - public var username: Components.Parameters.Username + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/DELETE/path/hook_id`. + public var hookId: Components.Parameters.HookId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. + /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. public init( org: Components.Parameters.Org, - username: Components.Parameters.Username + hookId: Components.Parameters.HookId ) { self.org = org - self.username = username + self.hookId = hookId + } + } + public var path: Operations.OrgsDeleteWebhook.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept } } - public var path: Operations.OrgsUnblockUser.Input.Path + public var headers: Operations.OrgsDeleteWebhook.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.OrgsUnblockUser.Input.Path) { + /// - headers: + public init( + path: Operations.OrgsDeleteWebhook.Input.Path, + headers: Operations.OrgsDeleteWebhook.Input.Headers = .init() + ) { self.path = path + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { @@ -10642,13 +14802,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/delete(orgs/unblock-user)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsUnblockUser.Output.NoContent) + case noContent(Operations.OrgsDeleteWebhook.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/blocks/{username}/delete(orgs/unblock-user)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -10658,7 +14818,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsUnblockUser.Output.NoContent { + public var noContent: Operations.OrgsDeleteWebhook.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -10671,113 +14831,134 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } - /// List failed organization invitations + /// Get a webhook configuration for an organization /// - /// The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure. + /// Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)." /// - /// - Remark: HTTP `GET /orgs/{org}/failed_invitations`. - /// - Remark: Generated from `#/paths//orgs/{org}/failed_invitations/get(orgs/list-failed-invitations)`. - public enum OrgsListFailedInvitations { - public static let id: Swift.String = "orgs/list-failed-invitations" + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/config`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/get(orgs/get-webhook-config-for-org)`. + public enum OrgsGetWebhookConfigForOrg { + public static let id: Swift.String = "orgs/get-webhook-config-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/path/org`. public var org: Components.Parameters.Org + /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/path/hook_id`. + public var hookId: Components.Parameters.HookId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.OrgsListFailedInvitations.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." + /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + org: Components.Parameters.Org, + hookId: Components.Parameters.HookId ) { - self.perPage = perPage - self.page = page + self.org = org + self.hookId = hookId } } - public var query: Operations.OrgsListFailedInvitations.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/header`. + public var path: Operations.OrgsGetWebhookConfigForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListFailedInvitations.Input.Headers + public var headers: Operations.OrgsGetWebhookConfigForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.OrgsListFailedInvitations.Input.Path, - query: Operations.OrgsListFailedInvitations.Input.Query = .init(), - headers: Operations.OrgsListFailedInvitations.Input.Headers = .init() + path: Operations.OrgsGetWebhookConfigForOrg.Input.Path, + headers: Operations.OrgsGetWebhookConfigForOrg.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsListFailedInvitations.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/failed_invitations/GET/responses/200/content/application\/json`. - case json([Components.Schemas.OrganizationInvitation]) + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/responses/200/content/application\/json`. + case json(Components.Schemas.WebhookConfig) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.OrganizationInvitation] { + public var json: Components.Schemas.WebhookConfig { get throws { switch self { case let .json(body): @@ -10787,31 +14968,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListFailedInvitations.Output.Ok.Body + public var body: Operations.OrgsGetWebhookConfigForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.OrgsListFailedInvitations.Output.Ok.Headers = .init(), - body: Operations.OrgsListFailedInvitations.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.OrgsGetWebhookConfigForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/failed_invitations/get(orgs/list-failed-invitations)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/get(orgs/get-webhook-config-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListFailedInvitations.Output.Ok) + case ok(Operations.OrgsGetWebhookConfigForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListFailedInvitations.Output.Ok { + public var ok: Operations.OrgsGetWebhookConfigForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -10824,29 +15000,6 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/failed_invitations/get(orgs/list-failed-invitations)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -10878,112 +15031,124 @@ public enum Operations { } } } - /// List organization webhooks + /// Update a webhook configuration for an organization /// - /// List webhooks for an organization. + /// Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)." /// - /// The authenticated user must be an organization owner to use this endpoint. + /// You must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/get(orgs/list-webhooks)`. - public enum OrgsListWebhooks { - public static let id: Swift.String = "orgs/list-webhooks" + /// - Remark: HTTP `PATCH /orgs/{org}/hooks/{hook_id}/config`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/patch(orgs/update-webhook-config-for-org)`. + public enum OrgsUpdateWebhookConfigForOrg { + public static let id: Swift.String = "orgs/update-webhook-config-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/path/org`. public var org: Components.Parameters.Org + /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/path/hook_id`. + public var hookId: Components.Parameters.HookId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.OrgsListWebhooks.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." + /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + org: Components.Parameters.Org, + hookId: Components.Parameters.HookId ) { - self.perPage = perPage - self.page = page + self.org = org + self.hookId = hookId } } - public var query: Operations.OrgsListWebhooks.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/header`. + public var path: Operations.OrgsUpdateWebhookConfigForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListWebhooks.Input.Headers + public var headers: Operations.OrgsUpdateWebhookConfigForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/url`. + public var url: Components.Schemas.WebhookConfigUrl? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/content_type`. + public var contentType: Components.Schemas.WebhookConfigContentType? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/secret`. + public var secret: Components.Schemas.WebhookConfigSecret? + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/insecure_ssl`. + public var insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - url: + /// - contentType: + /// - secret: + /// - insecureSsl: + public init( + url: Components.Schemas.WebhookConfigUrl? = nil, + contentType: Components.Schemas.WebhookConfigContentType? = nil, + secret: Components.Schemas.WebhookConfigSecret? = nil, + insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? = nil + ) { + self.url = url + self.contentType = contentType + self.secret = secret + self.insecureSsl = insecureSsl + } + public enum CodingKeys: String, CodingKey { + case url + case contentType = "content_type" + case secret + case insecureSsl = "insecure_ssl" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/content/application\/json`. + case json(Operations.OrgsUpdateWebhookConfigForOrg.Input.Body.JsonPayload) + } + public var body: Operations.OrgsUpdateWebhookConfigForOrg.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.OrgsListWebhooks.Input.Path, - query: Operations.OrgsListWebhooks.Input.Query = .init(), - headers: Operations.OrgsListWebhooks.Input.Headers = .init() + path: Operations.OrgsUpdateWebhookConfigForOrg.Input.Path, + headers: Operations.OrgsUpdateWebhookConfigForOrg.Input.Headers = .init(), + body: Operations.OrgsUpdateWebhookConfigForOrg.Input.Body? = nil ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsListWebhooks.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/GET/responses/200/content/application\/json`. - case json([Components.Schemas.OrgHook]) + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.WebhookConfig) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.OrgHook] { + public var json: Components.Schemas.WebhookConfig { get throws { switch self { case let .json(body): @@ -10993,31 +15158,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListWebhooks.Output.Ok.Body + public var body: Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.OrgsListWebhooks.Output.Ok.Headers = .init(), - body: Operations.OrgsListWebhooks.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/get(orgs/list-webhooks)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/patch(orgs/update-webhook-config-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListWebhooks.Output.Ok) + case ok(Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListWebhooks.Output.Ok { + public var ok: Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -11030,29 +15190,6 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/get(orgs/list-webhooks)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -11084,186 +15221,107 @@ public enum Operations { } } } - /// Create an organization webhook - /// - /// Create a hook that posts payloads in JSON format. - /// - /// You must be an organization owner to use this endpoint. + /// List deliveries for an organization webhook /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or - /// edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Returns a list of webhook deliveries for a webhook configured in an organization. /// - /// - Remark: HTTP `POST /orgs/{org}/hooks`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)`. - public enum OrgsCreateWebhook { - public static let id: Swift.String = "orgs/create-webhook" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/path/org`. - public var org: Components.Parameters.Org - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.OrgsCreateWebhook.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.OrgsCreateWebhook.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Must be passed as "web". - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/name`. - public var name: Swift.String - /// Key/value pairs to provide settings for this webhook. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config`. - public struct ConfigPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/url`. - public var url: Components.Schemas.WebhookConfigUrl - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/content_type`. - public var contentType: Components.Schemas.WebhookConfigContentType? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/secret`. - public var secret: Components.Schemas.WebhookConfigSecret? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/insecure_ssl`. - public var insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/username`. - public var username: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config/password`. - public var password: Swift.String? - /// Creates a new `ConfigPayload`. - /// - /// - Parameters: - /// - url: - /// - contentType: - /// - secret: - /// - insecureSsl: - /// - username: - /// - password: - public init( - url: Components.Schemas.WebhookConfigUrl, - contentType: Components.Schemas.WebhookConfigContentType? = nil, - secret: Components.Schemas.WebhookConfigSecret? = nil, - insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? = nil, - username: Swift.String? = nil, - password: Swift.String? = nil - ) { - self.url = url - self.contentType = contentType - self.secret = secret - self.insecureSsl = insecureSsl - self.username = username - self.password = password - } - public enum CodingKeys: String, CodingKey { - case url - case contentType = "content_type" - case secret - case insecureSsl = "insecure_ssl" - case username - case password - } - } - /// Key/value pairs to provide settings for this webhook. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/config`. - public var config: Operations.OrgsCreateWebhook.Input.Body.JsonPayload.ConfigPayload - /// Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/events`. - public var events: [Swift.String]? - /// Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/json/active`. - public var active: Swift.Bool? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: Must be passed as "web". - /// - config: Key/value pairs to provide settings for this webhook. - /// - events: Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. - /// - active: Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. - public init( - name: Swift.String, - config: Operations.OrgsCreateWebhook.Input.Body.JsonPayload.ConfigPayload, - events: [Swift.String]? = nil, - active: Swift.Bool? = nil - ) { - self.name = name - self.config = config - self.events = events - self.active = active - } - public enum CodingKeys: String, CodingKey { - case name - case config - case events - case active - } + /// You must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit + /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/deliveries`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)`. + public enum OrgsListWebhookDeliveries { + public static let id: Swift.String = "orgs/list-webhook-deliveries" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/path/org`. + public var org: Components.Parameters.Org + /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/path/hook_id`. + public var hookId: Components.Parameters.HookId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + public init( + org: Components.Parameters.Org, + hookId: Components.Parameters.HookId + ) { + self.org = org + self.hookId = hookId } - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/requestBody/content/application\/json`. - case json(Operations.OrgsCreateWebhook.Input.Body.JsonPayload) } - public var body: Operations.OrgsCreateWebhook.Input.Body + public var path: Operations.OrgsListWebhookDeliveries.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query/cursor`. + public var cursor: Components.Parameters.Cursor? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - cursor: Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + public init( + perPage: Components.Parameters.PerPage? = nil, + cursor: Components.Parameters.Cursor? = nil + ) { + self.perPage = perPage + self.cursor = cursor + } + } + public var query: Operations.OrgsListWebhookDeliveries.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsListWebhookDeliveries.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.OrgsCreateWebhook.Input.Path, - headers: Operations.OrgsCreateWebhook.Input.Headers = .init(), - body: Operations.OrgsCreateWebhook.Input.Body + path: Operations.OrgsListWebhookDeliveries.Input.Path, + query: Operations.OrgsListWebhookDeliveries.Input.Query = .init(), + headers: Operations.OrgsListWebhookDeliveries.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/responses/201/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/responses/201/headers/Location`. - public var location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - location: - public init(location: Swift.String? = nil) { - self.location = location - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsCreateWebhook.Output.Created.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/POST/responses/201/content/application\/json`. - case json(Components.Schemas.OrgHook) + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/responses/200/content/application\/json`. + case json([Components.Schemas.HookDeliveryItem]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.OrgHook { + public var json: [Components.Schemas.HookDeliveryItem] { get throws { switch self { case let .json(body): @@ -11273,84 +15331,79 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsCreateWebhook.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.OrgsListWebhookDeliveries.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.OrgsCreateWebhook.Output.Created.Headers = .init(), - body: Operations.OrgsCreateWebhook.Output.Created.Body - ) { - self.headers = headers + public init(body: Operations.OrgsListWebhookDeliveries.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.OrgsCreateWebhook.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsListWebhookDeliveries.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.OrgsCreateWebhook.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsListWebhookDeliveries.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } } } - /// Validation failed, or the endpoint has been spammed. + /// Bad Request /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)/responses/400`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { get throws { switch self { - case let .unprocessableContent(response): + case let .badRequest(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "badRequest", response: self ) } } } - /// Resource not found + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/post(orgs/create-webhook)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)/responses/422`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } @@ -11363,11 +15416,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -11378,74 +15434,81 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Get an organization webhook + /// Get a webhook delivery for an organization webhook /// - /// Returns a webhook configured in an organization. To get only the webhook - /// `config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization). + /// Returns a delivery for a webhook configured in an organization. /// /// You must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/get(orgs/get-webhook)`. - public enum OrgsGetWebhook { - public static let id: Swift.String = "orgs/get-webhook" + /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)`. + public enum OrgsGetWebhookDelivery { + public static let id: Swift.String = "orgs/get-webhook-delivery" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path/org`. public var org: Components.Parameters.Org /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/path/hook_id`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path/hook_id`. public var hookId: Components.Parameters.HookId + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path/delivery_id`. + public var deliveryId: Components.Parameters.DeliveryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// - deliveryId: public init( org: Components.Parameters.Org, - hookId: Components.Parameters.HookId + hookId: Components.Parameters.HookId, + deliveryId: Components.Parameters.DeliveryId ) { self.org = org self.hookId = hookId + self.deliveryId = deliveryId } } - public var path: Operations.OrgsGetWebhook.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/header`. + public var path: Operations.OrgsGetWebhookDelivery.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsGetWebhook.Input.Headers + public var headers: Operations.OrgsGetWebhookDelivery.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsGetWebhook.Input.Path, - headers: Operations.OrgsGetWebhook.Input.Headers = .init() + path: Operations.OrgsGetWebhookDelivery.Input.Path, + headers: Operations.OrgsGetWebhookDelivery.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -11453,15 +15516,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.OrgHook) + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.HookDelivery) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.OrgHook { + public var json: Components.Schemas.HookDelivery { get throws { switch self { case let .json(body): @@ -11471,56 +15534,79 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsGetWebhook.Output.Ok.Body + public var body: Operations.OrgsGetWebhookDelivery.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsGetWebhook.Output.Ok.Body) { + public init(body: Operations.OrgsGetWebhookDelivery.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/get(orgs/get-webhook)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetWebhook.Output.Ok) + case ok(Operations.OrgsGetWebhookDelivery.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsGetWebhook.Output.Ok { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsGetWebhookDelivery.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { get throws { switch self { - case let .ok(response): + case let .badRequest(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "badRequest", response: self ) } } } - /// Resource not found + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/get(orgs/get-webhook)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)/responses/422`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } @@ -11533,11 +15619,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -11548,262 +15637,151 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Update an organization webhook + /// Redeliver a delivery for an organization webhook /// - /// Updates a webhook configured in an organization. When you update a webhook, - /// the `secret` will be overwritten. If you previously had a `secret` set, you must - /// provide the same `secret` or set a new `secret` or the secret will be removed. If - /// you are only updating individual webhook `config` properties, use "[Update a webhook - /// configuration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)". + /// Redeliver a delivery for a webhook configured in an organization. /// /// You must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// - Remark: HTTP `PATCH /orgs/{org}/hooks/{hook_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)`. - public enum OrgsUpdateWebhook { - public static let id: Swift.String = "orgs/update-webhook" + /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)`. + public enum OrgsRedeliverWebhookDelivery { + public static let id: Swift.String = "orgs/redeliver-webhook-delivery" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/org`. public var org: Components.Parameters.Org /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/path/hook_id`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/hook_id`. public var hookId: Components.Parameters.HookId + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/delivery_id`. + public var deliveryId: Components.Parameters.DeliveryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// - deliveryId: public init( org: Components.Parameters.Org, - hookId: Components.Parameters.HookId + hookId: Components.Parameters.HookId, + deliveryId: Components.Parameters.DeliveryId ) { self.org = org self.hookId = hookId + self.deliveryId = deliveryId } } - public var path: Operations.OrgsUpdateWebhook.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/header`. + public var path: Operations.OrgsRedeliverWebhookDelivery.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsUpdateWebhook.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Key/value pairs to provide settings for this webhook. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config`. - public struct ConfigPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/url`. - public var url: Components.Schemas.WebhookConfigUrl - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/content_type`. - public var contentType: Components.Schemas.WebhookConfigContentType? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/secret`. - public var secret: Components.Schemas.WebhookConfigSecret? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config/insecure_ssl`. - public var insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? - /// Creates a new `ConfigPayload`. - /// - /// - Parameters: - /// - url: - /// - contentType: - /// - secret: - /// - insecureSsl: - public init( - url: Components.Schemas.WebhookConfigUrl, - contentType: Components.Schemas.WebhookConfigContentType? = nil, - secret: Components.Schemas.WebhookConfigSecret? = nil, - insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? = nil - ) { - self.url = url - self.contentType = contentType - self.secret = secret - self.insecureSsl = insecureSsl - } - public enum CodingKeys: String, CodingKey { - case url - case contentType = "content_type" - case secret - case insecureSsl = "insecure_ssl" - } - } - /// Key/value pairs to provide settings for this webhook. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/config`. - public var config: Operations.OrgsUpdateWebhook.Input.Body.JsonPayload.ConfigPayload? - /// Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/events`. - public var events: [Swift.String]? - /// Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/active`. - public var active: Swift.Bool? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/json/name`. - public var name: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - config: Key/value pairs to provide settings for this webhook. - /// - events: Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. - /// - active: Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. - /// - name: - public init( - config: Operations.OrgsUpdateWebhook.Input.Body.JsonPayload.ConfigPayload? = nil, - events: [Swift.String]? = nil, - active: Swift.Bool? = nil, - name: Swift.String? = nil - ) { - self.config = config - self.events = events - self.active = active - self.name = name - } - public enum CodingKeys: String, CodingKey { - case config - case events - case active - case name - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.OrgsUpdateWebhook.Input.Body.JsonPayload) - } - public var body: Operations.OrgsUpdateWebhook.Input.Body? + public var headers: Operations.OrgsRedeliverWebhookDelivery.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.OrgsUpdateWebhook.Input.Path, - headers: Operations.OrgsUpdateWebhook.Input.Headers = .init(), - body: Operations.OrgsUpdateWebhook.Input.Body? = nil + path: Operations.OrgsRedeliverWebhookDelivery.Input.Path, + headers: Operations.OrgsRedeliverWebhookDelivery.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.OrgHook) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.OrgHook { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OrgsUpdateWebhook.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OrgsUpdateWebhook.Output.Ok.Body) { - self.body = body - } - } - /// Response + /// Accepted /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/202`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsUpdateWebhook.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `202 accepted`. + case accepted(Components.Responses.Accepted) + /// The associated value of the enum case if `self` is `.accepted`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsUpdateWebhook.Output.Ok { + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Components.Responses.Accepted { get throws { switch self { - case let .ok(response): + case let .accepted(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "accepted", response: self ) } } } - /// Validation failed, or the endpoint has been spammed. + /// Bad Request /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/400`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { get throws { switch self { - case let .unprocessableContent(response): + case let .badRequest(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "badRequest", response: self ) } } } - /// Resource not found + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/patch(orgs/update-webhook)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/422`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } @@ -11816,11 +15794,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -11831,38 +15812,42 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Delete an organization webhook + /// Ping an organization webhook /// - /// Delete a webhook for an organization. + /// This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) + /// to be sent to the hook. /// - /// The authenticated user must be an organization owner to use this endpoint. + /// You must be an organization owner to use this endpoint. /// /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. /// - /// - Remark: HTTP `DELETE /orgs/{org}/hooks/{hook_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)`. - public enum OrgsDeleteWebhook { - public static let id: Swift.String = "orgs/delete-webhook" + /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/pings`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)`. + public enum OrgsPingWebhook { + public static let id: Swift.String = "orgs/ping-webhook" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path/org`. public var org: Components.Parameters.Org /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/DELETE/path/hook_id`. + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path/hook_id`. public var hookId: Components.Parameters.HookId /// Creates a new `Path`. /// @@ -11877,27 +15862,27 @@ public enum Operations { self.hookId = hookId } } - public var path: Operations.OrgsDeleteWebhook.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/DELETE/header`. + public var path: Operations.OrgsPingWebhook.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsDeleteWebhook.Input.Headers + public var headers: Operations.OrgsPingWebhook.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsDeleteWebhook.Input.Path, - headers: Operations.OrgsDeleteWebhook.Input.Headers = .init() + path: Operations.OrgsPingWebhook.Input.Path, + headers: Operations.OrgsPingWebhook.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -11910,13 +15895,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsDeleteWebhook.Output.NoContent) + case noContent(Operations.OrgsPingWebhook.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -11926,7 +15911,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsDeleteWebhook.Output.NoContent { + public var noContent: Operations.OrgsPingWebhook.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -11941,7 +15926,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/delete(orgs/delete-webhook)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -11993,270 +15978,168 @@ public enum Operations { } } } - /// Get a webhook configuration for an organization - /// - /// Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)." - /// - /// You must be an organization owner to use this endpoint. + /// Get route stats by actor /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Get API request count statistics for an actor broken down by route within a specified time frame. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/config`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/get(orgs/get-webhook-config-for-org)`. - public enum OrgsGetWebhookConfigForOrg { - public static let id: Swift.String = "orgs/get-webhook-config-for-org" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. + public enum ApiInsightsGetRouteStatsByActor { + public static let id: Swift.String = "api-insights/get-route-stats-by-actor" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. + @frozen public enum ApiInsightsActorType: String, Codable, Hashable, Sendable, CaseIterable { + case installation = "installation" + case classicPat = "classic_pat" + case fineGrainedPat = "fine_grained_pat" + case oauthApp = "oauth_app" + case githubAppUserToServer = "github_app_user_to_server" + } + /// The type of the actor /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/path/hook_id`. - public var hookId: Components.Parameters.HookId + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/actor_type`. + public var actorType: Components.Parameters.ApiInsightsActorType + /// The ID of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/actor_id`. + public var actorId: Components.Parameters.ApiInsightsActorId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// - actorType: The type of the actor + /// - actorId: The ID of the actor public init( org: Components.Parameters.Org, - hookId: Components.Parameters.HookId + actorType: Components.Parameters.ApiInsightsActorType, + actorId: Components.Parameters.ApiInsightsActorId ) { self.org = org - self.hookId = hookId + self.actorType = actorType + self.actorId = actorId } } - public var path: Operations.OrgsGetWebhookConfigForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. + public var path: Operations.ApiInsightsGetRouteStatsByActor.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.OrgsGetWebhookConfigForOrg.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.OrgsGetWebhookConfigForOrg.Input.Path, - headers: Operations.OrgsGetWebhookConfigForOrg.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/GET/responses/200/content/application\/json`. - case json(Components.Schemas.WebhookConfig) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.WebhookConfig { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OrgsGetWebhookConfigForOrg.Output.Ok.Body - /// Creates a new `Ok`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. + public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OrgsGetWebhookConfigForOrg.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/get(orgs/get-webhook-config-for-org)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetWebhookConfigForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsGetWebhookConfigForOrg.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. + public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Update a webhook configuration for an organization - /// - /// Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)." - /// - /// You must be an organization owner to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. - /// - /// - Remark: HTTP `PATCH /orgs/{org}/hooks/{hook_id}/config`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/patch(orgs/update-webhook-config-for-org)`. - public enum OrgsUpdateWebhookConfigForOrg { - public static let id: Swift.String = "orgs/update-webhook-config-for-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/direction`. + public var direction: Components.Parameters.Direction? + /// - Remark: Generated from `#/components/parameters/ApiInsightsRouteStatsSort`. + @frozen public enum ApiInsightsRouteStatsSortPayload: String, Codable, Hashable, Sendable, CaseIterable { + case lastRateLimitedTimestamp = "last_rate_limited_timestamp" + case lastRequestTimestamp = "last_request_timestamp" + case rateLimitedRequestCount = "rate_limited_request_count" + case httpMethod = "http_method" + case apiRoute = "api_route" + case totalRequestCount = "total_request_count" + } + /// - Remark: Generated from `#/components/parameters/api-insights-route-stats-sort`. + public typealias ApiInsightsRouteStatsSort = [Components.Parameters.ApiInsightsRouteStatsSortPayload] + /// The property to sort the results by. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/path/org`. - public var org: Components.Parameters.Org - /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/sort`. + public var sort: Components.Parameters.ApiInsightsRouteStatsSort? + /// Providing a substring will filter results where the API route contains the substring. This is a case-insensitive search. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/path/hook_id`. - public var hookId: Components.Parameters.HookId - /// Creates a new `Path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/api_route_substring`. + public var apiRouteSubstring: Components.Parameters.ApiInsightsApiRouteSubstring? + /// Creates a new `Query`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - page: The page number of the results to fetch. 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)." + /// - perPage: The number of results per page (max 100). 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)." + /// - direction: The direction to sort the results by. + /// - sort: The property to sort the results by. + /// - apiRouteSubstring: Providing a substring will filter results where the API route contains the substring. This is a case-insensitive search. public init( - org: Components.Parameters.Org, - hookId: Components.Parameters.HookId + minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, + maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, + page: Components.Parameters.Page? = nil, + perPage: Components.Parameters.PerPage? = nil, + direction: Components.Parameters.Direction? = nil, + sort: Components.Parameters.ApiInsightsRouteStatsSort? = nil, + apiRouteSubstring: Components.Parameters.ApiInsightsApiRouteSubstring? = nil ) { - self.org = org - self.hookId = hookId + self.minTimestamp = minTimestamp + self.maxTimestamp = maxTimestamp + self.page = page + self.perPage = perPage + self.direction = direction + self.sort = sort + self.apiRouteSubstring = apiRouteSubstring } } - public var path: Operations.OrgsUpdateWebhookConfigForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/header`. + public var query: Operations.ApiInsightsGetRouteStatsByActor.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsUpdateWebhookConfigForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/url`. - public var url: Components.Schemas.WebhookConfigUrl? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/content_type`. - public var contentType: Components.Schemas.WebhookConfigContentType? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/secret`. - public var secret: Components.Schemas.WebhookConfigSecret? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/json/insecure_ssl`. - public var insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - url: - /// - contentType: - /// - secret: - /// - insecureSsl: - public init( - url: Components.Schemas.WebhookConfigUrl? = nil, - contentType: Components.Schemas.WebhookConfigContentType? = nil, - secret: Components.Schemas.WebhookConfigSecret? = nil, - insecureSsl: Components.Schemas.WebhookConfigInsecureSsl? = nil - ) { - self.url = url - self.contentType = contentType - self.secret = secret - self.insecureSsl = insecureSsl - } - public enum CodingKeys: String, CodingKey { - case url - case contentType = "content_type" - case secret - case insecureSsl = "insecure_ssl" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/requestBody/content/application\/json`. - case json(Operations.OrgsUpdateWebhookConfigForOrg.Input.Body.JsonPayload) - } - public var body: Operations.OrgsUpdateWebhookConfigForOrg.Input.Body? + public var headers: Operations.ApiInsightsGetRouteStatsByActor.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.OrgsUpdateWebhookConfigForOrg.Input.Path, - headers: Operations.OrgsUpdateWebhookConfigForOrg.Input.Headers = .init(), - body: Operations.OrgsUpdateWebhookConfigForOrg.Input.Body? = nil + path: Operations.ApiInsightsGetRouteStatsByActor.Input.Path, + query: Operations.ApiInsightsGetRouteStatsByActor.Input.Query, + headers: Operations.ApiInsightsGetRouteStatsByActor.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/config/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.WebhookConfig) + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsRouteStats) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.WebhookConfig { + public var json: Components.Schemas.ApiInsightsRouteStats { get throws { switch self { case let .json(body): @@ -12266,26 +16149,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok.Body + public var body: Operations.ApiInsightsGetRouteStatsByActor.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok.Body) { + public init(body: Operations.ApiInsightsGetRouteStatsByActor.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/config/patch(orgs/update-webhook-config-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok) + case ok(Operations.ApiInsightsGetRouteStatsByActor.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsUpdateWebhookConfigForOrg.Output.Ok { + public var ok: Operations.ApiInsightsGetRouteStatsByActor.Output.Ok { get throws { switch self { case let .ok(response): @@ -12329,80 +16212,116 @@ public enum Operations { } } } - /// List deliveries for an organization webhook - /// - /// Returns a list of webhook deliveries for a webhook configured in an organization. - /// - /// You must be an organization owner to use this endpoint. + /// Get subject stats /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/deliveries`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)`. - public enum OrgsListWebhookDeliveries { - public static let id: Swift.String = "orgs/list-webhook-deliveries" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. + public enum ApiInsightsGetSubjectStats { + public static let id: Swift.String = "api-insights/get-subject-stats" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/path/hook_id`. - public var hookId: Components.Parameters.HookId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. - public init( - org: Components.Parameters.Org, - hookId: Components.Parameters.HookId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.hookId = hookId } } - public var path: Operations.OrgsListWebhookDeliveries.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query`. + public var path: Operations.ApiInsightsGetSubjectStats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query`. public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/min_timestamp`. + public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/max_timestamp`. + public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/page`. + public var page: Components.Parameters.Page? /// The number of results per page (max 100). 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? - /// Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query/cursor`. - public var cursor: Components.Parameters.Cursor? + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/direction`. + public var direction: Components.Parameters.Direction? + /// - Remark: Generated from `#/components/parameters/ApiInsightsSort`. + @frozen public enum ApiInsightsSortPayload: String, Codable, Hashable, Sendable, CaseIterable { + case lastRateLimitedTimestamp = "last_rate_limited_timestamp" + case lastRequestTimestamp = "last_request_timestamp" + case rateLimitedRequestCount = "rate_limited_request_count" + case subjectName = "subject_name" + case totalRequestCount = "total_request_count" + } + /// - Remark: Generated from `#/components/parameters/api-insights-sort`. + public typealias ApiInsightsSort = [Components.Parameters.ApiInsightsSortPayload] + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/sort`. + public var sort: Components.Parameters.ApiInsightsSort? + /// Providing a substring will filter results where the subject name contains the substring. This is a case-insensitive search. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/subject_name_substring`. + public var subjectNameSubstring: Components.Parameters.ApiInsightsSubjectNameSubstring? /// Creates a new `Query`. /// /// - Parameters: + /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - page: The page number of the results to fetch. 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)." /// - perPage: The number of results per page (max 100). 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)." - /// - cursor: Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + /// - direction: The direction to sort the results by. + /// - sort: The property to sort the results by. + /// - subjectNameSubstring: Providing a substring will filter results where the subject name contains the substring. This is a case-insensitive search. public init( + minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, + maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, + page: Components.Parameters.Page? = nil, perPage: Components.Parameters.PerPage? = nil, - cursor: Components.Parameters.Cursor? = nil + direction: Components.Parameters.Direction? = nil, + sort: Components.Parameters.ApiInsightsSort? = nil, + subjectNameSubstring: Components.Parameters.ApiInsightsSubjectNameSubstring? = nil ) { + self.minTimestamp = minTimestamp + self.maxTimestamp = maxTimestamp + self.page = page self.perPage = perPage - self.cursor = cursor + self.direction = direction + self.sort = sort + self.subjectNameSubstring = subjectNameSubstring } } - public var query: Operations.OrgsListWebhookDeliveries.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/header`. + public var query: Operations.ApiInsightsGetSubjectStats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListWebhookDeliveries.Input.Headers + public var headers: Operations.ApiInsightsGetSubjectStats.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -12410,9 +16329,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.OrgsListWebhookDeliveries.Input.Path, - query: Operations.OrgsListWebhookDeliveries.Input.Query = .init(), - headers: Operations.OrgsListWebhookDeliveries.Input.Headers = .init() + path: Operations.ApiInsightsGetSubjectStats.Input.Path, + query: Operations.ApiInsightsGetSubjectStats.Input.Query, + headers: Operations.ApiInsightsGetSubjectStats.Input.Headers = .init() ) { self.path = path self.query = query @@ -12421,15 +16340,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/responses/200/content/application\/json`. - case json([Components.Schemas.HookDeliveryItem]) + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsSubjectStats) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.HookDeliveryItem] { + public var json: Components.Schemas.ApiInsightsSubjectStats { get throws { switch self { case let .json(body): @@ -12439,26 +16358,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListWebhookDeliveries.Output.Ok.Body + public var body: Operations.ApiInsightsGetSubjectStats.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsListWebhookDeliveries.Output.Ok.Body) { + public init(body: Operations.ApiInsightsGetSubjectStats.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListWebhookDeliveries.Output.Ok) + case ok(Operations.ApiInsightsGetSubjectStats.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListWebhookDeliveries.Output.Ok { + public var ok: Operations.ApiInsightsGetSubjectStats.Output.Ok { get throws { switch self { case let .ok(response): @@ -12471,52 +16390,6 @@ public enum Operations { } } } - /// Bad Request - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)/responses/400`. - /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. - /// - /// - Throws: An error if `self` is not `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { - get throws { - switch self { - case let .badRequest(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/get(orgs/list-webhook-deliveries)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -12524,14 +16397,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .applicationScimJson default: self = .other(rawValue) } @@ -12542,97 +16412,102 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// Get a webhook delivery for an organization webhook - /// - /// Returns a delivery for a webhook configured in an organization. - /// - /// You must be an organization owner to use this endpoint. + /// Get summary stats /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. /// - /// - Remark: HTTP `GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)`. - public enum OrgsGetWebhookDelivery { - public static let id: Swift.String = "orgs/get-webhook-delivery" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. + public enum ApiInsightsGetSummaryStats { + public static let id: Swift.String = "api-insights/get-summary-stats" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path/hook_id`. - public var hookId: Components.Parameters.HookId - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/path/delivery_id`. - public var deliveryId: Components.Parameters.DeliveryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. - /// - deliveryId: + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ApiInsightsGetSummaryStats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query/min_timestamp`. + public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query/max_timestamp`. + public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. public init( - org: Components.Parameters.Org, - hookId: Components.Parameters.HookId, - deliveryId: Components.Parameters.DeliveryId + minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, + maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil ) { - self.org = org - self.hookId = hookId - self.deliveryId = deliveryId + self.minTimestamp = minTimestamp + self.maxTimestamp = maxTimestamp } } - public var path: Operations.OrgsGetWebhookDelivery.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/header`. + public var query: Operations.ApiInsightsGetSummaryStats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsGetWebhookDelivery.Input.Headers + public var headers: Operations.ApiInsightsGetSummaryStats.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.OrgsGetWebhookDelivery.Input.Path, - headers: Operations.OrgsGetWebhookDelivery.Input.Headers = .init() + path: Operations.ApiInsightsGetSummaryStats.Input.Path, + query: Operations.ApiInsightsGetSummaryStats.Input.Query, + headers: Operations.ApiInsightsGetSummaryStats.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.HookDelivery) + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsSummaryStats) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.HookDelivery { + public var json: Components.Schemas.ApiInsightsSummaryStats { get throws { switch self { case let .json(body): @@ -12642,26 +16517,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsGetWebhookDelivery.Output.Ok.Body + public var body: Operations.ApiInsightsGetSummaryStats.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsGetWebhookDelivery.Output.Ok.Body) { + public init(body: Operations.ApiInsightsGetSummaryStats.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetWebhookDelivery.Output.Ok) + case ok(Operations.ApiInsightsGetSummaryStats.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsGetWebhookDelivery.Output.Ok { + public var ok: Operations.ApiInsightsGetSummaryStats.Output.Ok { get throws { switch self { case let .ok(response): @@ -12674,52 +16549,6 @@ public enum Operations { } } } - /// Bad Request - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)/responses/400`. - /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. - /// - /// - Throws: An error if `self` is not `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { - get throws { - switch self { - case let .badRequest(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/get(orgs/get-webhook-delivery)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -12727,14 +16556,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .applicationScimJson default: self = .other(rawValue) } @@ -12745,151 +16571,147 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// Redeliver a delivery for an organization webhook - /// - /// Redeliver a delivery for a webhook configured in an organization. - /// - /// You must be an organization owner to use this endpoint. + /// Get summary stats by user /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Get overall statistics of API requests within the organization for a user. /// - /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)`. - public enum OrgsRedeliverWebhookDelivery { - public static let id: Swift.String = "orgs/redeliver-webhook-delivery" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. + public enum ApiInsightsGetSummaryStatsByUser { + public static let id: Swift.String = "api-insights/get-summary-stats-by-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// The ID of the user to query for stats /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/hook_id`. - public var hookId: Components.Parameters.HookId - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/path/delivery_id`. - public var deliveryId: Components.Parameters.DeliveryId + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path/user_id`. + public var userId: Components.Parameters.ApiInsightsUserId /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. - /// - deliveryId: + /// - org: The organization name. The name is not case sensitive. + /// - userId: The ID of the user to query for stats + public init( + org: Components.Parameters.Org, + userId: Components.Parameters.ApiInsightsUserId + ) { + self.org = org + self.userId = userId + } + } + public var path: Operations.ApiInsightsGetSummaryStatsByUser.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query/min_timestamp`. + public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query/max_timestamp`. + public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. public init( - org: Components.Parameters.Org, - hookId: Components.Parameters.HookId, - deliveryId: Components.Parameters.DeliveryId + minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, + maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil ) { - self.org = org - self.hookId = hookId - self.deliveryId = deliveryId + self.minTimestamp = minTimestamp + self.maxTimestamp = maxTimestamp } } - public var path: Operations.OrgsRedeliverWebhookDelivery.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/POST/header`. + public var query: Operations.ApiInsightsGetSummaryStatsByUser.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsRedeliverWebhookDelivery.Input.Headers + public var headers: Operations.ApiInsightsGetSummaryStatsByUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.OrgsRedeliverWebhookDelivery.Input.Path, - headers: Operations.OrgsRedeliverWebhookDelivery.Input.Headers = .init() + path: Operations.ApiInsightsGetSummaryStatsByUser.Input.Path, + query: Operations.ApiInsightsGetSummaryStatsByUser.Input.Query, + headers: Operations.ApiInsightsGetSummaryStatsByUser.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - /// Accepted - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/202`. - /// - /// HTTP response code: `202 accepted`. - case accepted(Components.Responses.Accepted) - /// The associated value of the enum case if `self` is `.accepted`. - /// - /// - Throws: An error if `self` is not `.accepted`. - /// - SeeAlso: `.accepted`. - public var accepted: Components.Responses.Accepted { - get throws { - switch self { - case let .accepted(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "accepted", - response: self - ) + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsSummaryStats) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ApiInsightsSummaryStats { + get throws { + switch self { + case let .json(body): + return body + } + } } } - } - /// Bad Request - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/400`. - /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. - /// - /// - Throws: An error if `self` is not `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { - get throws { - switch self { - case let .badRequest(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", - response: self - ) - } + /// Received HTTP response body + public var body: Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok.Body) { + self.body = body } } - /// Validation failed, or the endpoint has been spammed. + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts/post(orgs/redeliver-webhook-delivery)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)/responses/200`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok { get throws { switch self { - case let .unprocessableContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "ok", response: self ) } @@ -12902,14 +16724,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .applicationScimJson default: self = .other(rawValue) } @@ -12920,136 +16739,162 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// Ping an organization webhook - /// - /// This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) - /// to be sent to the hook. - /// - /// You must be an organization owner to use this endpoint. + /// Get summary stats by actor /// - /// OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit - /// webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. + /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. /// - /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/pings`. - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)`. - public enum OrgsPingWebhook { - public static let id: Swift.String = "orgs/ping-webhook" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. + public enum ApiInsightsGetSummaryStatsByActor { + public static let id: Swift.String = "api-insights/get-summary-stats-by-actor" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. + @frozen public enum ApiInsightsActorType: String, Codable, Hashable, Sendable, CaseIterable { + case installation = "installation" + case classicPat = "classic_pat" + case fineGrainedPat = "fine_grained_pat" + case oauthApp = "oauth_app" + case githubAppUserToServer = "github_app_user_to_server" + } + /// The type of the actor /// - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/path/hook_id`. - public var hookId: Components.Parameters.HookId + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/actor_type`. + public var actorType: Components.Parameters.ApiInsightsActorType + /// The ID of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/actor_id`. + public var actorId: Components.Parameters.ApiInsightsActorId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - hookId: The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. + /// - actorType: The type of the actor + /// - actorId: The ID of the actor public init( org: Components.Parameters.Org, - hookId: Components.Parameters.HookId + actorType: Components.Parameters.ApiInsightsActorType, + actorId: Components.Parameters.ApiInsightsActorId ) { self.org = org - self.hookId = hookId + self.actorType = actorType + self.actorId = actorId } } - public var path: Operations.OrgsPingWebhook.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/pings/POST/header`. + public var path: Operations.ApiInsightsGetSummaryStatsByActor.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. + public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp + /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. + public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + public init( + minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, + maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil + ) { + self.minTimestamp = minTimestamp + self.maxTimestamp = maxTimestamp + } + } + public var query: Operations.ApiInsightsGetSummaryStatsByActor.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsPingWebhook.Input.Headers + public var headers: Operations.ApiInsightsGetSummaryStatsByActor.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.OrgsPingWebhook.Input.Path, - headers: Operations.OrgsPingWebhook.Input.Headers = .init() + path: Operations.ApiInsightsGetSummaryStatsByActor.Input.Path, + query: Operations.ApiInsightsGetSummaryStatsByActor.Input.Query, + headers: Operations.ApiInsightsGetSummaryStatsByActor.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsPingWebhook.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsPingWebhook.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsSummaryStats) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ApiInsightsSummaryStats { + get throws { + switch self { + case let .json(body): + return body + } + } } } + /// Received HTTP response body + public var body: Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok.Body) { + self.body = body + } } - /// Resource not found + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)/responses/200`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `200 ok`. + case ok(Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok { get throws { switch self { - case let .notFound(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "ok", response: self ) } @@ -13086,141 +16931,73 @@ public enum Operations { } } } - /// Get route stats by actor + /// Get time stats /// - /// Get API request count statistics for an actor broken down by route within a specified time frame. + /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. - public enum ApiInsightsGetRouteStatsByActor { - public static let id: Swift.String = "api-insights/get-route-stats-by-actor" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. + public enum ApiInsightsGetTimeStats { + public static let id: Swift.String = "api-insights/get-time-stats" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/path/org`. public var org: Components.Parameters.Org - /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. - @frozen public enum ApiInsightsActorType: String, Codable, Hashable, Sendable, CaseIterable { - case installation = "installation" - case classicPat = "classic_pat" - case fineGrainedPat = "fine_grained_pat" - case oauthApp = "oauth_app" - case githubAppUserToServer = "github_app_user_to_server" - } - /// The type of the actor - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/actor_type`. - public var actorType: Components.Parameters.ApiInsightsActorType - /// The ID of the actor - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/actor_id`. - public var actorId: Components.Parameters.ApiInsightsActorId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - actorType: The type of the actor - /// - actorId: The ID of the actor - public init( - org: Components.Parameters.Org, - actorType: Components.Parameters.ApiInsightsActorType, - actorId: Components.Parameters.ApiInsightsActorId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.actorType = actorType - self.actorId = actorId } } - public var path: Operations.ApiInsightsGetRouteStatsByActor.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query`. + public var path: Operations.ApiInsightsGetTimeStats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query`. public struct Query: Sendable, Hashable { /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/min_timestamp`. public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/max_timestamp`. public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/page`. - public var page: Components.Parameters.Page? - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// - Remark: Generated from `#/components/parameters/ApiInsightsRouteStatsSort`. - @frozen public enum ApiInsightsRouteStatsSortPayload: String, Codable, Hashable, Sendable, CaseIterable { - case lastRateLimitedTimestamp = "last_rate_limited_timestamp" - case lastRequestTimestamp = "last_request_timestamp" - case rateLimitedRequestCount = "rate_limited_request_count" - case httpMethod = "http_method" - case apiRoute = "api_route" - case totalRequestCount = "total_request_count" - } - /// - Remark: Generated from `#/components/parameters/api-insights-route-stats-sort`. - public typealias ApiInsightsRouteStatsSort = [Components.Parameters.ApiInsightsRouteStatsSortPayload] - /// The property to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/sort`. - public var sort: Components.Parameters.ApiInsightsRouteStatsSort? - /// Providing a substring will filter results where the API route contains the substring. This is a case-insensitive search. + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/api_route_substring`. - public var apiRouteSubstring: Components.Parameters.ApiInsightsApiRouteSubstring? + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/timestamp_increment`. + public var timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement /// Creates a new `Query`. /// /// - Parameters: /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - page: The page number of the results to fetch. 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)." - /// - perPage: The number of results per page (max 100). 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)." - /// - direction: The direction to sort the results by. - /// - sort: The property to sort the results by. - /// - apiRouteSubstring: Providing a substring will filter results where the API route contains the substring. This is a case-insensitive search. + /// - timestampIncrement: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) public init( minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, - page: Components.Parameters.Page? = nil, - perPage: Components.Parameters.PerPage? = nil, - direction: Components.Parameters.Direction? = nil, - sort: Components.Parameters.ApiInsightsRouteStatsSort? = nil, - apiRouteSubstring: Components.Parameters.ApiInsightsApiRouteSubstring? = nil + timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement ) { self.minTimestamp = minTimestamp self.maxTimestamp = maxTimestamp - self.page = page - self.perPage = perPage - self.direction = direction - self.sort = sort - self.apiRouteSubstring = apiRouteSubstring + self.timestampIncrement = timestampIncrement } } - public var query: Operations.ApiInsightsGetRouteStatsByActor.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/header`. + public var query: Operations.ApiInsightsGetTimeStats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ApiInsightsGetRouteStatsByActor.Input.Headers + public var headers: Operations.ApiInsightsGetTimeStats.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -13228,9 +17005,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetRouteStatsByActor.Input.Path, - query: Operations.ApiInsightsGetRouteStatsByActor.Input.Query, - headers: Operations.ApiInsightsGetRouteStatsByActor.Input.Headers = .init() + path: Operations.ApiInsightsGetTimeStats.Input.Path, + query: Operations.ApiInsightsGetTimeStats.Input.Query, + headers: Operations.ApiInsightsGetTimeStats.Input.Headers = .init() ) { self.path = path self.query = query @@ -13239,15 +17016,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsRouteStats) + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsTimeStats) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ApiInsightsRouteStats { + public var json: Components.Schemas.ApiInsightsTimeStats { get throws { switch self { case let .json(body): @@ -13257,26 +17034,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApiInsightsGetRouteStatsByActor.Output.Ok.Body + public var body: Operations.ApiInsightsGetTimeStats.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetRouteStatsByActor.Output.Ok.Body) { + public init(body: Operations.ApiInsightsGetTimeStats.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetRouteStatsByActor.Output.Ok) + case ok(Operations.ApiInsightsGetTimeStats.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ApiInsightsGetRouteStatsByActor.Output.Ok { + public var ok: Operations.ApiInsightsGetTimeStats.Output.Ok { get throws { switch self { case let .ok(response): @@ -13320,116 +17097,82 @@ public enum Operations { } } } - /// Get subject stats + /// Get time stats by user /// - /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. + /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. - public enum ApiInsightsGetSubjectStats { - public static let id: Swift.String = "api-insights/get-subject-stats" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. + public enum ApiInsightsGetTimeStatsByUser { + public static let id: Swift.String = "api-insights/get-time-stats-by-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path/org`. public var org: Components.Parameters.Org + /// The ID of the user to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path/user_id`. + public var userId: Components.Parameters.ApiInsightsUserId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - userId: The ID of the user to query for stats + public init( + org: Components.Parameters.Org, + userId: Components.Parameters.ApiInsightsUserId + ) { self.org = org + self.userId = userId } } - public var path: Operations.ApiInsightsGetSubjectStats.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query`. + public var path: Operations.ApiInsightsGetTimeStatsByUser.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query`. public struct Query: Sendable, Hashable { /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/min_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/min_timestamp`. public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/max_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/max_timestamp`. public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/page`. - public var page: Components.Parameters.Page? - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// - Remark: Generated from `#/components/parameters/ApiInsightsSort`. - @frozen public enum ApiInsightsSortPayload: String, Codable, Hashable, Sendable, CaseIterable { - case lastRateLimitedTimestamp = "last_rate_limited_timestamp" - case lastRequestTimestamp = "last_request_timestamp" - case rateLimitedRequestCount = "rate_limited_request_count" - case subjectName = "subject_name" - case totalRequestCount = "total_request_count" - } - /// - Remark: Generated from `#/components/parameters/api-insights-sort`. - public typealias ApiInsightsSort = [Components.Parameters.ApiInsightsSortPayload] - /// The property to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/sort`. - public var sort: Components.Parameters.ApiInsightsSort? - /// Providing a substring will filter results where the subject name contains the substring. This is a case-insensitive search. + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/subject_name_substring`. - public var subjectNameSubstring: Components.Parameters.ApiInsightsSubjectNameSubstring? + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/timestamp_increment`. + public var timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement /// Creates a new `Query`. /// /// - Parameters: /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - page: The page number of the results to fetch. 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)." - /// - perPage: The number of results per page (max 100). 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)." - /// - direction: The direction to sort the results by. - /// - sort: The property to sort the results by. - /// - subjectNameSubstring: Providing a substring will filter results where the subject name contains the substring. This is a case-insensitive search. + /// - timestampIncrement: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) public init( minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, - page: Components.Parameters.Page? = nil, - perPage: Components.Parameters.PerPage? = nil, - direction: Components.Parameters.Direction? = nil, - sort: Components.Parameters.ApiInsightsSort? = nil, - subjectNameSubstring: Components.Parameters.ApiInsightsSubjectNameSubstring? = nil + timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement ) { self.minTimestamp = minTimestamp self.maxTimestamp = maxTimestamp - self.page = page - self.perPage = perPage - self.direction = direction - self.sort = sort - self.subjectNameSubstring = subjectNameSubstring + self.timestampIncrement = timestampIncrement } } - public var query: Operations.ApiInsightsGetSubjectStats.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/header`. + public var query: Operations.ApiInsightsGetTimeStatsByUser.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ApiInsightsGetSubjectStats.Input.Headers + public var headers: Operations.ApiInsightsGetTimeStatsByUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -13437,9 +17180,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetSubjectStats.Input.Path, - query: Operations.ApiInsightsGetSubjectStats.Input.Query, - headers: Operations.ApiInsightsGetSubjectStats.Input.Headers = .init() + path: Operations.ApiInsightsGetTimeStatsByUser.Input.Path, + query: Operations.ApiInsightsGetTimeStatsByUser.Input.Query, + headers: Operations.ApiInsightsGetTimeStatsByUser.Input.Headers = .init() ) { self.path = path self.query = query @@ -13448,15 +17191,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsSubjectStats) + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsTimeStats) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ApiInsightsSubjectStats { + public var json: Components.Schemas.ApiInsightsTimeStats { get throws { switch self { case let .json(body): @@ -13466,26 +17209,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApiInsightsGetSubjectStats.Output.Ok.Body + public var body: Operations.ApiInsightsGetTimeStatsByUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetSubjectStats.Output.Ok.Body) { + public init(body: Operations.ApiInsightsGetTimeStatsByUser.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetSubjectStats.Output.Ok) + case ok(Operations.ApiInsightsGetTimeStatsByUser.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ApiInsightsGetSubjectStats.Output.Ok { + public var ok: Operations.ApiInsightsGetTimeStatsByUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -13529,66 +17272,97 @@ public enum Operations { } } } - /// Get summary stats + /// Get time stats by actor /// - /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. + /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. - public enum ApiInsightsGetSummaryStats { - public static let id: Swift.String = "api-insights/get-summary-stats" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. + public enum ApiInsightsGetTimeStatsByActor { + public static let id: Swift.String = "api-insights/get-time-stats-by-actor" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/org`. public var org: Components.Parameters.Org + /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. + @frozen public enum ApiInsightsActorType: String, Codable, Hashable, Sendable, CaseIterable { + case installation = "installation" + case classicPat = "classic_pat" + case fineGrainedPat = "fine_grained_pat" + case oauthApp = "oauth_app" + case githubAppUserToServer = "github_app_user_to_server" + } + /// The type of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/actor_type`. + public var actorType: Components.Parameters.ApiInsightsActorType + /// The ID of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/actor_id`. + public var actorId: Components.Parameters.ApiInsightsActorId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - actorType: The type of the actor + /// - actorId: The ID of the actor + public init( + org: Components.Parameters.Org, + actorType: Components.Parameters.ApiInsightsActorType, + actorId: Components.Parameters.ApiInsightsActorId + ) { self.org = org + self.actorType = actorType + self.actorId = actorId } } - public var path: Operations.ApiInsightsGetSummaryStats.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query`. + public var path: Operations.ApiInsightsGetTimeStatsByActor.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query`. public struct Query: Sendable, Hashable { /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query/min_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query/max_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/timestamp_increment`. + public var timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement /// Creates a new `Query`. /// /// - Parameters: /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - timestampIncrement: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) public init( minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, - maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil + maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, + timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement ) { self.minTimestamp = minTimestamp self.maxTimestamp = maxTimestamp + self.timestampIncrement = timestampIncrement } } - public var query: Operations.ApiInsightsGetSummaryStats.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/header`. + public var query: Operations.ApiInsightsGetTimeStatsByActor.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ApiInsightsGetSummaryStats.Input.Headers + public var headers: Operations.ApiInsightsGetTimeStatsByActor.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -13596,9 +17370,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetSummaryStats.Input.Path, - query: Operations.ApiInsightsGetSummaryStats.Input.Query, - headers: Operations.ApiInsightsGetSummaryStats.Input.Headers = .init() + path: Operations.ApiInsightsGetTimeStatsByActor.Input.Path, + query: Operations.ApiInsightsGetTimeStatsByActor.Input.Query, + headers: Operations.ApiInsightsGetTimeStatsByActor.Input.Headers = .init() ) { self.path = path self.query = query @@ -13607,15 +17381,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsSummaryStats) + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsTimeStats) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ApiInsightsSummaryStats { + public var json: Components.Schemas.ApiInsightsTimeStats { get throws { switch self { case let .json(body): @@ -13625,26 +17399,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApiInsightsGetSummaryStats.Output.Ok.Body + public var body: Operations.ApiInsightsGetTimeStatsByActor.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetSummaryStats.Output.Ok.Body) { + public init(body: Operations.ApiInsightsGetTimeStatsByActor.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetSummaryStats.Output.Ok) + case ok(Operations.ApiInsightsGetTimeStatsByActor.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ApiInsightsGetSummaryStats.Output.Ok { + public var ok: Operations.ApiInsightsGetTimeStatsByActor.Output.Ok { get throws { switch self { case let .ok(response): @@ -13688,24 +17462,24 @@ public enum Operations { } } } - /// Get summary stats by user + /// Get user stats /// - /// Get overall statistics of API requests within the organization for a user. + /// Get API usage statistics within an organization for a user broken down by the type of access. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. - public enum ApiInsightsGetSummaryStatsByUser { - public static let id: Swift.String = "api-insights/get-summary-stats-by-user" + /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. + public enum ApiInsightsGetUserStats { + public static let id: Swift.String = "api-insights/get-user-stats" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path/org`. public var org: Components.Parameters.Org /// The ID of the user to query for stats /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path/user_id`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path/user_id`. public var userId: Components.Parameters.ApiInsightsUserId /// Creates a new `Path`. /// @@ -13720,43 +17494,93 @@ public enum Operations { self.userId = userId } } - public var path: Operations.ApiInsightsGetSummaryStatsByUser.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query`. + public var path: Operations.ApiInsightsGetUserStats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query`. public struct Query: Sendable, Hashable { /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query/min_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/min_timestamp`. public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query/max_timestamp`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/max_timestamp`. public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/direction`. + public var direction: Components.Parameters.Direction? + /// - Remark: Generated from `#/components/parameters/ApiInsightsSort`. + @frozen public enum ApiInsightsSortPayload: String, Codable, Hashable, Sendable, CaseIterable { + case lastRateLimitedTimestamp = "last_rate_limited_timestamp" + case lastRequestTimestamp = "last_request_timestamp" + case rateLimitedRequestCount = "rate_limited_request_count" + case subjectName = "subject_name" + case totalRequestCount = "total_request_count" + } + /// - Remark: Generated from `#/components/parameters/api-insights-sort`. + public typealias ApiInsightsSort = [Components.Parameters.ApiInsightsSortPayload] + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/sort`. + public var sort: Components.Parameters.ApiInsightsSort? + /// Providing a substring will filter results where the actor name contains the substring. This is a case-insensitive search. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/actor_name_substring`. + public var actorNameSubstring: Components.Parameters.ApiInsightsActorNameSubstring? /// Creates a new `Query`. /// /// - Parameters: /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - page: The page number of the results to fetch. 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)." + /// - perPage: The number of results per page (max 100). 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)." + /// - direction: The direction to sort the results by. + /// - sort: The property to sort the results by. + /// - actorNameSubstring: Providing a substring will filter results where the actor name contains the substring. This is a case-insensitive search. public init( minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, - maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil + maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, + page: Components.Parameters.Page? = nil, + perPage: Components.Parameters.PerPage? = nil, + direction: Components.Parameters.Direction? = nil, + sort: Components.Parameters.ApiInsightsSort? = nil, + actorNameSubstring: Components.Parameters.ApiInsightsActorNameSubstring? = nil ) { self.minTimestamp = minTimestamp self.maxTimestamp = maxTimestamp + self.page = page + self.perPage = perPage + self.direction = direction + self.sort = sort + self.actorNameSubstring = actorNameSubstring } } - public var query: Operations.ApiInsightsGetSummaryStatsByUser.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/header`. + public var query: Operations.ApiInsightsGetUserStats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ApiInsightsGetSummaryStatsByUser.Input.Headers + public var headers: Operations.ApiInsightsGetUserStats.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -13764,9 +17588,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetSummaryStatsByUser.Input.Path, - query: Operations.ApiInsightsGetSummaryStatsByUser.Input.Query, - headers: Operations.ApiInsightsGetSummaryStatsByUser.Input.Headers = .init() + path: Operations.ApiInsightsGetUserStats.Input.Path, + query: Operations.ApiInsightsGetUserStats.Input.Query, + headers: Operations.ApiInsightsGetUserStats.Input.Headers = .init() ) { self.path = path self.query = query @@ -13775,15 +17599,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsSummaryStats) + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ApiInsightsUserStats) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ApiInsightsSummaryStats { + public var json: Components.Schemas.ApiInsightsUserStats { get throws { switch self { case let .json(body): @@ -13793,26 +17617,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok.Body + public var body: Operations.ApiInsightsGetUserStats.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok.Body) { + public init(body: Operations.ApiInsightsGetUserStats.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok) + case ok(Operations.ApiInsightsGetUserStats.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ApiInsightsGetSummaryStatsByUser.Output.Ok { + public var ok: Operations.ApiInsightsGetUserStats.Output.Ok { get throws { switch self { case let .ok(response): @@ -13856,90 +17680,71 @@ public enum Operations { } } } - /// Get summary stats by actor + /// List app installations for an organization /// - /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. + /// Lists all GitHub Apps in an organization. The installation count includes + /// all GitHub Apps installed on repositories in the organization. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. - public enum ApiInsightsGetSummaryStatsByActor { - public static let id: Swift.String = "api-insights/get-summary-stats-by-actor" + /// The authenticated user must be an organization owner to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/installations`. + /// - Remark: Generated from `#/paths//orgs/{org}/installations/get(orgs/list-app-installations)`. + public enum OrgsListAppInstallations { + public static let id: Swift.String = "orgs/list-app-installations" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/path/org`. public var org: Components.Parameters.Org - /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. - @frozen public enum ApiInsightsActorType: String, Codable, Hashable, Sendable, CaseIterable { - case installation = "installation" - case classicPat = "classic_pat" - case fineGrainedPat = "fine_grained_pat" - case oauthApp = "oauth_app" - case githubAppUserToServer = "github_app_user_to_server" - } - /// The type of the actor - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/actor_type`. - public var actorType: Components.Parameters.ApiInsightsActorType - /// The ID of the actor - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/actor_id`. - public var actorId: Components.Parameters.ApiInsightsActorId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - actorType: The type of the actor - /// - actorId: The ID of the actor - public init( - org: Components.Parameters.Org, - actorType: Components.Parameters.ApiInsightsActorType, - actorId: Components.Parameters.ApiInsightsActorId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.actorType = actorType - self.actorId = actorId } } - public var path: Operations.ApiInsightsGetSummaryStatsByActor.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query`. + public var path: Operations.OrgsListAppInstallations.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/query`. public struct Query: Sendable, Hashable { - /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// The number of results per page (max 100). 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. - public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp - /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. - public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/query/page`. + public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: - /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." public init( - minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, - maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil ) { - self.minTimestamp = minTimestamp - self.maxTimestamp = maxTimestamp + self.perPage = perPage + self.page = page } } - public var query: Operations.ApiInsightsGetSummaryStatsByActor.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/header`. + public var query: Operations.OrgsListAppInstallations.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ApiInsightsGetSummaryStatsByActor.Input.Headers + public var headers: Operations.OrgsListAppInstallations.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -13947,9 +17752,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetSummaryStatsByActor.Input.Path, - query: Operations.ApiInsightsGetSummaryStatsByActor.Input.Query, - headers: Operations.ApiInsightsGetSummaryStatsByActor.Input.Headers = .init() + path: Operations.OrgsListAppInstallations.Input.Path, + query: Operations.OrgsListAppInstallations.Input.Query = .init(), + headers: Operations.OrgsListAppInstallations.Input.Headers = .init() ) { self.path = path self.query = query @@ -13958,15 +17763,52 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.OrgsListAppInstallations.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsSummaryStats) + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json/installations`. + public var installations: [Components.Schemas.Installation] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - installations: + public init( + totalCount: Swift.Int, + installations: [Components.Schemas.Installation] + ) { + self.totalCount = totalCount + self.installations = installations + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case installations + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/application\/json`. + case json(Operations.OrgsListAppInstallations.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ApiInsightsSummaryStats { + public var json: Operations.OrgsListAppInstallations.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -13976,26 +17818,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok.Body + public var body: Operations.OrgsListAppInstallations.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok.Body) { + public init( + headers: Operations.OrgsListAppInstallations.Output.Ok.Headers = .init(), + body: Operations.OrgsListAppInstallations.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/installations/get(orgs/list-app-installations)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok) + case ok(Operations.OrgsListAppInstallations.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ApiInsightsGetSummaryStatsByActor.Output.Ok { + public var ok: Operations.OrgsListAppInstallations.Output.Ok { get throws { switch self { case let .ok(response): @@ -14039,20 +17886,23 @@ public enum Operations { } } } - /// Get time stats + /// List pending organization invitations /// - /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. + /// The return hash contains a `role` field which refers to the Organization + /// Invitation role and will be one of the following values: `direct_member`, `admin`, + /// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub + /// member, the `login` field in the return hash will be `null`. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. - public enum ApiInsightsGetTimeStats { - public static let id: Swift.String = "api-insights/get-time-stats" + /// - Remark: HTTP `GET /orgs/{org}/invitations`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`. + public enum OrgsListPendingInvitations { + public static let id: Swift.String = "orgs/list-pending-invitations" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -14062,50 +17912,71 @@ public enum Operations { self.org = org } } - public var path: Operations.ApiInsightsGetTimeStats.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query`. + public var path: Operations.OrgsListPendingInvitations.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query`. public struct Query: Sendable, Hashable { - /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// The number of results per page (max 100). 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/min_timestamp`. - public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp - /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/max_timestamp`. - public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? - /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/page`. + public var page: Components.Parameters.Page? + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/role`. + @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case admin = "admin" + case directMember = "direct_member" + case billingManager = "billing_manager" + case hiringManager = "hiring_manager" + } + /// Filter invitations by their member role. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/timestamp_increment`. - public var timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/role`. + public var role: Operations.OrgsListPendingInvitations.Input.Query.RolePayload? + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/invitation_source`. + @frozen public enum InvitationSourcePayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case member = "member" + case scim = "scim" + } + /// Filter invitations by their invitation source. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/invitation_source`. + public var invitationSource: Operations.OrgsListPendingInvitations.Input.Query.InvitationSourcePayload? /// Creates a new `Query`. /// /// - Parameters: - /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - timestampIncrement: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + /// - role: Filter invitations by their member role. + /// - invitationSource: Filter invitations by their invitation source. public init( - minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, - maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, - timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil, + role: Operations.OrgsListPendingInvitations.Input.Query.RolePayload? = nil, + invitationSource: Operations.OrgsListPendingInvitations.Input.Query.InvitationSourcePayload? = nil ) { - self.minTimestamp = minTimestamp - self.maxTimestamp = maxTimestamp - self.timestampIncrement = timestampIncrement + self.perPage = perPage + self.page = page + self.role = role + self.invitationSource = invitationSource } } - public var query: Operations.ApiInsightsGetTimeStats.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/header`. + public var query: Operations.OrgsListPendingInvitations.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ApiInsightsGetTimeStats.Input.Headers + public var headers: Operations.OrgsListPendingInvitations.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -14113,9 +17984,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetTimeStats.Input.Path, - query: Operations.ApiInsightsGetTimeStats.Input.Query, - headers: Operations.ApiInsightsGetTimeStats.Input.Headers = .init() + path: Operations.OrgsListPendingInvitations.Input.Path, + query: Operations.OrgsListPendingInvitations.Input.Query = .init(), + headers: Operations.OrgsListPendingInvitations.Input.Headers = .init() ) { self.path = path self.query = query @@ -14124,15 +17995,29 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.OrgsListPendingInvitations.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsTimeStats) + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/content/application\/json`. + case json([Components.Schemas.OrganizationInvitation]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ApiInsightsTimeStats { + public var json: [Components.Schemas.OrganizationInvitation] { get throws { switch self { case let .json(body): @@ -14142,26 +18027,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApiInsightsGetTimeStats.Output.Ok.Body + public var body: Operations.OrgsListPendingInvitations.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetTimeStats.Output.Ok.Body) { + public init( + headers: Operations.OrgsListPendingInvitations.Output.Ok.Headers = .init(), + body: Operations.OrgsListPendingInvitations.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetTimeStats.Output.Ok) + case ok(Operations.OrgsListPendingInvitations.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ApiInsightsGetTimeStats.Output.Ok { + public var ok: Operations.OrgsListPendingInvitations.Output.Ok { get throws { switch self { case let .ok(response): @@ -14174,6 +18064,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -14205,109 +18118,138 @@ public enum Operations { } } } - /// Get time stats by user + /// Create an organization invitation /// - /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. + /// Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. - public enum ApiInsightsGetTimeStatsByUser { - public static let id: Swift.String = "api-insights/get-time-stats-by-user" + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `POST /orgs/{org}/invitations`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)`. + public enum OrgsCreateInvitation { + public static let id: Swift.String = "orgs/create-invitation" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/path/org`. public var org: Components.Parameters.Org - /// The ID of the user to query for stats - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path/user_id`. - public var userId: Components.Parameters.ApiInsightsUserId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - userId: The ID of the user to query for stats - public init( - org: Components.Parameters.Org, - userId: Components.Parameters.ApiInsightsUserId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.userId = userId - } - } - public var path: Operations.ApiInsightsGetTimeStatsByUser.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query`. - public struct Query: Sendable, Hashable { - /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/min_timestamp`. - public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp - /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/max_timestamp`. - public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? - /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/timestamp_increment`. - public var timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement - /// Creates a new `Query`. - /// - /// - Parameters: - /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - timestampIncrement: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) - public init( - minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, - maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, - timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement - ) { - self.minTimestamp = minTimestamp - self.maxTimestamp = maxTimestamp - self.timestampIncrement = timestampIncrement } } - public var query: Operations.ApiInsightsGetTimeStatsByUser.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/header`. + public var path: Operations.OrgsCreateInvitation.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ApiInsightsGetTimeStatsByUser.Input.Headers + public var headers: Operations.OrgsCreateInvitation.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// **Required unless you provide `email`**. GitHub user ID for the person you are inviting. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/invitee_id`. + public var inviteeId: Swift.Int? + /// **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/email`. + public var email: Swift.String? + /// The role for the new member. + /// * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. + /// * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. + /// * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. + /// * `reinstate` - The previous role assigned to the invitee before they were removed from your organization. Can be one of the roles listed above. Only works if the invitee was previously part of your organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/role`. + @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { + case admin = "admin" + case directMember = "direct_member" + case billingManager = "billing_manager" + case reinstate = "reinstate" + } + /// The role for the new member. + /// * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. + /// * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. + /// * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. + /// * `reinstate` - The previous role assigned to the invitee before they were removed from your organization. Can be one of the roles listed above. Only works if the invitee was previously part of your organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/role`. + public var role: Operations.OrgsCreateInvitation.Input.Body.JsonPayload.RolePayload? + /// Specify IDs for the teams you want to invite new members to. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/team_ids`. + public var teamIds: [Swift.Int]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - inviteeId: **Required unless you provide `email`**. GitHub user ID for the person you are inviting. + /// - email: **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. + /// - role: The role for the new member. + /// - teamIds: Specify IDs for the teams you want to invite new members to. + public init( + inviteeId: Swift.Int? = nil, + email: Swift.String? = nil, + role: Operations.OrgsCreateInvitation.Input.Body.JsonPayload.RolePayload? = nil, + teamIds: [Swift.Int]? = nil + ) { + self.inviteeId = inviteeId + self.email = email + self.role = role + self.teamIds = teamIds + } + public enum CodingKeys: String, CodingKey { + case inviteeId = "invitee_id" + case email + case role + case teamIds = "team_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/content/application\/json`. + case json(Operations.OrgsCreateInvitation.Input.Body.JsonPayload) + } + public var body: Operations.OrgsCreateInvitation.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ApiInsightsGetTimeStatsByUser.Input.Path, - query: Operations.ApiInsightsGetTimeStatsByUser.Input.Query, - headers: Operations.ApiInsightsGetTimeStatsByUser.Input.Headers = .init() + path: Operations.OrgsCreateInvitation.Input.Path, + headers: Operations.OrgsCreateInvitation.Input.Headers = .init(), + body: Operations.OrgsCreateInvitation.Input.Body? = nil ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsTimeStats) + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/responses/201/content/application\/json`. + case json(Components.Schemas.OrganizationInvitation) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ApiInsightsTimeStats { + public var json: Components.Schemas.OrganizationInvitation { get throws { switch self { case let .json(body): @@ -14316,34 +18258,80 @@ public enum Operations { } } } - /// Received HTTP response body - public var body: Operations.ApiInsightsGetTimeStatsByUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetTimeStatsByUser.Output.Ok.Body) { - self.body = body - } + /// Received HTTP response body + public var body: Operations.OrgsCreateInvitation.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsCreateInvitation.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.OrgsCreateInvitation.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.OrgsCreateInvitation.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } } - /// Response + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/responses/404`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetTimeStatsByUser.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ApiInsightsGetTimeStatsByUser.Output.Ok { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .ok(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "notFound", response: self ) } @@ -14380,160 +18368,143 @@ public enum Operations { } } } - /// Get time stats by actor + /// Cancel an organization invitation /// - /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. + /// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. - public enum ApiInsightsGetTimeStatsByActor { - public static let id: Swift.String = "api-insights/get-time-stats-by-actor" + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). + /// + /// - Remark: HTTP `DELETE /orgs/{org}/invitations/{invitation_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)`. + public enum OrgsCancelInvitation { + public static let id: Swift.String = "orgs/cancel-invitation" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. - @frozen public enum ApiInsightsActorType: String, Codable, Hashable, Sendable, CaseIterable { - case installation = "installation" - case classicPat = "classic_pat" - case fineGrainedPat = "fine_grained_pat" - case oauthApp = "oauth_app" - case githubAppUserToServer = "github_app_user_to_server" - } - /// The type of the actor - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/actor_type`. - public var actorType: Components.Parameters.ApiInsightsActorType - /// The ID of the actor + /// The unique identifier of the invitation. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/actor_id`. - public var actorId: Components.Parameters.ApiInsightsActorId + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path/invitation_id`. + public var invitationId: Components.Parameters.InvitationId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - actorType: The type of the actor - /// - actorId: The ID of the actor + /// - invitationId: The unique identifier of the invitation. public init( org: Components.Parameters.Org, - actorType: Components.Parameters.ApiInsightsActorType, - actorId: Components.Parameters.ApiInsightsActorId + invitationId: Components.Parameters.InvitationId ) { self.org = org - self.actorType = actorType - self.actorId = actorId - } - } - public var path: Operations.ApiInsightsGetTimeStatsByActor.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query`. - public struct Query: Sendable, Hashable { - /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. - public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp - /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. - public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? - /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/timestamp_increment`. - public var timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement - /// Creates a new `Query`. - /// - /// - Parameters: - /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - timestampIncrement: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) - public init( - minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, - maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, - timestampIncrement: Components.Parameters.ApiInsightsTimestampIncrement - ) { - self.minTimestamp = minTimestamp - self.maxTimestamp = maxTimestamp - self.timestampIncrement = timestampIncrement + self.invitationId = invitationId } } - public var query: Operations.ApiInsightsGetTimeStatsByActor.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/header`. + public var path: Operations.OrgsCancelInvitation.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ApiInsightsGetTimeStatsByActor.Input.Headers + public var headers: Operations.OrgsCancelInvitation.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetTimeStatsByActor.Input.Path, - query: Operations.ApiInsightsGetTimeStatsByActor.Input.Query, - headers: Operations.ApiInsightsGetTimeStatsByActor.Input.Headers = .init() + path: Operations.OrgsCancelInvitation.Input.Path, + headers: Operations.OrgsCancelInvitation.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsTimeStats) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ApiInsightsTimeStats { - get throws { - switch self { - case let .json(body): - return body - } - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsCancelInvitation.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsCancelInvitation.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.ApiInsightsGetTimeStatsByActor.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetTimeStatsByActor.Output.Ok.Body) { - self.body = body + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } } } - /// Response + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/404`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetTimeStatsByActor.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ApiInsightsGetTimeStatsByActor.Output.Ok { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .ok(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "notFound", response: self ) } @@ -14570,125 +18541,75 @@ public enum Operations { } } } - /// Get user stats + /// List organization invitation teams /// - /// Get API usage statistics within an organization for a user broken down by the type of access. + /// List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. /// - /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. - public enum ApiInsightsGetUserStats { - public static let id: Swift.String = "api-insights/get-user-stats" + /// - Remark: HTTP `GET /orgs/{org}/invitations/{invitation_id}/teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)`. + public enum OrgsListInvitationTeams { + public static let id: Swift.String = "orgs/list-invitation-teams" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path/org`. public var org: Components.Parameters.Org - /// The ID of the user to query for stats + /// The unique identifier of the invitation. /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path/user_id`. - public var userId: Components.Parameters.ApiInsightsUserId + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path/invitation_id`. + public var invitationId: Components.Parameters.InvitationId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - userId: The ID of the user to query for stats + /// - invitationId: The unique identifier of the invitation. public init( org: Components.Parameters.Org, - userId: Components.Parameters.ApiInsightsUserId + invitationId: Components.Parameters.InvitationId ) { self.org = org - self.userId = userId + self.invitationId = invitationId } } - public var path: Operations.ApiInsightsGetUserStats.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query`. + public var path: Operations.OrgsListInvitationTeams.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/query`. public struct Query: Sendable, Hashable { - /// The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/min_timestamp`. - public var minTimestamp: Components.Parameters.ApiInsightsMinTimestamp - /// The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/max_timestamp`. - public var maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/page`. - public var page: Components.Parameters.Page? /// The number of results per page (max 100). 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// - Remark: Generated from `#/components/parameters/ApiInsightsSort`. - @frozen public enum ApiInsightsSortPayload: String, Codable, Hashable, Sendable, CaseIterable { - case lastRateLimitedTimestamp = "last_rate_limited_timestamp" - case lastRequestTimestamp = "last_request_timestamp" - case rateLimitedRequestCount = "rate_limited_request_count" - case subjectName = "subject_name" - case totalRequestCount = "total_request_count" - } - /// - Remark: Generated from `#/components/parameters/api-insights-sort`. - public typealias ApiInsightsSort = [Components.Parameters.ApiInsightsSortPayload] - /// The property to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/sort`. - public var sort: Components.Parameters.ApiInsightsSort? - /// Providing a substring will filter results where the actor name contains the substring. This is a case-insensitive search. + /// The page number of the results to fetch. 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/actor_name_substring`. - public var actorNameSubstring: Components.Parameters.ApiInsightsActorNameSubstring? + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/query/page`. + public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: - /// - minTimestamp: The minimum timestamp to query for stats. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - maxTimestamp: The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - page: The page number of the results to fetch. 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)." /// - perPage: The number of results per page (max 100). 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)." - /// - direction: The direction to sort the results by. - /// - sort: The property to sort the results by. - /// - actorNameSubstring: Providing a substring will filter results where the actor name contains the substring. This is a case-insensitive search. + /// - page: The page number of the results to fetch. 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)." public init( - minTimestamp: Components.Parameters.ApiInsightsMinTimestamp, - maxTimestamp: Components.Parameters.ApiInsightsMaxTimestamp? = nil, - page: Components.Parameters.Page? = nil, perPage: Components.Parameters.PerPage? = nil, - direction: Components.Parameters.Direction? = nil, - sort: Components.Parameters.ApiInsightsSort? = nil, - actorNameSubstring: Components.Parameters.ApiInsightsActorNameSubstring? = nil + page: Components.Parameters.Page? = nil ) { - self.minTimestamp = minTimestamp - self.maxTimestamp = maxTimestamp - self.page = page self.perPage = perPage - self.direction = direction - self.sort = sort - self.actorNameSubstring = actorNameSubstring + self.page = page } } - public var query: Operations.ApiInsightsGetUserStats.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/header`. + public var query: Operations.OrgsListInvitationTeams.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ApiInsightsGetUserStats.Input.Headers + public var headers: Operations.OrgsListInvitationTeams.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -14696,9 +18617,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.ApiInsightsGetUserStats.Input.Path, - query: Operations.ApiInsightsGetUserStats.Input.Query, - headers: Operations.ApiInsightsGetUserStats.Input.Headers = .init() + path: Operations.OrgsListInvitationTeams.Input.Path, + query: Operations.OrgsListInvitationTeams.Input.Query = .init(), + headers: Operations.OrgsListInvitationTeams.Input.Headers = .init() ) { self.path = path self.query = query @@ -14707,15 +18628,29 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.OrgsListInvitationTeams.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ApiInsightsUserStats) + /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Team]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ApiInsightsUserStats { + public var json: [Components.Schemas.Team] { get throws { switch self { case let .json(body): @@ -14725,26 +18660,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApiInsightsGetUserStats.Output.Ok.Body + public var body: Operations.OrgsListInvitationTeams.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ApiInsightsGetUserStats.Output.Ok.Body) { + public init( + headers: Operations.OrgsListInvitationTeams.Output.Ok.Headers = .init(), + body: Operations.OrgsListInvitationTeams.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ApiInsightsGetUserStats.Output.Ok) + case ok(Operations.OrgsListInvitationTeams.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ApiInsightsGetUserStats.Output.Ok { + public var ok: Operations.OrgsListInvitationTeams.Output.Ok { get throws { switch self { case let .ok(response): @@ -14757,6 +18697,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -14788,25 +18751,20 @@ public enum Operations { } } } - /// List app installations for an organization - /// - /// Lists all GitHub Apps in an organization. The installation count includes - /// all GitHub Apps installed on repositories in the organization. - /// - /// The authenticated user must be an organization owner to use this endpoint. + /// List issue types for an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint. + /// Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/installations`. - /// - Remark: Generated from `#/paths//orgs/{org}/installations/get(orgs/list-app-installations)`. - public enum OrgsListAppInstallations { - public static let id: Swift.String = "orgs/list-app-installations" + /// - Remark: HTTP `GET /orgs/{org}/issue-types`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/get(orgs/list-issue-types)`. + public enum OrgsListIssueTypes { + public static let id: Swift.String = "orgs/list-issue-types" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -14816,107 +18774,43 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsListAppInstallations.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page - } - } - public var query: Operations.OrgsListAppInstallations.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/header`. + public var path: Operations.OrgsListIssueTypes.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListAppInstallations.Input.Headers + public var headers: Operations.OrgsListIssueTypes.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.OrgsListAppInstallations.Input.Path, - query: Operations.OrgsListAppInstallations.Input.Query = .init(), - headers: Operations.OrgsListAppInstallations.Input.Headers = .init() - ) { - self.path = path - self.query = query - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsListAppInstallations.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/json/installations`. - public var installations: [Components.Schemas.Installation] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: - /// - installations: - public init( - totalCount: Swift.Int, - installations: [Components.Schemas.Installation] - ) { - self.totalCount = totalCount - self.installations = installations - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case installations - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/installations/GET/responses/200/content/application\/json`. - case json(Operations.OrgsListAppInstallations.Output.Ok.Body.JsonPayload) + path: Operations.OrgsListIssueTypes.Input.Path, + headers: Operations.OrgsListIssueTypes.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/GET/responses/200/content/application\/json`. + case json([Components.Schemas.IssueType]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.OrgsListAppInstallations.Output.Ok.Body.JsonPayload { + public var json: [Components.Schemas.IssueType] { get throws { switch self { case let .json(body): @@ -14926,31 +18820,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListAppInstallations.Output.Ok.Body + public var body: Operations.OrgsListIssueTypes.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.OrgsListAppInstallations.Output.Ok.Headers = .init(), - body: Operations.OrgsListAppInstallations.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.OrgsListIssueTypes.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/installations/get(orgs/list-app-installations)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/get(orgs/list-issue-types)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListAppInstallations.Output.Ok) + case ok(Operations.OrgsListIssueTypes.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListAppInstallations.Output.Ok { + public var ok: Operations.OrgsListIssueTypes.Output.Ok { get throws { switch self { case let .ok(response): @@ -14963,6 +18852,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/get(orgs/list-issue-types)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -14994,23 +18906,25 @@ public enum Operations { } } } - /// List pending organization invitations + /// Create issue type for an organization /// - /// The return hash contains a `role` field which refers to the Organization - /// Invitation role and will be one of the following values: `direct_member`, `admin`, - /// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub - /// member, the `login` field in the return hash will be `null`. + /// Create a new issue type for an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/invitations`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`. - public enum OrgsListPendingInvitations { - public static let id: Swift.String = "orgs/list-pending-invitations" + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/issue-types`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)`. + public enum OrgsCreateIssueType { + public static let id: Swift.String = "orgs/create-issue-type" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -15020,112 +18934,52 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsListPendingInvitations.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/page`. - public var page: Components.Parameters.Page? - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/role`. - @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case admin = "admin" - case directMember = "direct_member" - case billingManager = "billing_manager" - case hiringManager = "hiring_manager" - } - /// Filter invitations by their member role. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/role`. - public var role: Operations.OrgsListPendingInvitations.Input.Query.RolePayload? - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/invitation_source`. - @frozen public enum InvitationSourcePayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case member = "member" - case scim = "scim" - } - /// Filter invitations by their invitation source. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/query/invitation_source`. - public var invitationSource: Operations.OrgsListPendingInvitations.Input.Query.InvitationSourcePayload? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." - /// - role: Filter invitations by their member role. - /// - invitationSource: Filter invitations by their invitation source. - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil, - role: Operations.OrgsListPendingInvitations.Input.Query.RolePayload? = nil, - invitationSource: Operations.OrgsListPendingInvitations.Input.Query.InvitationSourcePayload? = nil - ) { - self.perPage = perPage - self.page = page - self.role = role - self.invitationSource = invitationSource - } - } - public var query: Operations.OrgsListPendingInvitations.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/header`. + public var path: Operations.OrgsCreateIssueType.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListPendingInvitations.Input.Headers + public var headers: Operations.OrgsCreateIssueType.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/requestBody/content/application\/json`. + case json(Components.Schemas.OrganizationCreateIssueType) + } + public var body: Operations.OrgsCreateIssueType.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.OrgsListPendingInvitations.Input.Path, - query: Operations.OrgsListPendingInvitations.Input.Query = .init(), - headers: Operations.OrgsListPendingInvitations.Input.Headers = .init() + path: Operations.OrgsCreateIssueType.Input.Path, + headers: Operations.OrgsCreateIssueType.Input.Headers = .init(), + body: Operations.OrgsCreateIssueType.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsListPendingInvitations.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/GET/responses/200/content/application\/json`. - case json([Components.Schemas.OrganizationInvitation]) + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/responses/200/content/application\/json`. + case json(Components.Schemas.IssueType) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.OrganizationInvitation] { + public var json: Components.Schemas.IssueType { get throws { switch self { case let .json(body): @@ -15135,31 +18989,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListPendingInvitations.Output.Ok.Body + public var body: Operations.OrgsCreateIssueType.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.OrgsListPendingInvitations.Output.Ok.Headers = .init(), - body: Operations.OrgsListPendingInvitations.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.OrgsCreateIssueType.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListPendingInvitations.Output.Ok) + case ok(Operations.OrgsCreateIssueType.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListPendingInvitations.Output.Ok { + public var ok: Operations.OrgsCreateIssueType.Output.Ok { get throws { switch self { case let .ok(response): @@ -15174,7 +19023,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -15195,6 +19044,29 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -15226,111 +19098,62 @@ public enum Operations { } } } - /// Create an organization invitation + /// Update issue type for an organization /// - /// Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. + /// Updates an issue type for an organization. /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" - /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). /// - /// - Remark: HTTP `POST /orgs/{org}/invitations`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)`. - public enum OrgsCreateInvitation { - public static let id: Swift.String = "orgs/create-invitation" + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/issue-types/{issue_type_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)`. + public enum OrgsUpdateIssueType { + public static let id: Swift.String = "orgs/update-issue-type" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/path/org`. public var org: Components.Parameters.Org + /// The unique identifier of the issue type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/path/issue_type_id`. + public var issueTypeId: Components.Parameters.IssueTypeId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - issueTypeId: The unique identifier of the issue type. + public init( + org: Components.Parameters.Org, + issueTypeId: Components.Parameters.IssueTypeId + ) { self.org = org + self.issueTypeId = issueTypeId } } - public var path: Operations.OrgsCreateInvitation.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/header`. + public var path: Operations.OrgsUpdateIssueType.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsCreateInvitation.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody`. + public var headers: Operations.OrgsUpdateIssueType.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// **Required unless you provide `email`**. GitHub user ID for the person you are inviting. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/invitee_id`. - public var inviteeId: Swift.Int? - /// **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/email`. - public var email: Swift.String? - /// The role for the new member. - /// * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. - /// * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. - /// * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. - /// * `reinstate` - The previous role assigned to the invitee before they were removed from your organization. Can be one of the roles listed above. Only works if the invitee was previously part of your organization. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/role`. - @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { - case admin = "admin" - case directMember = "direct_member" - case billingManager = "billing_manager" - case reinstate = "reinstate" - } - /// The role for the new member. - /// * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. - /// * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. - /// * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. - /// * `reinstate` - The previous role assigned to the invitee before they were removed from your organization. Can be one of the roles listed above. Only works if the invitee was previously part of your organization. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/role`. - public var role: Operations.OrgsCreateInvitation.Input.Body.JsonPayload.RolePayload? - /// Specify IDs for the teams you want to invite new members to. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/json/team_ids`. - public var teamIds: [Swift.Int]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - inviteeId: **Required unless you provide `email`**. GitHub user ID for the person you are inviting. - /// - email: **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. - /// - role: The role for the new member. - /// - teamIds: Specify IDs for the teams you want to invite new members to. - public init( - inviteeId: Swift.Int? = nil, - email: Swift.String? = nil, - role: Operations.OrgsCreateInvitation.Input.Body.JsonPayload.RolePayload? = nil, - teamIds: [Swift.Int]? = nil - ) { - self.inviteeId = inviteeId - self.email = email - self.role = role - self.teamIds = teamIds - } - public enum CodingKeys: String, CodingKey { - case inviteeId = "invitee_id" - case email - case role - case teamIds = "team_ids" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/requestBody/content/application\/json`. - case json(Operations.OrgsCreateInvitation.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.OrganizationUpdateIssueType) } - public var body: Operations.OrgsCreateInvitation.Input.Body? + public var body: Operations.OrgsUpdateIssueType.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -15338,9 +19161,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.OrgsCreateInvitation.Input.Path, - headers: Operations.OrgsCreateInvitation.Input.Headers = .init(), - body: Operations.OrgsCreateInvitation.Input.Body? = nil + path: Operations.OrgsUpdateIssueType.Input.Path, + headers: Operations.OrgsUpdateIssueType.Input.Headers = .init(), + body: Operations.OrgsUpdateIssueType.Input.Body ) { self.path = path self.headers = headers @@ -15348,16 +19171,16 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/POST/responses/201/content/application\/json`. - case json(Components.Schemas.OrganizationInvitation) + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/responses/200/content/application\/json`. + case json(Components.Schemas.IssueType) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.OrganizationInvitation { + public var json: Components.Schemas.IssueType { get throws { switch self { case let .json(body): @@ -15367,79 +19190,79 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsCreateInvitation.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.OrgsUpdateIssueType.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsCreateInvitation.Output.Created.Body) { + public init(body: Operations.OrgsUpdateIssueType.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.OrgsCreateInvitation.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsUpdateIssueType.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.OrgsCreateInvitation.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsUpdateIssueType.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } } } - /// Validation failed, or the endpoint has been spammed. + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)/responses/404`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unprocessableContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "notFound", response: self ) } } } - /// Resource not found + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/post(orgs/create-invitation)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)/responses/422`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { get throws { switch self { - case let .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } @@ -15476,61 +19299,64 @@ public enum Operations { } } } - /// Cancel an organization invitation + /// Delete issue type for an organization /// - /// Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. + /// Deletes an issue type for an organization. /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). + /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). /// - /// - Remark: HTTP `DELETE /orgs/{org}/invitations/{invitation_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)`. - public enum OrgsCancelInvitation { - public static let id: Swift.String = "orgs/cancel-invitation" + /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and + /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/issue-types/{issue_type_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)`. + public enum OrgsDeleteIssueType { + public static let id: Swift.String = "orgs/delete-issue-type" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the invitation. + /// The unique identifier of the issue type. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/path/invitation_id`. - public var invitationId: Components.Parameters.InvitationId + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/DELETE/path/issue_type_id`. + public var issueTypeId: Components.Parameters.IssueTypeId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - invitationId: The unique identifier of the invitation. + /// - issueTypeId: The unique identifier of the issue type. public init( org: Components.Parameters.Org, - invitationId: Components.Parameters.InvitationId + issueTypeId: Components.Parameters.IssueTypeId ) { self.org = org - self.invitationId = invitationId + self.issueTypeId = issueTypeId } } - public var path: Operations.OrgsCancelInvitation.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/DELETE/header`. + public var path: Operations.OrgsDeleteIssueType.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsCancelInvitation.Input.Headers + public var headers: Operations.OrgsDeleteIssueType.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsCancelInvitation.Input.Path, - headers: Operations.OrgsCancelInvitation.Input.Headers = .init() + path: Operations.OrgsDeleteIssueType.Input.Path, + headers: Operations.OrgsDeleteIssueType.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -15543,13 +19369,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsCancelInvitation.Output.NoContent) + case noContent(Operations.OrgsDeleteIssueType.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -15559,7 +19385,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsCancelInvitation.Output.NoContent { + public var noContent: Operations.OrgsDeleteIssueType.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -15574,15 +19400,15 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) + case unprocessableContent(Components.Responses.ValidationFailedSimple) /// The associated value of the enum case if `self` is `.unprocessableContent`. /// /// - Throws: An error if `self` is not `.unprocessableContent`. /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + public var unprocessableContent: Components.Responses.ValidationFailedSimple { get throws { switch self { case let .unprocessableContent(response): @@ -15597,7 +19423,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/delete(orgs/cancel-invitation)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -15649,75 +19475,92 @@ public enum Operations { } } } - /// List organization invitation teams + /// List organization members /// - /// List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. + /// List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. /// - /// - Remark: HTTP `GET /orgs/{org}/invitations/{invitation_id}/teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)`. - public enum OrgsListInvitationTeams { - public static let id: Swift.String = "orgs/list-invitation-teams" + /// - Remark: HTTP `GET /orgs/{org}/members`. + /// - Remark: Generated from `#/paths//orgs/{org}/members/get(orgs/list-members)`. + public enum OrgsListMembers { + public static let id: Swift.String = "orgs/list-members" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the invitation. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/path/invitation_id`. - public var invitationId: Components.Parameters.InvitationId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - invitationId: The unique identifier of the invitation. - public init( - org: Components.Parameters.Org, - invitationId: Components.Parameters.InvitationId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.invitationId = invitationId } - } - public var path: Operations.OrgsListInvitationTeams.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/query`. - public struct Query: Sendable, Hashable { + } + public var path: Operations.OrgsListMembers.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/query/filter`. + @frozen public enum FilterPayload: String, Codable, Hashable, Sendable, CaseIterable { + case _2faDisabled = "2fa_disabled" + case _2faInsecure = "2fa_insecure" + case all = "all" + } + /// Filter members returned in the list. `2fa_disabled` means that only members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. `2fa_insecure` means that only members with [insecure 2FA methods](https://docs.github.com/organizations/keeping-your-organization-secure/managing-two-factor-authentication-for-your-organization/requiring-two-factor-authentication-in-your-organization#requiring-secure-methods-of-two-factor-authentication-in-your-organization) will be returned. These options are only available for organization owners. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/query/filter`. + public var filter: Operations.OrgsListMembers.Input.Query.FilterPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/query/role`. + @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case admin = "admin" + case member = "member" + } + /// Filter members returned by their role. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/query/role`. + public var role: Operations.OrgsListMembers.Input.Query.RolePayload? /// The number of results per page (max 100). 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: + /// - filter: Filter members returned in the list. `2fa_disabled` means that only members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. `2fa_insecure` means that only members with [insecure 2FA methods](https://docs.github.com/organizations/keeping-your-organization-secure/managing-two-factor-authentication-for-your-organization/requiring-two-factor-authentication-in-your-organization#requiring-secure-methods-of-two-factor-authentication-in-your-organization) will be returned. These options are only available for organization owners. + /// - role: Filter members returned by their role. /// - perPage: The number of results per page (max 100). 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)." /// - page: The page number of the results to fetch. 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)." public init( + filter: Operations.OrgsListMembers.Input.Query.FilterPayload? = nil, + role: Operations.OrgsListMembers.Input.Query.RolePayload? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil ) { + self.filter = filter + self.role = role self.perPage = perPage self.page = page } } - public var query: Operations.OrgsListInvitationTeams.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/header`. + public var query: Operations.OrgsListMembers.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListInvitationTeams.Input.Headers + public var headers: Operations.OrgsListMembers.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -15725,9 +19568,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.OrgsListInvitationTeams.Input.Path, - query: Operations.OrgsListInvitationTeams.Input.Query = .init(), - headers: Operations.OrgsListInvitationTeams.Input.Headers = .init() + path: Operations.OrgsListMembers.Input.Path, + query: Operations.OrgsListMembers.Input.Query = .init(), + headers: Operations.OrgsListMembers.Input.Headers = .init() ) { self.path = path self.query = query @@ -15736,9 +19579,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -15749,16 +19592,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.OrgsListInvitationTeams.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/content`. + public var headers: Operations.OrgsListMembers.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/invitations/{invitation_id}/teams/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Team]) + /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Team] { + public var json: [Components.Schemas.SimpleUser] { get throws { switch self { case let .json(body): @@ -15768,15 +19611,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListInvitationTeams.Output.Ok.Body + public var body: Operations.OrgsListMembers.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.OrgsListInvitationTeams.Output.Ok.Headers = .init(), - body: Operations.OrgsListInvitationTeams.Output.Ok.Body + headers: Operations.OrgsListMembers.Output.Ok.Headers = .init(), + body: Operations.OrgsListMembers.Output.Ok.Body ) { self.headers = headers self.body = body @@ -15784,15 +19627,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/members/get(orgs/list-members)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListInvitationTeams.Output.Ok) + case ok(Operations.OrgsListMembers.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListInvitationTeams.Output.Ok { + public var ok: Operations.OrgsListMembers.Output.Ok { get throws { switch self { case let .ok(response): @@ -15805,24 +19648,24 @@ public enum Operations { } } } - /// Resource not found + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/invitations/{invitation_id}/teams/get(orgs/list-invitation-teams)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/members/get(orgs/list-members)/responses/422`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } @@ -15859,125 +19702,285 @@ public enum Operations { } } } - /// List issue types for an organization + /// Check organization membership for a user /// - /// Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint. + /// Check if a user is, publicly or privately, a member of the organization. + /// + /// - Remark: HTTP `GET /orgs/{org}/members/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/get(orgs/check-membership-for-user)`. + public enum OrgsCheckMembershipForUser { + public static let id: Swift.String = "orgs/check-membership-for-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/GET/path/org`. + public var org: Components.Parameters.Org + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/GET/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - username: The handle for the GitHub user account. + public init( + org: Components.Parameters.Org, + username: Components.Parameters.Username + ) { + self.org = org + self.username = username + } + } + public var path: Operations.OrgsCheckMembershipForUser.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.OrgsCheckMembershipForUser.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response if requester is an organization member and user is a member + /// + /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/get(orgs/check-membership-for-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsCheckMembershipForUser.Output.NoContent) + /// Response if requester is an organization member and user is a member + /// + /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/get(orgs/check-membership-for-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsCheckMembershipForUser.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct Found: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/GET/responses/302/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/GET/responses/302/headers/Location`. + public var location: Swift.String? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - location: + public init(location: Swift.String? = nil) { + self.location = location + } + } + /// Received HTTP response headers + public var headers: Operations.OrgsCheckMembershipForUser.Output.Found.Headers + /// Creates a new `Found`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + public init(headers: Operations.OrgsCheckMembershipForUser.Output.Found.Headers = .init()) { + self.headers = headers + } + } + /// Response if requester is not an organization member + /// + /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/get(orgs/check-membership-for-user)/responses/302`. + /// + /// HTTP response code: `302 found`. + case found(Operations.OrgsCheckMembershipForUser.Output.Found) + /// The associated value of the enum case if `self` is `.found`. + /// + /// - Throws: An error if `self` is not `.found`. + /// - SeeAlso: `.found`. + public var found: Operations.OrgsCheckMembershipForUser.Output.Found { + get throws { + switch self { + case let .found(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "found", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Not Found if requester is an organization member and user is not a member + /// + /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/get(orgs/check-membership-for-user)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.OrgsCheckMembershipForUser.Output.NotFound) + /// Not Found if requester is an organization member and user is not a member + /// + /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/get(orgs/check-membership-for-user)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.OrgsCheckMembershipForUser.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Remove an organization member + /// + /// Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. + /// + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. /// - /// - Remark: HTTP `GET /orgs/{org}/issue-types`. - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/get(orgs/list-issue-types)`. - public enum OrgsListIssueTypes { - public static let id: Swift.String = "orgs/list-issue-types" + /// - Remark: HTTP `DELETE /orgs/{org}/members/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)`. + public enum OrgsRemoveMember { + public static let id: Swift.String = "orgs/remove-member" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/DELETE/path/org`. public var org: Components.Parameters.Org + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/DELETE/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - username: The handle for the GitHub user account. + public init( + org: Components.Parameters.Org, + username: Components.Parameters.Username + ) { self.org = org + self.username = username } } - public var path: Operations.OrgsListIssueTypes.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/GET/header`. + public var path: Operations.OrgsRemoveMember.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListIssueTypes.Input.Headers + public var headers: Operations.OrgsRemoveMember.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsListIssueTypes.Input.Path, - headers: Operations.OrgsListIssueTypes.Input.Headers = .init() + path: Operations.OrgsRemoveMember.Input.Path, + headers: Operations.OrgsRemoveMember.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/GET/responses/200/content/application\/json`. - case json([Components.Schemas.IssueType]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.IssueType] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OrgsListIssueTypes.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OrgsListIssueTypes.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/get(orgs/list-issue-types)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListIssueTypes.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsRemoveMember.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListIssueTypes.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsRemoveMember.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } } } - /// Resource not found + /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/get(orgs/list-issue-types)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)/responses/403`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .notFound(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "forbidden", response: self ) } @@ -16014,80 +20017,75 @@ public enum Operations { } } } - /// Create issue type for an organization - /// - /// Create a new issue type for an organization. - /// - /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// Get organization membership for a user /// - /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and - /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status. /// - /// - Remark: HTTP `POST /orgs/{org}/issue-types`. - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)`. - public enum OrgsCreateIssueType { - public static let id: Swift.String = "orgs/create-issue-type" + /// - Remark: HTTP `GET /orgs/{org}/memberships/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/get(orgs/get-membership-for-user)`. + public enum OrgsGetMembershipForUser { + public static let id: Swift.String = "orgs/get-membership-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/GET/path/org`. public var org: Components.Parameters.Org + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - username: The handle for the GitHub user account. + public init( + org: Components.Parameters.Org, + username: Components.Parameters.Username + ) { self.org = org + self.username = username } } - public var path: Operations.OrgsCreateIssueType.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/header`. + public var path: Operations.OrgsGetMembershipForUser.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsCreateIssueType.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/requestBody/content/application\/json`. - case json(Components.Schemas.OrganizationCreateIssueType) - } - public var body: Operations.OrgsCreateIssueType.Input.Body + public var headers: Operations.OrgsGetMembershipForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.OrgsCreateIssueType.Input.Path, - headers: Operations.OrgsCreateIssueType.Input.Headers = .init(), - body: Operations.OrgsCreateIssueType.Input.Body + path: Operations.OrgsGetMembershipForUser.Input.Path, + headers: Operations.OrgsGetMembershipForUser.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/POST/responses/200/content/application\/json`. - case json(Components.Schemas.IssueType) + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.OrgMembership) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.IssueType { + public var json: Components.Schemas.OrgMembership { get throws { switch self { case let .json(body): @@ -16097,26 +20095,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsCreateIssueType.Output.Ok.Body + public var body: Operations.OrgsGetMembershipForUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsCreateIssueType.Output.Ok.Body) { + public init(body: Operations.OrgsGetMembershipForUser.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/get(orgs/get-membership-for-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsCreateIssueType.Output.Ok) + case ok(Operations.OrgsGetMembershipForUser.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsCreateIssueType.Output.Ok { + public var ok: Operations.OrgsGetMembershipForUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -16131,7 +20129,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/get(orgs/get-membership-for-user)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -16152,24 +20150,24 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. + /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/post(orgs/create-issue-type)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/get(orgs/get-membership-for-user)/responses/403`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .unprocessableContent(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "forbidden", response: self ) } @@ -16206,62 +20204,93 @@ public enum Operations { } } } - /// Update issue type for an organization + /// Set organization membership for a user /// - /// Updates an issue type for an organization. + /// Only authenticated organization owners can add a member to the organization or update the member's role. /// - /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user) will be `pending` until they accept the invitation. + /// + /// * Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent. /// - /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and - /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// **Rate limits** /// - /// - Remark: HTTP `PUT /orgs/{org}/issue-types/{issue_type_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)`. - public enum OrgsUpdateIssueType { - public static let id: Swift.String = "orgs/update-issue-type" + /// To prevent abuse, organization owners are limited to creating 50 organization invitations for an organization within a 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. + /// + /// - Remark: HTTP `PUT /orgs/{org}/memberships/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/put(orgs/set-membership-for-user)`. + public enum OrgsSetMembershipForUser { + public static let id: Swift.String = "orgs/set-membership-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the issue type. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/path/issue_type_id`. - public var issueTypeId: Components.Parameters.IssueTypeId + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - issueTypeId: The unique identifier of the issue type. + /// - username: The handle for the GitHub user account. public init( org: Components.Parameters.Org, - issueTypeId: Components.Parameters.IssueTypeId + username: Components.Parameters.Username ) { self.org = org - self.issueTypeId = issueTypeId + self.username = username } } - public var path: Operations.OrgsUpdateIssueType.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/header`. + public var path: Operations.OrgsSetMembershipForUser.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } - } - public var headers: Operations.OrgsUpdateIssueType.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/requestBody`. + } + public var headers: Operations.OrgsSetMembershipForUser.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/requestBody/content/application\/json`. - case json(Components.Schemas.OrganizationUpdateIssueType) + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The role to give the user in the organization. Can be one of: + /// * `admin` - The user will become an owner of the organization. + /// * `member` - The user will become a non-owner member of the organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/requestBody/json/role`. + @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { + case admin = "admin" + case member = "member" + } + /// The role to give the user in the organization. Can be one of: + /// * `admin` - The user will become an owner of the organization. + /// * `member` - The user will become a non-owner member of the organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/requestBody/json/role`. + public var role: Operations.OrgsSetMembershipForUser.Input.Body.JsonPayload.RolePayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - role: The role to give the user in the organization. Can be one of: + public init(role: Operations.OrgsSetMembershipForUser.Input.Body.JsonPayload.RolePayload? = nil) { + self.role = role + } + public enum CodingKeys: String, CodingKey { + case role + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/requestBody/content/application\/json`. + case json(Operations.OrgsSetMembershipForUser.Input.Body.JsonPayload) } - public var body: Operations.OrgsUpdateIssueType.Input.Body + public var body: Operations.OrgsSetMembershipForUser.Input.Body? /// Creates a new `Input`. /// /// - Parameters: @@ -16269,9 +20298,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.OrgsUpdateIssueType.Input.Path, - headers: Operations.OrgsUpdateIssueType.Input.Headers = .init(), - body: Operations.OrgsUpdateIssueType.Input.Body + path: Operations.OrgsSetMembershipForUser.Input.Path, + headers: Operations.OrgsSetMembershipForUser.Input.Headers = .init(), + body: Operations.OrgsSetMembershipForUser.Input.Body? = nil ) { self.path = path self.headers = headers @@ -16280,15 +20309,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/PUT/responses/200/content/application\/json`. - case json(Components.Schemas.IssueType) + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/responses/200/content/application\/json`. + case json(Components.Schemas.OrgMembership) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.IssueType { + public var json: Components.Schemas.OrgMembership { get throws { switch self { case let .json(body): @@ -16298,26 +20327,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsUpdateIssueType.Output.Ok.Body + public var body: Operations.OrgsSetMembershipForUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsUpdateIssueType.Output.Ok.Body) { + public init(body: Operations.OrgsSetMembershipForUser.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/put(orgs/set-membership-for-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsUpdateIssueType.Output.Ok) + case ok(Operations.OrgsSetMembershipForUser.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsUpdateIssueType.Output.Ok { + public var ok: Operations.OrgsSetMembershipForUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -16330,47 +20359,47 @@ public enum Operations { } } } - /// Resource not found + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/put(orgs/set-membership-for-user)/responses/422`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } } } - /// Validation failed, or the endpoint has been spammed. + /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/put(orgs/update-issue-type)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/put(orgs/set-membership-for-user)/responses/403`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .unprocessableContent(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "forbidden", response: self ) } @@ -16407,64 +20436,64 @@ public enum Operations { } } } - /// Delete issue type for an organization + /// Remove organization membership for a user /// - /// Deletes an issue type for an organization. + /// In order to remove a user's membership with an organization, the authenticated user must be an organization owner. /// - /// You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization). + /// If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. /// - /// To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and - /// personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// > [!NOTE] + /// > If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team. /// - /// - Remark: HTTP `DELETE /orgs/{org}/issue-types/{issue_type_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)`. - public enum OrgsDeleteIssueType { - public static let id: Swift.String = "orgs/delete-issue-type" + /// - Remark: HTTP `DELETE /orgs/{org}/memberships/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)`. + public enum OrgsRemoveMembershipForUser { + public static let id: Swift.String = "orgs/remove-membership-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the issue type. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/DELETE/path/issue_type_id`. - public var issueTypeId: Components.Parameters.IssueTypeId + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/DELETE/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - issueTypeId: The unique identifier of the issue type. + /// - username: The handle for the GitHub user account. public init( org: Components.Parameters.Org, - issueTypeId: Components.Parameters.IssueTypeId + username: Components.Parameters.Username ) { self.org = org - self.issueTypeId = issueTypeId + self.username = username } } - public var path: Operations.OrgsDeleteIssueType.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/issue-types/{issue_type_id}/DELETE/header`. + public var path: Operations.OrgsRemoveMembershipForUser.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsDeleteIssueType.Input.Headers + public var headers: Operations.OrgsRemoveMembershipForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsDeleteIssueType.Input.Path, - headers: Operations.OrgsDeleteIssueType.Input.Headers = .init() + path: Operations.OrgsRemoveMembershipForUser.Input.Path, + headers: Operations.OrgsRemoveMembershipForUser.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -16477,13 +20506,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsDeleteIssueType.Output.NoContent) + case noContent(Operations.OrgsRemoveMembershipForUser.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -16493,7 +20522,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsDeleteIssueType.Output.NoContent { + public var noContent: Operations.OrgsRemoveMembershipForUser.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -16506,24 +20535,24 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. + /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)/responses/403`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .unprocessableContent(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "forbidden", response: self ) } @@ -16531,7 +20560,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/issue-types/{issue_type_id}/delete(orgs/delete-issue-type)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -16583,133 +20612,100 @@ public enum Operations { } } } - /// List organization members + /// Get all organization roles for an organization /// - /// List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. + /// Lists the organization roles available in this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." /// - /// - Remark: HTTP `GET /orgs/{org}/members`. - /// - Remark: Generated from `#/paths//orgs/{org}/members/get(orgs/list-members)`. - public enum OrgsListMembers { - public static let id: Swift.String = "orgs/list-members" + /// To use this endpoint, the authenticated user must be one of: + /// + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/organization-roles`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/get(orgs/list-org-roles)`. + public enum OrgsListOrgRoles { + public static let id: Swift.String = "orgs/list-org-roles" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.OrgsListMembers.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/query/filter`. - @frozen public enum FilterPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _2faDisabled = "2fa_disabled" - case _2faInsecure = "2fa_insecure" - case all = "all" - } - /// Filter members returned in the list. `2fa_disabled` means that only members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. `2fa_insecure` means that only members with [insecure 2FA methods](https://docs.github.com/organizations/keeping-your-organization-secure/managing-two-factor-authentication-for-your-organization/requiring-two-factor-authentication-in-your-organization#requiring-secure-methods-of-two-factor-authentication-in-your-organization) will be returned. These options are only available for organization owners. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/query/filter`. - public var filter: Operations.OrgsListMembers.Input.Query.FilterPayload? - /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/query/role`. - @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case admin = "admin" - case member = "member" - } - /// Filter members returned by their role. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/query/role`. - public var role: Operations.OrgsListMembers.Input.Query.RolePayload? - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - filter: Filter members returned in the list. `2fa_disabled` means that only members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. `2fa_insecure` means that only members with [insecure 2FA methods](https://docs.github.com/organizations/keeping-your-organization-secure/managing-two-factor-authentication-for-your-organization/requiring-two-factor-authentication-in-your-organization#requiring-secure-methods-of-two-factor-authentication-in-your-organization) will be returned. These options are only available for organization owners. - /// - role: Filter members returned by their role. - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." - public init( - filter: Operations.OrgsListMembers.Input.Query.FilterPayload? = nil, - role: Operations.OrgsListMembers.Input.Query.RolePayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.filter = filter - self.role = role - self.perPage = perPage - self.page = page + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org } } - public var query: Operations.OrgsListMembers.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/header`. + public var path: Operations.OrgsListOrgRoles.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListMembers.Input.Headers + public var headers: Operations.OrgsListOrgRoles.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.OrgsListMembers.Input.Path, - query: Operations.OrgsListMembers.Input.Query = .init(), - headers: Operations.OrgsListMembers.Input.Headers = .init() + path: Operations.OrgsListOrgRoles.Input.Path, + headers: Operations.OrgsListOrgRoles.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsListMembers.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/members/GET/responses/200/content/application\/json`. - case json([Components.Schemas.SimpleUser]) + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The total number of organization roles available to the organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int? + /// The list of organization roles available to the organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/responses/200/content/json/roles`. + public var roles: [Components.Schemas.OrganizationRole]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: The total number of organization roles available to the organization. + /// - roles: The list of organization roles available to the organization. + public init( + totalCount: Swift.Int? = nil, + roles: [Components.Schemas.OrganizationRole]? = nil + ) { + self.totalCount = totalCount + self.roles = roles + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case roles + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/responses/200/content/application\/json`. + case json(Operations.OrgsListOrgRoles.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.SimpleUser] { + public var json: Operations.OrgsListOrgRoles.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -16719,31 +20715,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListMembers.Output.Ok.Body + public var body: Operations.OrgsListOrgRoles.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.OrgsListMembers.Output.Ok.Headers = .init(), - body: Operations.OrgsListMembers.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.OrgsListOrgRoles.Output.Ok.Body) { self.body = body } } - /// Response + /// Response - list of organization roles /// - /// - Remark: Generated from `#/paths//orgs/{org}/members/get(orgs/list-members)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/get(orgs/list-org-roles)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListMembers.Output.Ok) + case ok(Operations.OrgsListOrgRoles.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListMembers.Output.Ok { + public var ok: Operations.OrgsListOrgRoles.Output.Ok { get throws { switch self { case let .ok(response): @@ -16756,9 +20747,32 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/get(orgs/list-org-roles)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/members/get(orgs/list-members)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/get(orgs/list-org-roles)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -16810,44 +20824,48 @@ public enum Operations { } } } - /// Check organization membership for a user + /// Remove all organization roles for a team /// - /// Check if a user is, publicly or privately, a member of the organization. + /// Removes all assigned organization roles from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." /// - /// - Remark: HTTP `GET /orgs/{org}/members/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/get(orgs/check-membership-for-user)`. - public enum OrgsCheckMembershipForUser { - public static let id: Swift.String = "orgs/check-membership-for-user" + /// The authenticated user must be an administrator for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/delete(orgs/revoke-all-org-roles-team)`. + public enum OrgsRevokeAllOrgRolesTeam { + public static let id: Swift.String = "orgs/revoke-all-org-roles-team" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The handle for the GitHub user account. + /// The slug of the team name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/GET/path/username`. - public var username: Components.Parameters.Username + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/DELETE/path/team_slug`. + public var teamSlug: Components.Parameters.TeamSlug /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. + /// - teamSlug: The slug of the team name. public init( org: Components.Parameters.Org, - username: Components.Parameters.Username + teamSlug: Components.Parameters.TeamSlug ) { self.org = org - self.username = username + self.teamSlug = teamSlug } } - public var path: Operations.OrgsCheckMembershipForUser.Input.Path + public var path: Operations.OrgsRevokeAllOrgRolesTeam.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.OrgsCheckMembershipForUser.Input.Path) { + public init(path: Operations.OrgsRevokeAllOrgRolesTeam.Input.Path) { self.path = path } } @@ -16856,15 +20874,15 @@ public enum Operations { /// Creates a new `NoContent`. public init() {} } - /// Response if requester is an organization member and user is a member + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/get(orgs/check-membership-for-user)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/delete(orgs/revoke-all-org-roles-team)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsCheckMembershipForUser.Output.NoContent) - /// Response if requester is an organization member and user is a member + case noContent(Operations.OrgsRevokeAllOrgRolesTeam.Output.NoContent) + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/get(orgs/check-membership-for-user)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/delete(orgs/revoke-all-org-roles-team)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -16874,7 +20892,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsCheckMembershipForUser.Output.NoContent { + public var noContent: Operations.OrgsRevokeAllOrgRolesTeam.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -16887,47 +20905,95 @@ public enum Operations { } } } - public struct Found: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/GET/responses/302/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/GET/responses/302/headers/Location`. - public var location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - location: - public init(location: Swift.String? = nil) { - self.location = location - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsCheckMembershipForUser.Output.Found.Headers - /// Creates a new `Found`. + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Assign an organization role to a team + /// + /// Assigns an organization role to a team in an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// + /// The authenticated user must be an administrator for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)`. + public enum OrgsAssignTeamToOrgRole { + public static let id: Swift.String = "orgs/assign-team-to-org-role" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/PUT/path/org`. + public var org: Components.Parameters.Org + /// The slug of the team name. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/PUT/path/team_slug`. + public var teamSlug: Components.Parameters.TeamSlug + /// The unique identifier of the role. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/PUT/path/role_id`. + public var roleId: Components.Parameters.RoleId + /// Creates a new `Path`. /// /// - Parameters: - /// - headers: Received HTTP response headers - public init(headers: Operations.OrgsCheckMembershipForUser.Output.Found.Headers = .init()) { - self.headers = headers + /// - org: The organization name. The name is not case sensitive. + /// - teamSlug: The slug of the team name. + /// - roleId: The unique identifier of the role. + public init( + org: Components.Parameters.Org, + teamSlug: Components.Parameters.TeamSlug, + roleId: Components.Parameters.RoleId + ) { + self.org = org + self.teamSlug = teamSlug + self.roleId = roleId } } - /// Response if requester is not an organization member + public var path: Operations.OrgsAssignTeamToOrgRole.Input.Path + /// Creates a new `Input`. /// - /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/get(orgs/check-membership-for-user)/responses/302`. + /// - Parameters: + /// - path: + public init(path: Operations.OrgsAssignTeamToOrgRole.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response /// - /// HTTP response code: `302 found`. - case found(Operations.OrgsCheckMembershipForUser.Output.Found) - /// The associated value of the enum case if `self` is `.found`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsAssignTeamToOrgRole.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. /// - /// - Throws: An error if `self` is not `.found`. - /// - SeeAlso: `.found`. - public var found: Operations.OrgsCheckMembershipForUser.Output.Found { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsAssignTeamToOrgRole.Output.NoContent { get throws { switch self { - case let .found(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "found", + expectedStatus: "noContent", response: self ) } @@ -16937,15 +21003,15 @@ public enum Operations { /// Creates a new `NotFound`. public init() {} } - /// Not Found if requester is an organization member and user is not a member + /// Response if the organization, team or role does not exist. /// - /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/get(orgs/check-membership-for-user)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.OrgsCheckMembershipForUser.Output.NotFound) - /// Not Found if requester is an organization member and user is not a member + case notFound(Operations.OrgsAssignTeamToOrgRole.Output.NotFound) + /// Response if the organization, team or role does not exist. /// - /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/get(orgs/check-membership-for-user)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)/responses/404`. /// /// HTTP response code: `404 notFound`. public static var notFound: Self { @@ -16955,7 +21021,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.OrgsCheckMembershipForUser.Output.NotFound { + public var notFound: Operations.OrgsAssignTeamToOrgRole.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -16968,68 +21034,97 @@ public enum Operations { } } } + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Response if the organization roles feature is not enabled for the organization, or validation failed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.OrgsAssignTeamToOrgRole.Output.UnprocessableContent) + /// Response if the organization roles feature is not enabled for the organization, or validation failed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + public static var unprocessableContent: Self { + .unprocessableContent(.init()) + } + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.OrgsAssignTeamToOrgRole.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// Remove an organization member + /// Remove an organization role from a team /// - /// Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. + /// Removes an organization role from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." /// - /// - Remark: HTTP `DELETE /orgs/{org}/members/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)`. - public enum OrgsRemoveMember { - public static let id: Swift.String = "orgs/remove-member" + /// The authenticated user must be an administrator for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/delete(orgs/revoke-org-role-team)`. + public enum OrgsRevokeOrgRoleTeam { + public static let id: Swift.String = "orgs/revoke-org-role-team" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The handle for the GitHub user account. + /// The slug of the team name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/DELETE/path/username`. - public var username: Components.Parameters.Username + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/DELETE/path/team_slug`. + public var teamSlug: Components.Parameters.TeamSlug + /// The unique identifier of the role. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/DELETE/path/role_id`. + public var roleId: Components.Parameters.RoleId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. + /// - teamSlug: The slug of the team name. + /// - roleId: The unique identifier of the role. public init( org: Components.Parameters.Org, - username: Components.Parameters.Username + teamSlug: Components.Parameters.TeamSlug, + roleId: Components.Parameters.RoleId ) { self.org = org - self.username = username - } - } - public var path: Operations.OrgsRemoveMember.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/members/{username}/DELETE/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + self.teamSlug = teamSlug + self.roleId = roleId } } - public var headers: Operations.OrgsRemoveMember.Input.Headers + public var path: Operations.OrgsRevokeOrgRoleTeam.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: - public init( - path: Operations.OrgsRemoveMember.Input.Path, - headers: Operations.OrgsRemoveMember.Input.Headers = .init() - ) { + public init(path: Operations.OrgsRevokeOrgRoleTeam.Input.Path) { self.path = path - self.headers = headers } } @frozen public enum Output: Sendable, Hashable { @@ -17039,13 +21134,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/delete(orgs/revoke-org-role-team)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsRemoveMember.Output.NoContent) + case noContent(Operations.OrgsRevokeOrgRoleTeam.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/delete(orgs/revoke-org-role-team)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -17055,7 +21150,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsRemoveMember.Output.NoContent { + public var noContent: Operations.OrgsRevokeOrgRoleTeam.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -17068,78 +21163,34 @@ public enum Operations { } } } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/delete(orgs/remove-member)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } } - /// Get organization membership for a user + /// Remove all organization roles for a user /// - /// In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status. + /// Revokes all assigned organization roles from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." /// - /// - Remark: HTTP `GET /orgs/{org}/memberships/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/get(orgs/get-membership-for-user)`. - public enum OrgsGetMembershipForUser { - public static let id: Swift.String = "orgs/get-membership-for-user" + /// The authenticated user must be an administrator for the organization to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/users/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/delete(orgs/revoke-all-org-roles-user)`. + public enum OrgsRevokeAllOrgRolesUser { + public static let id: Swift.String = "orgs/revoke-all-org-roles-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/DELETE/path/org`. public var org: Components.Parameters.Org /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/GET/path/username`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/DELETE/path/username`. public var username: Components.Parameters.Username /// Creates a new `Path`. /// @@ -17147,132 +21198,53 @@ public enum Operations { /// - org: The organization name. The name is not case sensitive. /// - username: The handle for the GitHub user account. public init( - org: Components.Parameters.Org, - username: Components.Parameters.Username - ) { - self.org = org - self.username = username - } - } - public var path: Operations.OrgsGetMembershipForUser.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.OrgsGetMembershipForUser.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.OrgsGetMembershipForUser.Input.Path, - headers: Operations.OrgsGetMembershipForUser.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.OrgMembership) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.OrgMembership { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OrgsGetMembershipForUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OrgsGetMembershipForUser.Output.Ok.Body) { - self.body = body + org: Components.Parameters.Org, + username: Components.Parameters.Username + ) { + self.org = org + self.username = username } } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/get(orgs/get-membership-for-user)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetMembershipForUser.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + public var path: Operations.OrgsRevokeAllOrgRolesUser.Input.Path + /// Creates a new `Input`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsGetMembershipForUser.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } + /// - Parameters: + /// - path: + public init(path: Operations.OrgsRevokeAllOrgRolesUser.Input.Path) { + self.path = path } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/get(orgs/get-membership-for-user)/responses/404`. + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/delete(orgs/revoke-all-org-roles-user)/responses/204`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Forbidden + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsRevokeAllOrgRolesUser.Output.NoContent) + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/get(orgs/get-membership-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/delete(orgs/revoke-all-org-roles-user)/responses/204`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsRevokeAllOrgRolesUser.Output.NoContent { get throws { switch self { - case let .forbidden(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "noContent", response: self ) } @@ -17283,228 +21255,160 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } } - /// Set organization membership for a user - /// - /// Only authenticated organization owners can add a member to the organization or update the member's role. + /// Assign an organization role to a user /// - /// * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user) will be `pending` until they accept the invitation. - /// - /// * Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent. + /// Assigns an organization role to a member of an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." /// - /// **Rate limits** + /// The authenticated user must be an administrator for the organization to use this endpoint. /// - /// To prevent abuse, organization owners are limited to creating 50 organization invitations for an organization within a 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/memberships/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/put(orgs/set-membership-for-user)`. - public enum OrgsSetMembershipForUser { - public static let id: Swift.String = "orgs/set-membership-for-user" + /// - Remark: HTTP `PUT /orgs/{org}/organization-roles/users/{username}/{role_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)`. + public enum OrgsAssignUserToOrgRole { + public static let id: Swift.String = "orgs/assign-user-to-org-role" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/PUT/path/org`. public var org: Components.Parameters.Org /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/path/username`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/PUT/path/username`. public var username: Components.Parameters.Username + /// The unique identifier of the role. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/PUT/path/role_id`. + public var roleId: Components.Parameters.RoleId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - username: The handle for the GitHub user account. + /// - roleId: The unique identifier of the role. public init( org: Components.Parameters.Org, - username: Components.Parameters.Username + username: Components.Parameters.Username, + roleId: Components.Parameters.RoleId ) { self.org = org self.username = username + self.roleId = roleId } } - public var path: Operations.OrgsSetMembershipForUser.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.OrgsSetMembershipForUser.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The role to give the user in the organization. Can be one of: - /// * `admin` - The user will become an owner of the organization. - /// * `member` - The user will become a non-owner member of the organization. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/requestBody/json/role`. - @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { - case admin = "admin" - case member = "member" - } - /// The role to give the user in the organization. Can be one of: - /// * `admin` - The user will become an owner of the organization. - /// * `member` - The user will become a non-owner member of the organization. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/requestBody/json/role`. - public var role: Operations.OrgsSetMembershipForUser.Input.Body.JsonPayload.RolePayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - role: The role to give the user in the organization. Can be one of: - public init(role: Operations.OrgsSetMembershipForUser.Input.Body.JsonPayload.RolePayload? = nil) { - self.role = role - } - public enum CodingKeys: String, CodingKey { - case role - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/requestBody/content/application\/json`. - case json(Operations.OrgsSetMembershipForUser.Input.Body.JsonPayload) - } - public var body: Operations.OrgsSetMembershipForUser.Input.Body? + public var path: Operations.OrgsAssignUserToOrgRole.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: - /// - body: - public init( - path: Operations.OrgsSetMembershipForUser.Input.Path, - headers: Operations.OrgsSetMembershipForUser.Input.Headers = .init(), - body: Operations.OrgsSetMembershipForUser.Input.Body? = nil - ) { + public init(path: Operations.OrgsAssignUserToOrgRole.Input.Path) { self.path = path - self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/PUT/responses/200/content/application\/json`. - case json(Components.Schemas.OrgMembership) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.OrgMembership { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OrgsSetMembershipForUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OrgsSetMembershipForUser.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/put(orgs/set-membership-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsSetMembershipForUser.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsAssignUserToOrgRole.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsSetMembershipForUser.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsAssignUserToOrgRole.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } } } - /// Validation failed, or the endpoint has been spammed. + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Response if the organization, user or role does not exist. /// - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/put(orgs/set-membership-for-user)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)/responses/404`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `404 notFound`. + case notFound(Operations.OrgsAssignUserToOrgRole.Output.NotFound) + /// Response if the organization, user or role does not exist. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.OrgsAssignUserToOrgRole.Output.NotFound { get throws { switch self { - case let .unprocessableContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "notFound", response: self ) } } } - /// Forbidden + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Response if the organization roles feature is not enabled enabled for the organization, the validation failed, or the user is not an organization member. /// - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/put(orgs/set-membership-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)/responses/422`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.OrgsAssignUserToOrgRole.Output.UnprocessableContent) + /// Response if the organization roles feature is not enabled enabled for the organization, the validation failed, or the user is not an organization member. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + public static var unprocessableContent: Self { + .unprocessableContent(.init()) + } + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.OrgsAssignUserToOrgRole.Output.UnprocessableContent { get throws { switch self { - case let .forbidden(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "unprocessableContent", response: self ) } @@ -17515,90 +21419,57 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } } - /// Remove organization membership for a user + /// Remove an organization role from a user /// - /// In order to remove a user's membership with an organization, the authenticated user must be an organization owner. + /// Remove an organization role from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." /// - /// If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. + /// The authenticated user must be an administrator for the organization to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/memberships/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)`. - public enum OrgsRemoveMembershipForUser { - public static let id: Swift.String = "orgs/remove-membership-for-user" + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/delete(orgs/revoke-org-role-user)`. + public enum OrgsRevokeOrgRoleUser { + public static let id: Swift.String = "orgs/revoke-org-role-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/DELETE/path/org`. public var org: Components.Parameters.Org /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/DELETE/path/username`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/DELETE/path/username`. public var username: Components.Parameters.Username + /// The unique identifier of the role. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/DELETE/path/role_id`. + public var roleId: Components.Parameters.RoleId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. /// - username: The handle for the GitHub user account. + /// - roleId: The unique identifier of the role. public init( org: Components.Parameters.Org, - username: Components.Parameters.Username + username: Components.Parameters.Username, + roleId: Components.Parameters.RoleId ) { self.org = org self.username = username + self.roleId = roleId } } - public var path: Operations.OrgsRemoveMembershipForUser.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/memberships/{username}/DELETE/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.OrgsRemoveMembershipForUser.Input.Headers + public var path: Operations.OrgsRevokeOrgRoleUser.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: - public init( - path: Operations.OrgsRemoveMembershipForUser.Input.Path, - headers: Operations.OrgsRemoveMembershipForUser.Input.Headers = .init() - ) { + public init(path: Operations.OrgsRevokeOrgRoleUser.Input.Path) { self.path = path - self.headers = headers } } @frozen public enum Output: Sendable, Hashable { @@ -17608,13 +21479,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/delete(orgs/revoke-org-role-user)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsRemoveMembershipForUser.Output.NoContent) + case noContent(Operations.OrgsRevokeOrgRoleUser.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/delete(orgs/revoke-org-role-user)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -17624,7 +21495,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsRemoveMembershipForUser.Output.NoContent { + public var noContent: Operations.OrgsRevokeOrgRoleUser.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -17637,86 +21508,15 @@ public enum Operations { } } } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/memberships/{username}/delete(orgs/remove-membership-for-user)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } } - /// Get all organization roles for an organization + /// Get an organization role /// - /// Lists the organization roles available in this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// Gets an organization role that is available to this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." /// /// To use this endpoint, the authenticated user must be one of: /// @@ -17725,46 +21525,55 @@ public enum Operations { /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/organization-roles`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/get(orgs/list-org-roles)`. - public enum OrgsListOrgRoles { - public static let id: Swift.String = "orgs/list-org-roles" + /// - Remark: HTTP `GET /orgs/{org}/organization-roles/{role_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/get(orgs/get-org-role)`. + public enum OrgsGetOrgRole { + public static let id: Swift.String = "orgs/get-org-role" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/GET/path/org`. public var org: Components.Parameters.Org + /// The unique identifier of the role. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/GET/path/role_id`. + public var roleId: Components.Parameters.RoleId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - roleId: The unique identifier of the role. + public init( + org: Components.Parameters.Org, + roleId: Components.Parameters.RoleId + ) { self.org = org + self.roleId = roleId } } - public var path: Operations.OrgsListOrgRoles.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/header`. + public var path: Operations.OrgsGetOrgRole.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListOrgRoles.Input.Headers + public var headers: Operations.OrgsGetOrgRole.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsListOrgRoles.Input.Path, - headers: Operations.OrgsListOrgRoles.Input.Headers = .init() + path: Operations.OrgsGetOrgRole.Input.Path, + headers: Operations.OrgsGetOrgRole.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -17772,42 +21581,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The total number of organization roles available to the organization. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int? - /// The list of organization roles available to the organization. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/responses/200/content/json/roles`. - public var roles: [Components.Schemas.OrganizationRole]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalCount: The total number of organization roles available to the organization. - /// - roles: The list of organization roles available to the organization. - public init( - totalCount: Swift.Int? = nil, - roles: [Components.Schemas.OrganizationRole]? = nil - ) { - self.totalCount = totalCount - self.roles = roles - } - public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case roles - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/GET/responses/200/content/application\/json`. - case json(Operations.OrgsListOrgRoles.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.OrganizationRole) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.OrgsListOrgRoles.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.OrganizationRole { get throws { switch self { case let .json(body): @@ -17817,26 +21599,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListOrgRoles.Output.Ok.Body + public var body: Operations.OrgsGetOrgRole.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsListOrgRoles.Output.Ok.Body) { + public init(body: Operations.OrgsGetOrgRole.Output.Ok.Body) { self.body = body } } - /// Response - list of organization roles + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/get(orgs/list-org-roles)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/get(orgs/get-org-role)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListOrgRoles.Output.Ok) + case ok(Operations.OrgsGetOrgRole.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListOrgRoles.Output.Ok { + public var ok: Operations.OrgsGetOrgRole.Output.Ok { get throws { switch self { case let .ok(response): @@ -17851,7 +21633,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/get(orgs/list-org-roles)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/get(orgs/get-org-role)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -17874,7 +21656,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/get(orgs/list-org-roles)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/get(orgs/get-org-role)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -17926,176 +21708,161 @@ public enum Operations { } } } - /// Remove all organization roles for a team + /// List teams that are assigned to an organization role /// - /// Removes all assigned organization roles from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// Lists the teams that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." /// - /// The authenticated user must be an administrator for the organization to use this endpoint. + /// To use this endpoint, you must be an administrator for the organization. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/teams/{team_slug}`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/delete(orgs/revoke-all-org-roles-team)`. - public enum OrgsRevokeAllOrgRolesTeam { - public static let id: Swift.String = "orgs/revoke-all-org-roles-team" + /// - Remark: HTTP `GET /orgs/{org}/organization-roles/{role_id}/teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/teams/get(orgs/list-org-role-teams)`. + public enum OrgsListOrgRoleTeams { + public static let id: Swift.String = "orgs/list-org-role-teams" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/path/org`. public var org: Components.Parameters.Org - /// The slug of the team name. + /// The unique identifier of the role. /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/DELETE/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/path/role_id`. + public var roleId: Components.Parameters.RoleId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. + /// - roleId: The unique identifier of the role. public init( org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug + roleId: Components.Parameters.RoleId ) { self.org = org - self.teamSlug = teamSlug - } - } - public var path: Operations.OrgsRevokeAllOrgRolesTeam.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.OrgsRevokeAllOrgRolesTeam.Input.Path) { - self.path = path - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/delete(orgs/revoke-all-org-roles-team)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsRevokeAllOrgRolesTeam.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/delete(orgs/revoke-all-org-roles-team)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsRevokeAllOrgRolesTeam.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } + self.roleId = roleId } } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// Assign an organization role to a team - /// - /// Assigns an organization role to a team in an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)`. - public enum OrgsAssignTeamToOrgRole { - public static let id: Swift.String = "orgs/assign-team-to-org-role" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/PUT/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/PUT/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. + public var path: Operations.OrgsListOrgRoleTeams.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/PUT/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The unique identifier of the role. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/PUT/path/role_id`. - public var roleId: Components.Parameters.RoleId - /// Creates a new `Path`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - roleId: The unique identifier of the role. + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - roleId: Components.Parameters.RoleId + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil ) { - self.org = org - self.teamSlug = teamSlug - self.roleId = roleId + self.perPage = perPage + self.page = page } } - public var path: Operations.OrgsAssignTeamToOrgRole.Input.Path + public var query: Operations.OrgsListOrgRoleTeams.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsListOrgRoleTeams.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.OrgsAssignTeamToOrgRole.Input.Path) { + /// - query: + /// - headers: + public init( + path: Operations.OrgsListOrgRoleTeams.Input.Path, + query: Operations.OrgsListOrgRoleTeams.Input.Query = .init(), + headers: Operations.OrgsListOrgRoleTeams.Input.Headers = .init() + ) { self.path = path + self.query = query + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.OrgsListOrgRoleTeams.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/responses/200/content/application\/json`. + case json([Components.Schemas.TeamRoleAssignment]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.TeamRoleAssignment] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsListOrgRoleTeams.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.OrgsListOrgRoleTeams.Output.Ok.Headers = .init(), + body: Operations.OrgsListOrgRoleTeams.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsAssignTeamToOrgRole.Output.NoContent) - /// Response + /// Response - List of assigned teams /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/teams/get(orgs/list-org-role-teams)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsListOrgRoleTeams.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsAssignTeamToOrgRole.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsListOrgRoleTeams.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } @@ -18105,15 +21872,15 @@ public enum Operations { /// Creates a new `NotFound`. public init() {} } - /// Response if the organization, team or role does not exist. + /// Response if the organization or role does not exist. /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/teams/get(orgs/list-org-role-teams)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.OrgsAssignTeamToOrgRole.Output.NotFound) - /// Response if the organization, team or role does not exist. + case notFound(Operations.OrgsListOrgRoleTeams.Output.NotFound) + /// Response if the organization or role does not exist. /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/teams/get(orgs/list-org-role-teams)/responses/404`. /// /// HTTP response code: `404 notFound`. public static var notFound: Self { @@ -18123,7 +21890,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.OrgsAssignTeamToOrgRole.Output.NotFound { + public var notFound: Operations.OrgsListOrgRoleTeams.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -18140,15 +21907,15 @@ public enum Operations { /// Creates a new `UnprocessableContent`. public init() {} } - /// Response if the organization roles feature is not enabled for the organization, or validation failed. + /// Response if the organization roles feature is not enabled or validation failed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/teams/get(orgs/list-org-role-teams)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.OrgsAssignTeamToOrgRole.Output.UnprocessableContent) - /// Response if the organization roles feature is not enabled for the organization, or validation failed. + case unprocessableContent(Operations.OrgsListOrgRoleTeams.Output.UnprocessableContent) + /// Response if the organization roles feature is not enabled or validation failed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/put(orgs/assign-team-to-org-role)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/teams/get(orgs/list-org-role-teams)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. public static var unprocessableContent: Self { @@ -18158,7 +21925,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.unprocessableContent`. /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.OrgsAssignTeamToOrgRole.Output.UnprocessableContent { + public var unprocessableContent: Operations.OrgsListOrgRoleTeams.Output.UnprocessableContent { get throws { switch self { case let .unprocessableContent(response): @@ -18176,271 +21943,187 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - } - /// Remove an organization role from a team - /// - /// Removes an organization role from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/delete(orgs/revoke-org-role-team)`. - public enum OrgsRevokeOrgRoleTeam { - public static let id: Swift.String = "orgs/revoke-org-role-team" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/DELETE/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/DELETE/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// The unique identifier of the role. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/DELETE/path/role_id`. - public var roleId: Components.Parameters.RoleId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - /// - roleId: The unique identifier of the role. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug, - roleId: Components.Parameters.RoleId - ) { - self.org = org - self.teamSlug = teamSlug - self.roleId = roleId - } - } - public var path: Operations.OrgsRevokeOrgRoleTeam.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.OrgsRevokeOrgRoleTeam.Input.Path) { - self.path = path - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/delete(orgs/revoke-org-role-team)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsRevokeOrgRoleTeam.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/teams/{team_slug}/{role_id}/delete(orgs/revoke-org-role-team)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsRevokeOrgRoleTeam.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) } } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// Remove all organization roles for a user - /// - /// Revokes all assigned organization roles from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. - /// - /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/users/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/delete(orgs/revoke-all-org-roles-user)`. - public enum OrgsRevokeAllOrgRolesUser { - public static let id: Swift.String = "orgs/revoke-all-org-roles-user" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/DELETE/path/org`. - public var org: Components.Parameters.Org - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/DELETE/path/username`. - public var username: Components.Parameters.Username - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. - public init( - org: Components.Parameters.Org, - username: Components.Parameters.Username - ) { - self.org = org - self.username = username + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" } } - public var path: Operations.OrgsRevokeAllOrgRolesUser.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.OrgsRevokeAllOrgRolesUser.Input.Path) { - self.path = path - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/delete(orgs/revoke-all-org-roles-user)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsRevokeAllOrgRolesUser.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/delete(orgs/revoke-all-org-roles-user)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsRevokeAllOrgRolesUser.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } + public static var allCases: [Self] { + [ + .json + ] } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// Assign an organization role to a user + /// List users that are assigned to an organization role /// - /// Assigns an organization role to a member of an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// Lists organization members that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." /// - /// The authenticated user must be an administrator for the organization to use this endpoint. + /// To use this endpoint, you must be an administrator for the organization. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/organization-roles/users/{username}/{role_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)`. - public enum OrgsAssignUserToOrgRole { - public static let id: Swift.String = "orgs/assign-user-to-org-role" + /// - Remark: HTTP `GET /orgs/{org}/organization-roles/{role_id}/users`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/users/get(orgs/list-org-role-users)`. + public enum OrgsListOrgRoleUsers { + public static let id: Swift.String = "orgs/list-org-role-users" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/path/org`. public var org: Components.Parameters.Org - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/PUT/path/username`. - public var username: Components.Parameters.Username /// The unique identifier of the role. /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/PUT/path/role_id`. + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/path/role_id`. public var roleId: Components.Parameters.RoleId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. /// - roleId: The unique identifier of the role. public init( org: Components.Parameters.Org, - username: Components.Parameters.Username, roleId: Components.Parameters.RoleId ) { self.org = org - self.username = username self.roleId = roleId } } - public var path: Operations.OrgsAssignUserToOrgRole.Input.Path + public var path: Operations.OrgsListOrgRoleUsers.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.OrgsListOrgRoleUsers.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsListOrgRoleUsers.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.OrgsAssignUserToOrgRole.Input.Path) { + /// - query: + /// - headers: + public init( + path: Operations.OrgsListOrgRoleUsers.Input.Path, + query: Operations.OrgsListOrgRoleUsers.Input.Query = .init(), + headers: Operations.OrgsListOrgRoleUsers.Input.Headers = .init() + ) { self.path = path + self.query = query + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.OrgsListOrgRoleUsers.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/responses/200/content/application\/json`. + case json([Components.Schemas.UserRoleAssignment]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.UserRoleAssignment] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsListOrgRoleUsers.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.OrgsListOrgRoleUsers.Output.Ok.Headers = .init(), + body: Operations.OrgsListOrgRoleUsers.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsAssignUserToOrgRole.Output.NoContent) - /// Response + /// Response - List of assigned users /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/users/get(orgs/list-org-role-users)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsListOrgRoleUsers.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsAssignUserToOrgRole.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsListOrgRoleUsers.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } @@ -18450,15 +22133,15 @@ public enum Operations { /// Creates a new `NotFound`. public init() {} } - /// Response if the organization, user or role does not exist. + /// Response if the organization or role does not exist. /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/users/get(orgs/list-org-role-users)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.OrgsAssignUserToOrgRole.Output.NotFound) - /// Response if the organization, user or role does not exist. + case notFound(Operations.OrgsListOrgRoleUsers.Output.NotFound) + /// Response if the organization or role does not exist. /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/users/get(orgs/list-org-role-users)/responses/404`. /// /// HTTP response code: `404 notFound`. public static var notFound: Self { @@ -18468,7 +22151,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.OrgsAssignUserToOrgRole.Output.NotFound { + public var notFound: Operations.OrgsListOrgRoleUsers.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -18485,15 +22168,15 @@ public enum Operations { /// Creates a new `UnprocessableContent`. public init() {} } - /// Response if the organization roles feature is not enabled enabled for the organization, the validation failed, or the user is not an organization member. + /// Response if the organization roles feature is not enabled or validation failed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/users/get(orgs/list-org-role-users)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.OrgsAssignUserToOrgRole.Output.UnprocessableContent) - /// Response if the organization roles feature is not enabled enabled for the organization, the validation failed, or the user is not an organization member. + case unprocessableContent(Operations.OrgsListOrgRoleUsers.Output.UnprocessableContent) + /// Response if the organization roles feature is not enabled or validation failed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/put(orgs/assign-user-to-org-role)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/users/get(orgs/list-org-role-users)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. public static var unprocessableContent: Self { @@ -18503,7 +22186,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.unprocessableContent`. /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.OrgsAssignUserToOrgRole.Output.UnprocessableContent { + public var unprocessableContent: Operations.OrgsListOrgRoleUsers.Output.UnprocessableContent { get throws { switch self { case let .unprocessableContent(response): @@ -18521,90 +22204,187 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } - /// Remove an organization role from a user - /// - /// Remove an organization role from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." - /// - /// The authenticated user must be an administrator for the organization to use this endpoint. + /// List outside collaborators for an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// List all users who are outside collaborators of an organization. /// - /// - Remark: HTTP `DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/delete(orgs/revoke-org-role-user)`. - public enum OrgsRevokeOrgRoleUser { - public static let id: Swift.String = "orgs/revoke-org-role-user" + /// - Remark: HTTP `GET /orgs/{org}/outside_collaborators`. + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/get(orgs/list-outside-collaborators)`. + public enum OrgsListOutsideCollaborators { + public static let id: Swift.String = "orgs/list-outside-collaborators" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/path/org`. public var org: Components.Parameters.Org - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/DELETE/path/username`. - public var username: Components.Parameters.Username - /// The unique identifier of the role. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/users/{username}/{role_id}/DELETE/path/role_id`. - public var roleId: Components.Parameters.RoleId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. - /// - roleId: The unique identifier of the role. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsListOutsideCollaborators.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/query/filter`. + @frozen public enum FilterPayload: String, Codable, Hashable, Sendable, CaseIterable { + case _2faDisabled = "2fa_disabled" + case _2faInsecure = "2fa_insecure" + case all = "all" + } + /// Filter the list of outside collaborators. `2fa_disabled` means that only outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. `2fa_insecure` means that only outside collaborators with [insecure 2FA methods](https://docs.github.com/organizations/keeping-your-organization-secure/managing-two-factor-authentication-for-your-organization/requiring-two-factor-authentication-in-your-organization#requiring-secure-methods-of-two-factor-authentication-in-your-organization) will be returned. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/query/filter`. + public var filter: Operations.OrgsListOutsideCollaborators.Input.Query.FilterPayload? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - filter: Filter the list of outside collaborators. `2fa_disabled` means that only outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. `2fa_insecure` means that only outside collaborators with [insecure 2FA methods](https://docs.github.com/organizations/keeping-your-organization-secure/managing-two-factor-authentication-for-your-organization/requiring-two-factor-authentication-in-your-organization#requiring-secure-methods-of-two-factor-authentication-in-your-organization) will be returned. + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." public init( - org: Components.Parameters.Org, - username: Components.Parameters.Username, - roleId: Components.Parameters.RoleId + filter: Operations.OrgsListOutsideCollaborators.Input.Query.FilterPayload? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil ) { - self.org = org - self.username = username - self.roleId = roleId + self.filter = filter + self.perPage = perPage + self.page = page } } - public var path: Operations.OrgsRevokeOrgRoleUser.Input.Path + public var query: Operations.OrgsListOutsideCollaborators.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsListOutsideCollaborators.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.OrgsRevokeOrgRoleUser.Input.Path) { + /// - query: + /// - headers: + public init( + path: Operations.OrgsListOutsideCollaborators.Input.Path, + query: Operations.OrgsListOutsideCollaborators.Input.Query = .init(), + headers: Operations.OrgsListOutsideCollaborators.Input.Headers = .init() + ) { self.path = path + self.query = query + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.OrgsListOutsideCollaborators.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.SimpleUser] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsListOutsideCollaborators.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.OrgsListOutsideCollaborators.Output.Ok.Headers = .init(), + body: Operations.OrgsListOutsideCollaborators.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/delete(orgs/revoke-org-role-user)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsRevokeOrgRoleUser.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/users/{username}/{role_id}/delete(orgs/revoke-org-role-user)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/get(orgs/list-outside-collaborators)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsListOutsideCollaborators.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsRevokeOrgRoleUser.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsListOutsideCollaborators.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } @@ -18615,83 +22395,135 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } - /// Get an organization role - /// - /// Gets an organization role that is available to this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." - /// - /// To use this endpoint, the authenticated user must be one of: - /// - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. + /// Convert an organization member to outside collaborator /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." /// - /// - Remark: HTTP `GET /orgs/{org}/organization-roles/{role_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/get(orgs/get-org-role)`. - public enum OrgsGetOrgRole { - public static let id: Swift.String = "orgs/get-org-role" + /// - Remark: HTTP `PUT /orgs/{org}/outside_collaborators/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)`. + public enum OrgsConvertMemberToOutsideCollaborator { + public static let id: Swift.String = "orgs/convert-member-to-outside-collaborator" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the role. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/GET/path/role_id`. - public var roleId: Components.Parameters.RoleId + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - roleId: The unique identifier of the role. + /// - username: The handle for the GitHub user account. public init( org: Components.Parameters.Org, - roleId: Components.Parameters.RoleId + username: Components.Parameters.Username ) { self.org = org - self.roleId = roleId + self.username = username } } - public var path: Operations.OrgsGetOrgRole.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/GET/header`. + public var path: Operations.OrgsConvertMemberToOutsideCollaborator.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsGetOrgRole.Input.Headers + public var headers: Operations.OrgsConvertMemberToOutsideCollaborator.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// When set to `true`, the request will be performed asynchronously. Returns a 202 status code when the job is successfully queued. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/requestBody/json/async`. + public var async: Swift.Bool? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - async: When set to `true`, the request will be performed asynchronously. Returns a 202 status code when the job is successfully queued. + public init(async: Swift.Bool? = nil) { + self.async = async + } + public enum CodingKeys: String, CodingKey { + case async + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/requestBody/content/application\/json`. + case json(Operations.OrgsConvertMemberToOutsideCollaborator.Input.Body.JsonPayload) + } + public var body: Operations.OrgsConvertMemberToOutsideCollaborator.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.OrgsGetOrgRole.Input.Path, - headers: Operations.OrgsGetOrgRole.Input.Headers = .init() + path: Operations.OrgsConvertMemberToOutsideCollaborator.Input.Path, + headers: Operations.OrgsConvertMemberToOutsideCollaborator.Input.Headers = .init(), + body: Operations.OrgsConvertMemberToOutsideCollaborator.Input.Body? = nil ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/GET/responses/200/content`. + public struct Accepted: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/responses/202/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.OrganizationRole) + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/responses/202/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Creates a new `JsonPayload`. + public init() {} + public init(from decoder: any Decoder) throws { + try decoder.ensureNoAdditionalProperties(knownKeys: []) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/responses/202/content/application\/json`. + case json(Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.OrganizationRole { + public var json: Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -18701,79 +22533,126 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsGetOrgRole.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted.Body + /// Creates a new `Accepted`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsGetOrgRole.Output.Ok.Body) { + public init(body: Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted.Body) { self.body = body } } - /// Response + /// User is getting converted asynchronously + /// + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)/responses/202`. + /// + /// HTTP response code: `202 accepted`. + case accepted(Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted) + /// The associated value of the enum case if `self` is `.accepted`. + /// + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted { + get throws { + switch self { + case let .accepted(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "accepted", + response: self + ) + } + } + } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// User was converted /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/get(orgs/get-org-role)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetOrgRole.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsConvertMemberToOutsideCollaborator.Output.NoContent) + /// User was converted /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsGetOrgRole.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsConvertMemberToOutsideCollaborator.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } } } - /// Resource not found + public struct Forbidden: Sendable, Hashable { + /// Creates a new `Forbidden`. + public init() {} + } + /// Forbidden if user is the last owner of the organization, not a member of the organization, or if the enterprise enforces a policy for inviting outside collaborators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/get(orgs/get-org-role)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)/responses/403`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.OrgsConvertMemberToOutsideCollaborator.Output.Forbidden) + /// Forbidden if user is the last owner of the organization, not a member of the organization, or if the enterprise enforces a policy for inviting outside collaborators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + public static var forbidden: Self { + .forbidden(.init()) + } + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.OrgsConvertMemberToOutsideCollaborator.Output.Forbidden { get throws { switch self { - case let .notFound(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "forbidden", response: self ) } } } - /// Validation failed, or the endpoint has been spammed. + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/get(orgs/get-org-role)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)/responses/404`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unprocessableContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "notFound", response: self ) } @@ -18810,224 +22689,162 @@ public enum Operations { } } } - /// List teams that are assigned to an organization role - /// - /// Lists the teams that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." - /// - /// To use this endpoint, you must be an administrator for the organization. + /// Remove outside collaborator from an organization /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Removing a user from this list will remove them from all the organization's repositories. /// - /// - Remark: HTTP `GET /orgs/{org}/organization-roles/{role_id}/teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/teams/get(orgs/list-org-role-teams)`. - public enum OrgsListOrgRoleTeams { - public static let id: Swift.String = "orgs/list-org-role-teams" + /// - Remark: HTTP `DELETE /orgs/{org}/outside_collaborators/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/delete(orgs/remove-outside-collaborator)`. + public enum OrgsRemoveOutsideCollaborator { + public static let id: Swift.String = "orgs/remove-outside-collaborator" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the role. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/path/role_id`. - public var roleId: Components.Parameters.RoleId + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - roleId: The unique identifier of the role. + /// - username: The handle for the GitHub user account. public init( org: Components.Parameters.Org, - roleId: Components.Parameters.RoleId + username: Components.Parameters.Username ) { self.org = org - self.roleId = roleId - } - } - public var path: Operations.OrgsListOrgRoleTeams.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page + self.username = username } } - public var query: Operations.OrgsListOrgRoleTeams.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/header`. + public var path: Operations.OrgsRemoveOutsideCollaborator.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListOrgRoleTeams.Input.Headers + public var headers: Operations.OrgsRemoveOutsideCollaborator.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.OrgsListOrgRoleTeams.Input.Path, - query: Operations.OrgsListOrgRoleTeams.Input.Query = .init(), - headers: Operations.OrgsListOrgRoleTeams.Input.Headers = .init() + path: Operations.OrgsRemoveOutsideCollaborator.Input.Path, + headers: Operations.OrgsRemoveOutsideCollaborator.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsListOrgRoleTeams.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/teams/GET/responses/200/content/application\/json`. - case json([Components.Schemas.TeamRoleAssignment]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.TeamRoleAssignment] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OrgsListOrgRoleTeams.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.OrgsListOrgRoleTeams.Output.Ok.Headers = .init(), - body: Operations.OrgsListOrgRoleTeams.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - List of assigned teams - /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/teams/get(orgs/list-org-role-teams)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListOrgRoleTeams.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListOrgRoleTeams.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. public init() {} } - /// Response if the organization or role does not exist. + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/teams/get(orgs/list-org-role-teams)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/delete(orgs/remove-outside-collaborator)/responses/204`. /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.OrgsListOrgRoleTeams.Output.NotFound) - /// Response if the organization or role does not exist. + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsRemoveOutsideCollaborator.Output.NoContent) + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/teams/get(orgs/list-org-role-teams)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/delete(orgs/remove-outside-collaborator)/responses/204`. /// - /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) } - /// The associated value of the enum case if `self` is `.notFound`. + /// The associated value of the enum case if `self` is `.noContent`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.OrgsListOrgRoleTeams.Output.NotFound { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsRemoveOutsideCollaborator.Output.NoContent { get throws { switch self { - case let .notFound(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "noContent", response: self ) } } } public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/responses/422/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/responses/422/content/json/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/responses/422/content/json/documentation_url`. + public var documentationUrl: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/responses/422/content/application\/json`. + case json(Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent.Body /// Creates a new `UnprocessableContent`. - public init() {} + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent.Body) { + self.body = body + } } - /// Response if the organization roles feature is not enabled or validation failed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/teams/get(orgs/list-org-role-teams)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.OrgsListOrgRoleTeams.Output.UnprocessableContent) - /// Response if the organization roles feature is not enabled or validation failed. + /// Unprocessable Entity if user is a member of the organization /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/teams/get(orgs/list-org-role-teams)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/delete(orgs/remove-outside-collaborator)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - public static var unprocessableContent: Self { - .unprocessableContent(.init()) - } + case unprocessableContent(Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent) /// The associated value of the enum case if `self` is `.unprocessableContent`. /// /// - Throws: An error if `self` is not `.unprocessableContent`. /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.OrgsListOrgRoleTeams.Output.UnprocessableContent { + public var unprocessableContent: Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent { get throws { switch self { case let .unprocessableContent(response): @@ -19071,100 +22888,246 @@ public enum Operations { } } } - /// List users that are assigned to an organization role - /// - /// Lists organization members that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)." + /// List requests to access organization resources with fine-grained personal access tokens /// - /// To use this endpoint, you must be an administrator for the organization. + /// Lists requests from organization members to access organization resources with a fine-grained personal access token. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Only GitHub Apps can use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/organization-roles/{role_id}/users`. - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/users/get(orgs/list-org-role-users)`. - public enum OrgsListOrgRoleUsers { - public static let id: Swift.String = "orgs/list-org-role-users" + /// - Remark: HTTP `GET /orgs/{org}/personal-access-token-requests`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/get(orgs/list-pat-grant-requests)`. + public enum OrgsListPatGrantRequests { + public static let id: Swift.String = "orgs/list-pat-grant-requests" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the role. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/path/role_id`. - public var roleId: Components.Parameters.RoleId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - roleId: The unique identifier of the role. - public init( - org: Components.Parameters.Org, - roleId: Components.Parameters.RoleId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.roleId = roleId } } - public var path: Operations.OrgsListOrgRoleUsers.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/query`. + public var path: Operations.OrgsListPatGrantRequests.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query`. public struct Query: Sendable, Hashable { /// The number of results per page (max 100). 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/page`. public var page: Components.Parameters.Page? + /// - Remark: Generated from `#/components/parameters/personal-access-token-sort`. + @frozen public enum PersonalAccessTokenSort: String, Codable, Hashable, Sendable, CaseIterable { + case createdAt = "created_at" + } + /// The property by which to sort the results. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/sort`. + public var sort: Components.Parameters.PersonalAccessTokenSort? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/direction`. + public var direction: Components.Parameters.Direction? + /// A list of owner usernames to use to filter the results. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/owner`. + public var owner: Components.Parameters.PersonalAccessTokenOwner? + /// The name of the repository to use to filter the results. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/repository`. + public var repository: Components.Parameters.PersonalAccessTokenRepository? + /// The permission to use to filter the results. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/permission`. + public var permission: Components.Parameters.PersonalAccessTokenPermission? + /// Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/last_used_before`. + public var lastUsedBefore: Components.Parameters.PersonalAccessTokenBefore? + /// Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/last_used_after`. + public var lastUsedAfter: Components.Parameters.PersonalAccessTokenAfter? + /// The ID of the token + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/token_id`. + public var tokenId: Components.Parameters.PersonalAccessTokenTokenId? /// Creates a new `Query`. /// /// - Parameters: /// - perPage: The number of results per page (max 100). 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)." /// - page: The page number of the results to fetch. 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)." + /// - sort: The property by which to sort the results. + /// - direction: The direction to sort the results by. + /// - owner: A list of owner usernames to use to filter the results. + /// - repository: The name of the repository to use to filter the results. + /// - permission: The permission to use to filter the results. + /// - lastUsedBefore: Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - lastUsedAfter: Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - tokenId: The ID of the token public init( perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + page: Components.Parameters.Page? = nil, + sort: Components.Parameters.PersonalAccessTokenSort? = nil, + direction: Components.Parameters.Direction? = nil, + owner: Components.Parameters.PersonalAccessTokenOwner? = nil, + repository: Components.Parameters.PersonalAccessTokenRepository? = nil, + permission: Components.Parameters.PersonalAccessTokenPermission? = nil, + lastUsedBefore: Components.Parameters.PersonalAccessTokenBefore? = nil, + lastUsedAfter: Components.Parameters.PersonalAccessTokenAfter? = nil, + tokenId: Components.Parameters.PersonalAccessTokenTokenId? = nil ) { self.perPage = perPage self.page = page + self.sort = sort + self.direction = direction + self.owner = owner + self.repository = repository + self.permission = permission + self.lastUsedBefore = lastUsedBefore + self.lastUsedAfter = lastUsedAfter + self.tokenId = tokenId + } + } + public var query: Operations.OrgsListPatGrantRequests.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsListPatGrantRequests.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.OrgsListPatGrantRequests.Input.Path, + query: Operations.OrgsListPatGrantRequests.Input.Query = .init(), + headers: Operations.OrgsListPatGrantRequests.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/get(orgs/list-pat-grant-requests)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/get(orgs/list-pat-grant-requests)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } } } - public var query: Operations.OrgsListOrgRoleUsers.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/get(orgs/list-pat-grant-requests)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } } } - public var headers: Operations.OrgsListOrgRoleUsers.Input.Headers - /// Creates a new `Input`. + /// Forbidden /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.OrgsListOrgRoleUsers.Input.Path, - query: Operations.OrgsListOrgRoleUsers.Input.Query = .init(), - headers: Operations.OrgsListOrgRoleUsers.Input.Headers = .init() - ) { - self.path = path - self.query = query - self.headers = headers + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/get(orgs/list-pat-grant-requests)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } } - } - @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -19175,16 +23138,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.OrgsListOrgRoleUsers.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/responses/200/content`. + public var headers: Operations.OrgsListPatGrantRequests.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/organization-roles/{role_id}/users/GET/responses/200/content/application\/json`. - case json([Components.Schemas.UserRoleAssignment]) + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/responses/200/content/application\/json`. + case json([Components.Schemas.OrganizationProgrammaticAccessGrantRequest]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.UserRoleAssignment] { + public var json: [Components.Schemas.OrganizationProgrammaticAccessGrantRequest] { get throws { switch self { case let .json(body): @@ -19194,31 +23157,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListOrgRoleUsers.Output.Ok.Body + public var body: Operations.OrgsListPatGrantRequests.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.OrgsListOrgRoleUsers.Output.Ok.Headers = .init(), - body: Operations.OrgsListOrgRoleUsers.Output.Ok.Body + headers: Operations.OrgsListPatGrantRequests.Output.Ok.Headers = .init(), + body: Operations.OrgsListPatGrantRequests.Output.Ok.Body ) { self.headers = headers self.body = body } } - /// Response - List of assigned users + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/users/get(orgs/list-org-role-users)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/get(orgs/list-pat-grant-requests)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListOrgRoleUsers.Output.Ok) + case ok(Operations.OrgsListPatGrantRequests.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListOrgRoleUsers.Output.Ok { + public var ok: Operations.OrgsListPatGrantRequests.Output.Ok { get throws { switch self { case let .ok(response): @@ -19231,76 +23194,6 @@ public enum Operations { } } } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. - public init() {} - } - /// Response if the organization or role does not exist. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/users/get(orgs/list-org-role-users)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.OrgsListOrgRoleUsers.Output.NotFound) - /// Response if the organization or role does not exist. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/users/get(orgs/list-org-role-users)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) - } - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.OrgsListOrgRoleUsers.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. - public init() {} - } - /// Response if the organization roles feature is not enabled or validation failed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/users/get(orgs/list-org-role-users)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.OrgsListOrgRoleUsers.Output.UnprocessableContent) - /// Response if the organization roles feature is not enabled or validation failed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/organization-roles/{role_id}/users/get(orgs/list-org-role-users)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - public static var unprocessableContent: Self { - .unprocessableContent(.init()) - } - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.OrgsListOrgRoleUsers.Output.UnprocessableContent { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -19332,20 +23225,22 @@ public enum Operations { } } } - /// List outside collaborators for an organization + /// Review requests to access organization resources with fine-grained personal access tokens /// - /// List all users who are outside collaborators of an organization. + /// Approves or denies multiple pending requests to access organization resources via a fine-grained personal access token. /// - /// - Remark: HTTP `GET /orgs/{org}/outside_collaborators`. - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/get(orgs/list-outside-collaborators)`. - public enum OrgsListOutsideCollaborators { - public static let id: Swift.String = "orgs/list-outside-collaborators" + /// Only GitHub Apps can use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/personal-access-token-requests`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/post(orgs/review-pat-grant-requests-in-bulk)`. + public enum OrgsReviewPatGrantRequestsInBulk { + public static let id: Swift.String = "orgs/review-pat-grant-requests-in-bulk" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -19355,138 +23250,194 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsListOutsideCollaborators.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/query/filter`. - @frozen public enum FilterPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _2faDisabled = "2fa_disabled" - case _2faInsecure = "2fa_insecure" - case all = "all" - } - /// Filter the list of outside collaborators. `2fa_disabled` means that only outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. `2fa_insecure` means that only outside collaborators with [insecure 2FA methods](https://docs.github.com/organizations/keeping-your-organization-secure/managing-two-factor-authentication-for-your-organization/requiring-two-factor-authentication-in-your-organization#requiring-secure-methods-of-two-factor-authentication-in-your-organization) will be returned. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/query/filter`. - public var filter: Operations.OrgsListOutsideCollaborators.Input.Query.FilterPayload? - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - filter: Filter the list of outside collaborators. `2fa_disabled` means that only outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. `2fa_insecure` means that only outside collaborators with [insecure 2FA methods](https://docs.github.com/organizations/keeping-your-organization-secure/managing-two-factor-authentication-for-your-organization/requiring-two-factor-authentication-in-your-organization#requiring-secure-methods-of-two-factor-authentication-in-your-organization) will be returned. - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." - public init( - filter: Operations.OrgsListOutsideCollaborators.Input.Query.FilterPayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.filter = filter - self.perPage = perPage - self.page = page - } - } - public var query: Operations.OrgsListOutsideCollaborators.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/header`. + public var path: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListOutsideCollaborators.Input.Headers + public var headers: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Unique identifiers of the requests for access via fine-grained personal access token. Must be formed of between 1 and 100 `pat_request_id` values. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/requestBody/json/pat_request_ids`. + public var patRequestIds: [Swift.Int]? + /// Action to apply to the requests. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/requestBody/json/action`. + @frozen public enum ActionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case approve = "approve" + case deny = "deny" + } + /// Action to apply to the requests. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/requestBody/json/action`. + public var action: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Body.JsonPayload.ActionPayload + /// Reason for approving or denying the requests. Max 1024 characters. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/requestBody/json/reason`. + public var reason: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - patRequestIds: Unique identifiers of the requests for access via fine-grained personal access token. Must be formed of between 1 and 100 `pat_request_id` values. + /// - action: Action to apply to the requests. + /// - reason: Reason for approving or denying the requests. Max 1024 characters. + public init( + patRequestIds: [Swift.Int]? = nil, + action: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Body.JsonPayload.ActionPayload, + reason: Swift.String? = nil + ) { + self.patRequestIds = patRequestIds + self.action = action + self.reason = reason + } + public enum CodingKeys: String, CodingKey { + case patRequestIds = "pat_request_ids" + case action + case reason + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/requestBody/content/application\/json`. + case json(Operations.OrgsReviewPatGrantRequestsInBulk.Input.Body.JsonPayload) + } + public var body: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.OrgsListOutsideCollaborators.Input.Path, - query: Operations.OrgsListOutsideCollaborators.Input.Query = .init(), - headers: Operations.OrgsListOutsideCollaborators.Input.Headers = .init() + path: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Path, + headers: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Headers = .init(), + body: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/post(orgs/review-pat-grant-requests-in-bulk)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) } } - /// Received HTTP response headers - public var headers: Operations.OrgsListOutsideCollaborators.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/GET/responses/200/content/application\/json`. - case json([Components.Schemas.SimpleUser]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.SimpleUser] { - get throws { - switch self { - case let .json(body): - return body - } - } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/post(orgs/review-pat-grant-requests-in-bulk)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.OrgsListOutsideCollaborators.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.OrgsListOutsideCollaborators.Output.Ok.Headers = .init(), - body: Operations.OrgsListOutsideCollaborators.Output.Ok.Body - ) { - self.headers = headers - self.body = body + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/post(orgs/review-pat-grant-requests-in-bulk)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } } } - /// Response + /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/get(orgs/list-outside-collaborators)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/post(orgs/review-pat-grant-requests-in-bulk)/responses/403`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListOutsideCollaborators.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListOutsideCollaborators.Output.Ok { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .ok(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Accepted + /// + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/post(orgs/review-pat-grant-requests-in-bulk)/responses/202`. + /// + /// HTTP response code: `202 accepted`. + case accepted(Components.Responses.Accepted) + /// The associated value of the enum case if `self` is `.accepted`. + /// + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Components.Responses.Accepted { + get throws { + switch self { + case let .accepted(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "accepted", response: self ) } @@ -19523,74 +23474,93 @@ public enum Operations { } } } - /// Convert an organization member to outside collaborator + /// Review a request to access organization resources with a fine-grained personal access token /// - /// When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." + /// Approves or denies a pending request to access organization resources via a fine-grained personal access token. /// - /// - Remark: HTTP `PUT /orgs/{org}/outside_collaborators/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)`. - public enum OrgsConvertMemberToOutsideCollaborator { - public static let id: Swift.String = "orgs/convert-member-to-outside-collaborator" + /// Only GitHub Apps can use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/personal-access-token-requests/{pat_request_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)`. + public enum OrgsReviewPatGrantRequest { + public static let id: Swift.String = "orgs/review-pat-grant-request" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/path/org`. public var org: Components.Parameters.Org - /// The handle for the GitHub user account. + /// Unique identifier of the request for access via fine-grained personal access token. /// - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/path/username`. - public var username: Components.Parameters.Username + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/path/pat_request_id`. + public var patRequestId: Swift.Int /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. + /// - patRequestId: Unique identifier of the request for access via fine-grained personal access token. public init( org: Components.Parameters.Org, - username: Components.Parameters.Username + patRequestId: Swift.Int ) { self.org = org - self.username = username + self.patRequestId = patRequestId } } - public var path: Operations.OrgsConvertMemberToOutsideCollaborator.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/header`. + public var path: Operations.OrgsReviewPatGrantRequest.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsConvertMemberToOutsideCollaborator.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/requestBody`. + public var headers: Operations.OrgsReviewPatGrantRequest.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// When set to `true`, the request will be performed asynchronously. Returns a 202 status code when the job is successfully queued. + /// Action to apply to the request. /// - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/requestBody/json/async`. - public var async: Swift.Bool? + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/requestBody/json/action`. + @frozen public enum ActionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case approve = "approve" + case deny = "deny" + } + /// Action to apply to the request. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/requestBody/json/action`. + public var action: Operations.OrgsReviewPatGrantRequest.Input.Body.JsonPayload.ActionPayload + /// Reason for approving or denying the request. Max 1024 characters. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/requestBody/json/reason`. + public var reason: Swift.String? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - async: When set to `true`, the request will be performed asynchronously. Returns a 202 status code when the job is successfully queued. - public init(async: Swift.Bool? = nil) { - self.async = async + /// - action: Action to apply to the request. + /// - reason: Reason for approving or denying the request. Max 1024 characters. + public init( + action: Operations.OrgsReviewPatGrantRequest.Input.Body.JsonPayload.ActionPayload, + reason: Swift.String? = nil + ) { + self.action = action + self.reason = reason } public enum CodingKeys: String, CodingKey { - case async + case action + case reason } } - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/requestBody/content/application\/json`. - case json(Operations.OrgsConvertMemberToOutsideCollaborator.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/requestBody/content/application\/json`. + case json(Operations.OrgsReviewPatGrantRequest.Input.Body.JsonPayload) } - public var body: Operations.OrgsConvertMemberToOutsideCollaborator.Input.Body? + public var body: Operations.OrgsReviewPatGrantRequest.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -19598,9 +23568,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.OrgsConvertMemberToOutsideCollaborator.Input.Path, - headers: Operations.OrgsConvertMemberToOutsideCollaborator.Input.Headers = .init(), - body: Operations.OrgsConvertMemberToOutsideCollaborator.Input.Body? = nil + path: Operations.OrgsReviewPatGrantRequest.Input.Path, + headers: Operations.OrgsReviewPatGrantRequest.Input.Headers = .init(), + body: Operations.OrgsReviewPatGrantRequest.Input.Body ) { self.path = path self.headers = headers @@ -19608,123 +23578,86 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct Accepted: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/responses/202/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/responses/202/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Creates a new `JsonPayload`. - public init() {} - public init(from decoder: any Decoder) throws { - try decoder.ensureNoAdditionalProperties(knownKeys: []) - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/PUT/responses/202/content/application\/json`. - case json(Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted.Body - /// Creates a new `Accepted`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted.Body) { - self.body = body - } } - /// User is getting converted asynchronously + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)/responses/202`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)/responses/422`. /// - /// HTTP response code: `202 accepted`. - case accepted(Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted) - /// The associated value of the enum case if `self` is `.accepted`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.accepted`. - /// - SeeAlso: `.accepted`. - public var accepted: Operations.OrgsConvertMemberToOutsideCollaborator.Output.Accepted { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .accepted(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "accepted", + expectedStatus: "unprocessableContent", response: self ) } } } - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// User was converted - /// - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsConvertMemberToOutsideCollaborator.Output.NoContent) - /// User was converted + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)/responses/404`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsConvertMemberToOutsideCollaborator.Output.NoContent { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .noContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "notFound", response: self ) } } } - public struct Forbidden: Sendable, Hashable { - /// Creates a new `Forbidden`. - public init() {} - } - /// Forbidden if user is the last owner of the organization, not a member of the organization, or if the enterprise enforces a policy for inviting outside collaborators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." - /// - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.OrgsConvertMemberToOutsideCollaborator.Output.Forbidden) - /// Forbidden if user is the last owner of the organization, not a member of the organization, or if the enterprise enforces a policy for inviting outside collaborators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." + /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)/responses/403`. /// /// HTTP response code: `403 forbidden`. - public static var forbidden: Self { - .forbidden(.init()) - } + case forbidden(Components.Responses.Forbidden) /// The associated value of the enum case if `self` is `.forbidden`. /// /// - Throws: An error if `self` is not `.forbidden`. /// - SeeAlso: `.forbidden`. - public var forbidden: Operations.OrgsConvertMemberToOutsideCollaborator.Output.Forbidden { + public var forbidden: Components.Responses.Forbidden { get throws { switch self { case let .forbidden(response): @@ -19737,24 +23670,32 @@ public enum Operations { } } } - /// Resource not found + /// A header with no content is returned. /// - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/put(orgs/convert-member-to-outside-collaborator)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)/responses/204`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `204 noContent`. + case noContent(Components.Responses.NoContent) + /// A header with no content is returned. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Components.Responses.NoContent { get throws { switch self { - case let .notFound(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "noContent", response: self ) } @@ -19791,133 +23732,187 @@ public enum Operations { } } } - /// Remove outside collaborator from an organization + /// List repositories requested to be accessed by a fine-grained personal access token /// - /// Removing a user from this list will remove them from all the organization's repositories. + /// Lists the repositories a fine-grained personal access token request is requesting access to. /// - /// - Remark: HTTP `DELETE /orgs/{org}/outside_collaborators/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/delete(orgs/remove-outside-collaborator)`. - public enum OrgsRemoveOutsideCollaborator { - public static let id: Swift.String = "orgs/remove-outside-collaborator" + /// Only GitHub Apps can use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/get(orgs/list-pat-grant-request-repositories)`. + public enum OrgsListPatGrantRequestRepositories { + public static let id: Swift.String = "orgs/list-pat-grant-request-repositories" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/path/org`. public var org: Components.Parameters.Org - /// The handle for the GitHub user account. + /// Unique identifier of the request for access via fine-grained personal access token. /// - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/path/username`. - public var username: Components.Parameters.Username + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/path/pat_request_id`. + public var patRequestId: Swift.Int /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. + /// - patRequestId: Unique identifier of the request for access via fine-grained personal access token. public init( org: Components.Parameters.Org, - username: Components.Parameters.Username + patRequestId: Swift.Int ) { self.org = org - self.username = username + self.patRequestId = patRequestId } } - public var path: Operations.OrgsRemoveOutsideCollaborator.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/header`. + public var path: Operations.OrgsListPatGrantRequestRepositories.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.OrgsListPatGrantRequestRepositories.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsRemoveOutsideCollaborator.Input.Headers + public var headers: Operations.OrgsListPatGrantRequestRepositories.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.OrgsRemoveOutsideCollaborator.Input.Path, - headers: Operations.OrgsRemoveOutsideCollaborator.Input.Headers = .init() + path: Operations.OrgsListPatGrantRequestRepositories.Input.Path, + query: Operations.OrgsListPatGrantRequestRepositories.Input.Query = .init(), + headers: Operations.OrgsListPatGrantRequestRepositories.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/get(orgs/list-pat-grant-request-repositories)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/delete(orgs/remove-outside-collaborator)/responses/204`. + /// Resource not found /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsRemoveOutsideCollaborator.Output.NoContent) - /// Response + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/get(orgs/list-pat-grant-request-repositories)/responses/404`. /// - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/delete(orgs/remove-outside-collaborator)/responses/204`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } } - /// The associated value of the enum case if `self` is `.noContent`. + /// Forbidden /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsRemoveOutsideCollaborator.Output.NoContent { + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/get(orgs/list-pat-grant-request-repositories)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .noContent(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "forbidden", response: self ) } } } - public struct UnprocessableContent: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/responses/422/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/responses/422/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/responses/422/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/responses/422/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - message: - /// - documentationUrl: - public init( - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil - ) { - self.message = message - self.documentationUrl = documentationUrl - } - public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - } + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link } - /// - Remark: Generated from `#/paths/orgs/{org}/outside_collaborators/{username}/DELETE/responses/422/content/application\/json`. - case json(Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent.Body.JsonPayload) + } + /// Received HTTP response headers + public var headers: Operations.OrgsListPatGrantRequestRepositories.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/responses/200/content/application\/json`. + case json([Components.Schemas.MinimalRepository]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent.Body.JsonPayload { + public var json: [Components.Schemas.MinimalRepository] { get throws { switch self { case let .json(body): @@ -19927,33 +23922,38 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent.Body - /// Creates a new `UnprocessableContent`. + public var body: Operations.OrgsListPatGrantRequestRepositories.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent.Body) { + public init( + headers: Operations.OrgsListPatGrantRequestRepositories.Output.Ok.Headers = .init(), + body: Operations.OrgsListPatGrantRequestRepositories.Output.Ok.Body + ) { + self.headers = headers self.body = body } } - /// Unprocessable Entity if user is a member of the organization + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/outside_collaborators/{username}/delete(orgs/remove-outside-collaborator)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/get(orgs/list-pat-grant-request-repositories)/responses/200`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsListPatGrantRequestRepositories.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.OrgsRemoveOutsideCollaborator.Output.UnprocessableContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsListPatGrantRequestRepositories.Output.Ok { get throws { switch self { - case let .unprocessableContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "ok", response: self ) } @@ -19990,22 +23990,22 @@ public enum Operations { } } } - /// List requests to access organization resources with fine-grained personal access tokens + /// List fine-grained personal access tokens with access to organization resources /// - /// Lists requests from organization members to access organization resources with a fine-grained personal access token. + /// Lists approved fine-grained personal access tokens owned by organization members that can access organization resources. /// /// Only GitHub Apps can use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/personal-access-token-requests`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/get(orgs/list-pat-grant-requests)`. - public enum OrgsListPatGrantRequests { - public static let id: Swift.String = "orgs/list-pat-grant-requests" + /// - Remark: HTTP `GET /orgs/{org}/personal-access-tokens`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/get(orgs/list-pat-grants)`. + public enum OrgsListPatGrants { + public static let id: Swift.String = "orgs/list-pat-grants" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -20015,16 +24015,16 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsListPatGrantRequests.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query`. + public var path: Operations.OrgsListPatGrants.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query`. public struct Query: Sendable, Hashable { /// The number of results per page (max 100). 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/page`. public var page: Components.Parameters.Page? /// - Remark: Generated from `#/components/parameters/personal-access-token-sort`. @frozen public enum PersonalAccessTokenSort: String, Codable, Hashable, Sendable, CaseIterable { @@ -20032,7 +24032,7 @@ public enum Operations { } /// The property by which to sort the results. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/sort`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/sort`. public var sort: Components.Parameters.PersonalAccessTokenSort? /// - Remark: Generated from `#/components/parameters/direction`. @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { @@ -20041,31 +24041,31 @@ public enum Operations { } /// The direction to sort the results by. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/direction`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/direction`. public var direction: Components.Parameters.Direction? /// A list of owner usernames to use to filter the results. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/owner`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/owner`. public var owner: Components.Parameters.PersonalAccessTokenOwner? /// The name of the repository to use to filter the results. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/repository`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/repository`. public var repository: Components.Parameters.PersonalAccessTokenRepository? /// The permission to use to filter the results. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/permission`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/permission`. public var permission: Components.Parameters.PersonalAccessTokenPermission? /// Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/last_used_before`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/last_used_before`. public var lastUsedBefore: Components.Parameters.PersonalAccessTokenBefore? /// Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/last_used_after`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/last_used_after`. public var lastUsedAfter: Components.Parameters.PersonalAccessTokenAfter? /// The ID of the token /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/query/token_id`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/token_id`. public var tokenId: Components.Parameters.PersonalAccessTokenTokenId? /// Creates a new `Query`. /// @@ -20104,19 +24104,19 @@ public enum Operations { self.tokenId = tokenId } } - public var query: Operations.OrgsListPatGrantRequests.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/header`. + public var query: Operations.OrgsListPatGrants.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListPatGrantRequests.Input.Headers + public var headers: Operations.OrgsListPatGrants.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -20124,9 +24124,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.OrgsListPatGrantRequests.Input.Path, - query: Operations.OrgsListPatGrantRequests.Input.Query = .init(), - headers: Operations.OrgsListPatGrantRequests.Input.Headers = .init() + path: Operations.OrgsListPatGrants.Input.Path, + query: Operations.OrgsListPatGrants.Input.Query = .init(), + headers: Operations.OrgsListPatGrants.Input.Headers = .init() ) { self.path = path self.query = query @@ -20136,7 +24136,7 @@ public enum Operations { @frozen public enum Output: Sendable, Hashable { /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/get(orgs/list-pat-grant-requests)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/get(orgs/list-pat-grants)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -20159,7 +24159,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/get(orgs/list-pat-grant-requests)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/get(orgs/list-pat-grants)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -20182,7 +24182,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/get(orgs/list-pat-grant-requests)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/get(orgs/list-pat-grants)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -20205,7 +24205,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/get(orgs/list-pat-grant-requests)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/get(orgs/list-pat-grants)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -20227,9 +24227,9 @@ public enum Operations { } } public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -20240,16 +24240,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.OrgsListPatGrantRequests.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/responses/200/content`. + public var headers: Operations.OrgsListPatGrants.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/GET/responses/200/content/application\/json`. - case json([Components.Schemas.OrganizationProgrammaticAccessGrantRequest]) + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/responses/200/content/application\/json`. + case json([Components.Schemas.OrganizationProgrammaticAccessGrant]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.OrganizationProgrammaticAccessGrantRequest] { + public var json: [Components.Schemas.OrganizationProgrammaticAccessGrant] { get throws { switch self { case let .json(body): @@ -20259,15 +24259,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListPatGrantRequests.Output.Ok.Body + public var body: Operations.OrgsListPatGrants.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.OrgsListPatGrantRequests.Output.Ok.Headers = .init(), - body: Operations.OrgsListPatGrantRequests.Output.Ok.Body + headers: Operations.OrgsListPatGrants.Output.Ok.Headers = .init(), + body: Operations.OrgsListPatGrants.Output.Ok.Body ) { self.headers = headers self.body = body @@ -20275,15 +24275,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/get(orgs/list-pat-grant-requests)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/get(orgs/list-pat-grants)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListPatGrantRequests.Output.Ok) + case ok(Operations.OrgsListPatGrants.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListPatGrantRequests.Output.Ok { + public var ok: Operations.OrgsListPatGrants.Output.Ok { get throws { switch self { case let .ok(response): @@ -20327,22 +24327,22 @@ public enum Operations { } } } - /// Review requests to access organization resources with fine-grained personal access tokens + /// Update the access to organization resources via fine-grained personal access tokens /// - /// Approves or denies multiple pending requests to access organization resources via a fine-grained personal access token. + /// Updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access. /// /// Only GitHub Apps can use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/personal-access-token-requests`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/post(orgs/review-pat-grant-requests-in-bulk)`. - public enum OrgsReviewPatGrantRequestsInBulk { - public static let id: Swift.String = "orgs/review-pat-grant-requests-in-bulk" + /// - Remark: HTTP `POST /orgs/{org}/personal-access-tokens`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/post(orgs/update-pat-accesses)`. + public enum OrgsUpdatePatAccesses { + public static let id: Swift.String = "orgs/update-pat-accesses" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -20352,67 +24352,58 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/header`. + public var path: Operations.OrgsUpdatePatAccesses.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Unique identifiers of the requests for access via fine-grained personal access token. Must be formed of between 1 and 100 `pat_request_id` values. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/requestBody/json/pat_request_ids`. - public var patRequestIds: [Swift.Int]? - /// Action to apply to the requests. + public var headers: Operations.OrgsUpdatePatAccesses.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Action to apply to the fine-grained personal access token. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/requestBody/json/action`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/requestBody/json/action`. @frozen public enum ActionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case approve = "approve" - case deny = "deny" + case revoke = "revoke" } - /// Action to apply to the requests. + /// Action to apply to the fine-grained personal access token. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/requestBody/json/action`. - public var action: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Body.JsonPayload.ActionPayload - /// Reason for approving or denying the requests. Max 1024 characters. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/requestBody/json/action`. + public var action: Operations.OrgsUpdatePatAccesses.Input.Body.JsonPayload.ActionPayload + /// The IDs of the fine-grained personal access tokens. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/requestBody/json/reason`. - public var reason: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/requestBody/json/pat_ids`. + public var patIds: [Swift.Int] /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - patRequestIds: Unique identifiers of the requests for access via fine-grained personal access token. Must be formed of between 1 and 100 `pat_request_id` values. - /// - action: Action to apply to the requests. - /// - reason: Reason for approving or denying the requests. Max 1024 characters. + /// - action: Action to apply to the fine-grained personal access token. + /// - patIds: The IDs of the fine-grained personal access tokens. public init( - patRequestIds: [Swift.Int]? = nil, - action: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Body.JsonPayload.ActionPayload, - reason: Swift.String? = nil + action: Operations.OrgsUpdatePatAccesses.Input.Body.JsonPayload.ActionPayload, + patIds: [Swift.Int] ) { - self.patRequestIds = patRequestIds self.action = action - self.reason = reason + self.patIds = patIds } public enum CodingKeys: String, CodingKey { - case patRequestIds = "pat_request_ids" case action - case reason + case patIds = "pat_ids" } } - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/POST/requestBody/content/application\/json`. - case json(Operations.OrgsReviewPatGrantRequestsInBulk.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/requestBody/content/application\/json`. + case json(Operations.OrgsUpdatePatAccesses.Input.Body.JsonPayload) } - public var body: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Body + public var body: Operations.OrgsUpdatePatAccesses.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -20420,9 +24411,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Path, - headers: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Headers = .init(), - body: Operations.OrgsReviewPatGrantRequestsInBulk.Input.Body + path: Operations.OrgsUpdatePatAccesses.Input.Path, + headers: Operations.OrgsUpdatePatAccesses.Input.Headers = .init(), + body: Operations.OrgsUpdatePatAccesses.Input.Body ) { self.path = path self.headers = headers @@ -20432,7 +24423,7 @@ public enum Operations { @frozen public enum Output: Sendable, Hashable { /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/post(orgs/review-pat-grant-requests-in-bulk)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/post(orgs/update-pat-accesses)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -20453,47 +24444,47 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/post(orgs/review-pat-grant-requests-in-bulk)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/post(orgs/update-pat-accesses)/responses/404`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unprocessableContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "notFound", response: self ) } } } - /// Resource not found + /// Accepted /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/post(orgs/review-pat-grant-requests-in-bulk)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/post(orgs/update-pat-accesses)/responses/202`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `202 accepted`. + case accepted(Components.Responses.Accepted) + /// The associated value of the enum case if `self` is `.accepted`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Components.Responses.Accepted { get throws { switch self { - case let .notFound(response): + case let .accepted(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "accepted", response: self ) } @@ -20501,7 +24492,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/post(orgs/review-pat-grant-requests-in-bulk)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/post(orgs/update-pat-accesses)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -20522,24 +24513,24 @@ public enum Operations { } } } - /// Accepted + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/post(orgs/review-pat-grant-requests-in-bulk)/responses/202`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/post(orgs/update-pat-accesses)/responses/422`. /// - /// HTTP response code: `202 accepted`. - case accepted(Components.Responses.Accepted) - /// The associated value of the enum case if `self` is `.accepted`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.accepted`. - /// - SeeAlso: `.accepted`. - public var accepted: Components.Responses.Accepted { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .accepted(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "accepted", + expectedStatus: "unprocessableContent", response: self ) } @@ -20576,93 +24567,82 @@ public enum Operations { } } } - /// Review a request to access organization resources with a fine-grained personal access token + /// Update the access a fine-grained personal access token has to organization resources /// - /// Approves or denies a pending request to access organization resources via a fine-grained personal access token. + /// Updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access. /// /// Only GitHub Apps can use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/personal-access-token-requests/{pat_request_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)`. - public enum OrgsReviewPatGrantRequest { - public static let id: Swift.String = "orgs/review-pat-grant-request" + /// - Remark: HTTP `POST /orgs/{org}/personal-access-tokens/{pat_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)`. + public enum OrgsUpdatePatAccess { + public static let id: Swift.String = "orgs/update-pat-access" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the request for access via fine-grained personal access token. + /// The unique identifier of the fine-grained personal access token. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/path/pat_request_id`. - public var patRequestId: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/path/pat_id`. + public var patId: Components.Parameters.FineGrainedPersonalAccessTokenId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - patRequestId: Unique identifier of the request for access via fine-grained personal access token. + /// - patId: The unique identifier of the fine-grained personal access token. public init( org: Components.Parameters.Org, - patRequestId: Swift.Int + patId: Components.Parameters.FineGrainedPersonalAccessTokenId ) { self.org = org - self.patRequestId = patRequestId + self.patId = patId } } - public var path: Operations.OrgsReviewPatGrantRequest.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/header`. + public var path: Operations.OrgsUpdatePatAccess.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsReviewPatGrantRequest.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/requestBody`. + public var headers: Operations.OrgsUpdatePatAccess.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// Action to apply to the request. + /// Action to apply to the fine-grained personal access token. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/requestBody/json/action`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/requestBody/json/action`. @frozen public enum ActionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case approve = "approve" - case deny = "deny" + case revoke = "revoke" } - /// Action to apply to the request. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/requestBody/json/action`. - public var action: Operations.OrgsReviewPatGrantRequest.Input.Body.JsonPayload.ActionPayload - /// Reason for approving or denying the request. Max 1024 characters. + /// Action to apply to the fine-grained personal access token. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/requestBody/json/reason`. - public var reason: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/requestBody/json/action`. + public var action: Operations.OrgsUpdatePatAccess.Input.Body.JsonPayload.ActionPayload /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - action: Action to apply to the request. - /// - reason: Reason for approving or denying the request. Max 1024 characters. - public init( - action: Operations.OrgsReviewPatGrantRequest.Input.Body.JsonPayload.ActionPayload, - reason: Swift.String? = nil - ) { + /// - action: Action to apply to the fine-grained personal access token. + public init(action: Operations.OrgsUpdatePatAccess.Input.Body.JsonPayload.ActionPayload) { self.action = action - self.reason = reason } public enum CodingKeys: String, CodingKey { case action - case reason } } - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/POST/requestBody/content/application\/json`. - case json(Operations.OrgsReviewPatGrantRequest.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/requestBody/content/application\/json`. + case json(Operations.OrgsUpdatePatAccess.Input.Body.JsonPayload) } - public var body: Operations.OrgsReviewPatGrantRequest.Input.Body + public var body: Operations.OrgsUpdatePatAccess.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -20670,9 +24650,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.OrgsReviewPatGrantRequest.Input.Path, - headers: Operations.OrgsReviewPatGrantRequest.Input.Headers = .init(), - body: Operations.OrgsReviewPatGrantRequest.Input.Body + path: Operations.OrgsUpdatePatAccess.Input.Path, + headers: Operations.OrgsUpdatePatAccess.Input.Headers = .init(), + body: Operations.OrgsUpdatePatAccess.Input.Body ) { self.path = path self.headers = headers @@ -20682,7 +24662,7 @@ public enum Operations { @frozen public enum Output: Sendable, Hashable { /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -20703,47 +24683,55 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)/responses/404`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unprocessableContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "notFound", response: self ) } } } - /// Resource not found + /// A header with no content is returned. /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)/responses/204`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `204 noContent`. + case noContent(Components.Responses.NoContent) + /// A header with no content is returned. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Components.Responses.NoContent { get throws { switch self { - case let .notFound(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "noContent", response: self ) } @@ -20751,7 +24739,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -20770,34 +24758,26 @@ public enum Operations { response: self ) } - } - } - /// A header with no content is returned. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Components.Responses.NoContent) - /// A header with no content is returned. + } + } + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/post(orgs/review-pat-grant-request)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)/responses/422`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Components.Responses.NoContent { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .noContent(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "unprocessableContent", response: self ) } @@ -20834,50 +24814,50 @@ public enum Operations { } } } - /// List repositories requested to be accessed by a fine-grained personal access token + /// List repositories a fine-grained personal access token has access to /// - /// Lists the repositories a fine-grained personal access token request is requesting access to. + /// Lists the repositories a fine-grained personal access token has access to. /// /// Only GitHub Apps can use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/get(orgs/list-pat-grant-request-repositories)`. - public enum OrgsListPatGrantRequestRepositories { - public static let id: Swift.String = "orgs/list-pat-grant-request-repositories" + /// - Remark: HTTP `GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/repositories/get(orgs/list-pat-grant-repositories)`. + public enum OrgsListPatGrantRepositories { + public static let id: Swift.String = "orgs/list-pat-grant-repositories" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the request for access via fine-grained personal access token. + /// Unique identifier of the fine-grained personal access token. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/path/pat_request_id`. - public var patRequestId: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/path/pat_id`. + public var patId: Swift.Int /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - patRequestId: Unique identifier of the request for access via fine-grained personal access token. + /// - patId: Unique identifier of the fine-grained personal access token. public init( org: Components.Parameters.Org, - patRequestId: Swift.Int + patId: Swift.Int ) { self.org = org - self.patRequestId = patRequestId + self.patId = patId } } - public var path: Operations.OrgsListPatGrantRequestRepositories.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/query`. + public var path: Operations.OrgsListPatGrantRepositories.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/query`. public struct Query: Sendable, Hashable { /// The number of results per page (max 100). 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// @@ -20892,19 +24872,19 @@ public enum Operations { self.page = page } } - public var query: Operations.OrgsListPatGrantRequestRepositories.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/header`. + public var query: Operations.OrgsListPatGrantRepositories.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListPatGrantRequestRepositories.Input.Headers + public var headers: Operations.OrgsListPatGrantRepositories.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -20912,9 +24892,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.OrgsListPatGrantRequestRepositories.Input.Path, - query: Operations.OrgsListPatGrantRequestRepositories.Input.Query = .init(), - headers: Operations.OrgsListPatGrantRequestRepositories.Input.Headers = .init() + path: Operations.OrgsListPatGrantRepositories.Input.Path, + query: Operations.OrgsListPatGrantRepositories.Input.Query = .init(), + headers: Operations.OrgsListPatGrantRepositories.Input.Headers = .init() ) { self.path = path self.query = query @@ -20924,7 +24904,7 @@ public enum Operations { @frozen public enum Output: Sendable, Hashable { /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/get(orgs/list-pat-grant-request-repositories)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/repositories/get(orgs/list-pat-grant-repositories)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -20947,7 +24927,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/get(orgs/list-pat-grant-request-repositories)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/repositories/get(orgs/list-pat-grant-repositories)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -20970,7 +24950,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/get(orgs/list-pat-grant-request-repositories)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/repositories/get(orgs/list-pat-grant-repositories)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -20992,9 +24972,9 @@ public enum Operations { } } public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -21005,10 +24985,10 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.OrgsListPatGrantRequestRepositories.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/responses/200/content`. + public var headers: Operations.OrgsListPatGrantRepositories.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/GET/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/responses/200/content/application\/json`. case json([Components.Schemas.MinimalRepository]) /// The associated value of the enum case if `self` is `.json`. /// @@ -21024,15 +25004,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListPatGrantRequestRepositories.Output.Ok.Body + public var body: Operations.OrgsListPatGrantRepositories.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.OrgsListPatGrantRequestRepositories.Output.Ok.Headers = .init(), - body: Operations.OrgsListPatGrantRequestRepositories.Output.Ok.Body + headers: Operations.OrgsListPatGrantRepositories.Output.Ok.Headers = .init(), + body: Operations.OrgsListPatGrantRepositories.Output.Ok.Body ) { self.headers = headers self.body = body @@ -21040,15 +25020,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories/get(orgs/list-pat-grant-request-repositories)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/repositories/get(orgs/list-pat-grant-repositories)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListPatGrantRequestRepositories.Output.Ok) + case ok(Operations.OrgsListPatGrantRepositories.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListPatGrantRequestRepositories.Output.Ok { + public var ok: Operations.OrgsListPatGrantRepositories.Output.Ok { get throws { switch self { case let .ok(response): @@ -21092,22 +25072,21 @@ public enum Operations { } } } - /// List fine-grained personal access tokens with access to organization resources - /// - /// Lists approved fine-grained personal access tokens owned by organization members that can access organization resources. + /// Get all custom properties for an organization /// - /// Only GitHub Apps can use this endpoint. + /// Gets all custom properties defined for an organization. + /// Organization members can read these properties. /// - /// - Remark: HTTP `GET /orgs/{org}/personal-access-tokens`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/get(orgs/list-pat-grants)`. - public enum OrgsListPatGrants { - public static let id: Swift.String = "orgs/list-pat-grants" + /// - Remark: HTTP `GET /orgs/{org}/properties/schema`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)`. + public enum OrgsCustomPropertiesForReposGetOrganizationDefinitions { + public static let id: Swift.String = "orgs/custom-properties-for-repos-get-organization-definitions" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -21117,189 +25096,79 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsListPatGrants.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/page`. - public var page: Components.Parameters.Page? - /// - Remark: Generated from `#/components/parameters/personal-access-token-sort`. - @frozen public enum PersonalAccessTokenSort: String, Codable, Hashable, Sendable, CaseIterable { - case createdAt = "created_at" - } - /// The property by which to sort the results. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/sort`. - public var sort: Components.Parameters.PersonalAccessTokenSort? - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// A list of owner usernames to use to filter the results. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/owner`. - public var owner: Components.Parameters.PersonalAccessTokenOwner? - /// The name of the repository to use to filter the results. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/repository`. - public var repository: Components.Parameters.PersonalAccessTokenRepository? - /// The permission to use to filter the results. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/permission`. - public var permission: Components.Parameters.PersonalAccessTokenPermission? - /// Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/last_used_before`. - public var lastUsedBefore: Components.Parameters.PersonalAccessTokenBefore? - /// Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/last_used_after`. - public var lastUsedAfter: Components.Parameters.PersonalAccessTokenAfter? - /// The ID of the token - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/query/token_id`. - public var tokenId: Components.Parameters.PersonalAccessTokenTokenId? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." - /// - sort: The property by which to sort the results. - /// - direction: The direction to sort the results by. - /// - owner: A list of owner usernames to use to filter the results. - /// - repository: The name of the repository to use to filter the results. - /// - permission: The permission to use to filter the results. - /// - lastUsedBefore: Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - lastUsedAfter: Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - tokenId: The ID of the token - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil, - sort: Components.Parameters.PersonalAccessTokenSort? = nil, - direction: Components.Parameters.Direction? = nil, - owner: Components.Parameters.PersonalAccessTokenOwner? = nil, - repository: Components.Parameters.PersonalAccessTokenRepository? = nil, - permission: Components.Parameters.PersonalAccessTokenPermission? = nil, - lastUsedBefore: Components.Parameters.PersonalAccessTokenBefore? = nil, - lastUsedAfter: Components.Parameters.PersonalAccessTokenAfter? = nil, - tokenId: Components.Parameters.PersonalAccessTokenTokenId? = nil - ) { - self.perPage = perPage - self.page = page - self.sort = sort - self.direction = direction - self.owner = owner - self.repository = repository - self.permission = permission - self.lastUsedBefore = lastUsedBefore - self.lastUsedAfter = lastUsedAfter - self.tokenId = tokenId - } - } - public var query: Operations.OrgsListPatGrants.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/header`. + public var path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.OrgsListPatGrants.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.OrgsListPatGrants.Input.Path, - query: Operations.OrgsListPatGrants.Input.Query = .init(), - headers: Operations.OrgsListPatGrants.Input.Headers = .init() - ) { - self.path = path - self.query = query - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - /// Internal Error - /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/get(orgs/list-pat-grants)/responses/500`. - /// - /// HTTP response code: `500 internalServerError`. - case internalServerError(Components.Responses.InternalError) - /// The associated value of the enum case if `self` is `.internalServerError`. - /// - /// - Throws: An error if `self` is not `.internalServerError`. - /// - SeeAlso: `.internalServerError`. - public var internalServerError: Components.Responses.InternalError { - get throws { - switch self { - case let .internalServerError(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "internalServerError", - response: self - ) - } + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept } } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/get(orgs/list-pat-grants)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + public var headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Headers + /// Creates a new `Input`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/GET/responses/200/content/application\/json`. + case json([Components.Schemas.CustomProperty]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.CustomProperty] { + get throws { + switch self { + case let .json(body): + return body + } + } } } + /// Received HTTP response body + public var body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output.Ok.Body) { + self.body = body + } } - /// Resource not found + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/get(orgs/list-pat-grants)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)/responses/200`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinitions.Output.Ok { get throws { switch self { - case let .notFound(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "ok", response: self ) } @@ -21307,7 +25176,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/get(orgs/list-pat-grants)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -21328,71 +25197,24 @@ public enum Operations { } } } - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsListPatGrants.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/GET/responses/200/content/application\/json`. - case json([Components.Schemas.OrganizationProgrammaticAccessGrant]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.OrganizationProgrammaticAccessGrant] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OrgsListPatGrants.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.OrgsListPatGrants.Output.Ok.Headers = .init(), - body: Operations.OrgsListPatGrants.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/get(orgs/list-pat-grants)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/custom-properties-for-repos-get-organization-definitions)/responses/404`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListPatGrants.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListPatGrants.Output.Ok { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .ok(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "notFound", response: self ) } @@ -21429,22 +25251,28 @@ public enum Operations { } } } - /// Update the access to organization resources via fine-grained personal access tokens + /// Create or update custom properties for an organization /// - /// Updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access. + /// Creates new or updates existing custom properties defined for an organization in a batch. /// - /// Only GitHub Apps can use this endpoint. + /// If the property already exists, the existing property will be replaced with the new values. + /// Missing optional values will fall back to default values, previous values will be overwritten. + /// E.g. if a property exists with `values_editable_by: org_and_repo_actors` and it's updated without specifying `values_editable_by`, it will be updated to default value `org_actors`. /// - /// - Remark: HTTP `POST /orgs/{org}/personal-access-tokens`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/post(orgs/update-pat-accesses)`. - public enum OrgsUpdatePatAccesses { - public static let id: Swift.String = "orgs/update-pat-accesses" + /// To use this endpoint, the authenticated user must be one of: + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/properties/schema`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)`. + public enum OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions { + public static let id: Swift.String = "orgs/custom-properties-for-repos-create-or-update-organization-definitions" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -21454,58 +25282,42 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsUpdatePatAccesses.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/header`. + public var path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsUpdatePatAccesses.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/requestBody`. + public var headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// Action to apply to the fine-grained personal access token. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/requestBody/json/action`. - @frozen public enum ActionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case revoke = "revoke" - } - /// Action to apply to the fine-grained personal access token. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/requestBody/json/action`. - public var action: Operations.OrgsUpdatePatAccesses.Input.Body.JsonPayload.ActionPayload - /// The IDs of the fine-grained personal access tokens. + /// The array of custom properties to create or update. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/requestBody/json/pat_ids`. - public var patIds: [Swift.Int] + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/requestBody/json/properties`. + public var properties: [Components.Schemas.CustomProperty] /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - action: Action to apply to the fine-grained personal access token. - /// - patIds: The IDs of the fine-grained personal access tokens. - public init( - action: Operations.OrgsUpdatePatAccesses.Input.Body.JsonPayload.ActionPayload, - patIds: [Swift.Int] - ) { - self.action = action - self.patIds = patIds + /// - properties: The array of custom properties to create or update. + public init(properties: [Components.Schemas.CustomProperty]) { + self.properties = properties } public enum CodingKeys: String, CodingKey { - case action - case patIds = "pat_ids" + case properties } } - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/POST/requestBody/content/application\/json`. - case json(Operations.OrgsUpdatePatAccesses.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/requestBody/content/application\/json`. + case json(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Body.JsonPayload) } - public var body: Operations.OrgsUpdatePatAccesses.Input.Body + public var body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -21513,9 +25325,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.OrgsUpdatePatAccesses.Input.Path, - headers: Operations.OrgsUpdatePatAccesses.Input.Headers = .init(), - body: Operations.OrgsUpdatePatAccesses.Input.Body + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Input.Body ) { self.path = path self.headers = headers @@ -21523,24 +25335,75 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - /// Internal Error + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/responses/200/content/application\/json`. + case json([Components.Schemas.CustomProperty]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.CustomProperty] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output.Ok.Body) { + self.body = body + } + } + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/post(orgs/update-pat-accesses)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinitions.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)/responses/403`. /// - /// HTTP response code: `500 internalServerError`. - case internalServerError(Components.Responses.InternalError) - /// The associated value of the enum case if `self` is `.internalServerError`. + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Throws: An error if `self` is not `.internalServerError`. - /// - SeeAlso: `.internalServerError`. - public var internalServerError: Components.Responses.InternalError { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .internalServerError(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "internalServerError", + expectedStatus: "forbidden", response: self ) } @@ -21548,7 +25411,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/post(orgs/update-pat-accesses)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/custom-properties-for-repos-create-or-update-organization-definitions)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -21569,24 +25432,143 @@ public enum Operations { } } } - /// Accepted + /// Undocumented response. /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/post(orgs/update-pat-accesses)/responses/202`. + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get a custom property for an organization + /// + /// Gets a custom property that is defined for an organization. + /// Organization members can read these properties. + /// + /// - Remark: HTTP `GET /orgs/{org}/properties/schema/{custom_property_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)`. + public enum OrgsCustomPropertiesForReposGetOrganizationDefinition { + public static let id: Swift.String = "orgs/custom-properties-for-repos-get-organization-definition" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/path/org`. + public var org: Components.Parameters.Org + /// The custom property name + /// + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/path/custom_property_name`. + public var customPropertyName: Components.Parameters.CustomPropertyName + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - customPropertyName: The custom property name + public init( + org: Components.Parameters.Org, + customPropertyName: Components.Parameters.CustomPropertyName + ) { + self.org = org + self.customPropertyName = customPropertyName + } + } + public var path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Headers + /// Creates a new `Input`. /// - /// HTTP response code: `202 accepted`. - case accepted(Components.Responses.Accepted) - /// The associated value of the enum case if `self` is `.accepted`. + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.CustomProperty) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.CustomProperty { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output.Ok.Body) { + self.body = body + } + } + /// Response /// - /// - Throws: An error if `self` is not `.accepted`. - /// - SeeAlso: `.accepted`. - public var accepted: Components.Responses.Accepted { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsCustomPropertiesForReposGetOrganizationDefinition.Output.Ok { get throws { switch self { - case let .accepted(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "accepted", + expectedStatus: "ok", response: self ) } @@ -21594,7 +25576,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/post(orgs/update-pat-accesses)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -21615,24 +25597,24 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/post(orgs/update-pat-accesses)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/custom-properties-for-repos-get-organization-definition)/responses/404`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unprocessableContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "notFound", response: self ) } @@ -21669,82 +25651,61 @@ public enum Operations { } } } - /// Update the access a fine-grained personal access token has to organization resources + /// Create or update a custom property for an organization /// - /// Updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access. + /// Creates a new or updates an existing custom property that is defined for an organization. /// - /// Only GitHub Apps can use this endpoint. + /// To use this endpoint, the authenticated user must be one of: + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// - /// - Remark: HTTP `POST /orgs/{org}/personal-access-tokens/{pat_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)`. - public enum OrgsUpdatePatAccess { - public static let id: Swift.String = "orgs/update-pat-access" + /// - Remark: HTTP `PUT /orgs/{org}/properties/schema/{custom_property_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)`. + public enum OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition { + public static let id: Swift.String = "orgs/custom-properties-for-repos-create-or-update-organization-definition" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the fine-grained personal access token. + /// The custom property name /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/path/pat_id`. - public var patId: Components.Parameters.FineGrainedPersonalAccessTokenId + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/path/custom_property_name`. + public var customPropertyName: Components.Parameters.CustomPropertyName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - patId: The unique identifier of the fine-grained personal access token. + /// - customPropertyName: The custom property name public init( org: Components.Parameters.Org, - patId: Components.Parameters.FineGrainedPersonalAccessTokenId + customPropertyName: Components.Parameters.CustomPropertyName ) { self.org = org - self.patId = patId + self.customPropertyName = customPropertyName } } - public var path: Operations.OrgsUpdatePatAccess.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/header`. + public var path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsUpdatePatAccess.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/requestBody`. + public var headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Action to apply to the fine-grained personal access token. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/requestBody/json/action`. - @frozen public enum ActionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case revoke = "revoke" - } - /// Action to apply to the fine-grained personal access token. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/requestBody/json/action`. - public var action: Operations.OrgsUpdatePatAccess.Input.Body.JsonPayload.ActionPayload - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - action: Action to apply to the fine-grained personal access token. - public init(action: Operations.OrgsUpdatePatAccess.Input.Body.JsonPayload.ActionPayload) { - self.action = action - } - public enum CodingKeys: String, CodingKey { - case action - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/POST/requestBody/content/application\/json`. - case json(Operations.OrgsUpdatePatAccess.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.CustomPropertySetPayload) } - public var body: Operations.OrgsUpdatePatAccess.Input.Body + public var body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -21752,88 +25713,62 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.OrgsUpdatePatAccess.Input.Path, - headers: Operations.OrgsUpdatePatAccess.Input.Headers = .init(), - body: Operations.OrgsUpdatePatAccess.Input.Body + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Input.Body ) { self.path = path self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - /// Internal Error - /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)/responses/500`. - /// - /// HTTP response code: `500 internalServerError`. - case internalServerError(Components.Responses.InternalError) - /// The associated value of the enum case if `self` is `.internalServerError`. - /// - /// - Throws: An error if `self` is not `.internalServerError`. - /// - SeeAlso: `.internalServerError`. - public var internalServerError: Components.Responses.InternalError { - get throws { - switch self { - case let .internalServerError(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "internalServerError", - response: self - ) - } - } + self.body = body } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/responses/200/content/application\/json`. + case json(Components.Schemas.CustomProperty) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.CustomProperty { + get throws { + switch self { + case let .json(body): + return body + } + } } } + /// Received HTTP response body + public var body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output.Ok.Body) { + self.body = body + } } - /// A header with no content is returned. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Components.Responses.NoContent) - /// A header with no content is returned. + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Components.Responses.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationDefinition.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } @@ -21841,7 +25776,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -21862,24 +25797,24 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/post(orgs/update-pat-access)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/custom-properties-for-repos-create-or-update-organization-definition)/responses/404`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unprocessableContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "notFound", response: self ) } @@ -21916,135 +25851,95 @@ public enum Operations { } } } - /// List repositories a fine-grained personal access token has access to + /// Remove a custom property for an organization /// - /// Lists the repositories a fine-grained personal access token has access to. + /// Removes a custom property that is defined for an organization. /// - /// Only GitHub Apps can use this endpoint. + /// To use this endpoint, the authenticated user must be one of: + /// - An administrator for the organization. + /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. /// - /// - Remark: HTTP `GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/repositories/get(orgs/list-pat-grant-repositories)`. - public enum OrgsListPatGrantRepositories { - public static let id: Swift.String = "orgs/list-pat-grant-repositories" + /// - Remark: HTTP `DELETE /orgs/{org}/properties/schema/{custom_property_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)`. + public enum OrgsCustomPropertiesForReposDeleteOrganizationDefinition { + public static let id: Swift.String = "orgs/custom-properties-for-repos-delete-organization-definition" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/DELETE/path/org`. public var org: Components.Parameters.Org - /// Unique identifier of the fine-grained personal access token. + /// The custom property name /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/path/pat_id`. - public var patId: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/DELETE/path/custom_property_name`. + public var customPropertyName: Components.Parameters.CustomPropertyName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - patId: Unique identifier of the fine-grained personal access token. + /// - customPropertyName: The custom property name public init( org: Components.Parameters.Org, - patId: Swift.Int + customPropertyName: Components.Parameters.CustomPropertyName ) { self.org = org - self.patId = patId - } - } - public var path: Operations.OrgsListPatGrantRepositories.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page + self.customPropertyName = customPropertyName } } - public var query: Operations.OrgsListPatGrantRepositories.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/header`. + public var path: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListPatGrantRepositories.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.OrgsListPatGrantRepositories.Input.Path, - query: Operations.OrgsListPatGrantRepositories.Input.Query = .init(), - headers: Operations.OrgsListPatGrantRepositories.Input.Headers = .init() + path: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposDeleteOrganizationDefinition.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - /// Internal Error - /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/repositories/get(orgs/list-pat-grant-repositories)/responses/500`. + /// A header with no content is returned. /// - /// HTTP response code: `500 internalServerError`. - case internalServerError(Components.Responses.InternalError) - /// The associated value of the enum case if `self` is `.internalServerError`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)/responses/204`. /// - /// - Throws: An error if `self` is not `.internalServerError`. - /// - SeeAlso: `.internalServerError`. - public var internalServerError: Components.Responses.InternalError { - get throws { - switch self { - case let .internalServerError(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "internalServerError", - response: self - ) - } - } - } - /// Resource not found + /// HTTP response code: `204 noContent`. + case noContent(Components.Responses.NoContent) + /// A header with no content is returned. /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/repositories/get(orgs/list-pat-grant-repositories)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)/responses/204`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Components.Responses.NoContent { get throws { switch self { - case let .notFound(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "noContent", response: self ) } @@ -22052,7 +25947,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/repositories/get(orgs/list-pat-grant-repositories)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -22073,71 +25968,24 @@ public enum Operations { } } } - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsListPatGrantRepositories.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/personal-access-tokens/{pat_id}/repositories/GET/responses/200/content/application\/json`. - case json([Components.Schemas.MinimalRepository]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.MinimalRepository] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OrgsListPatGrantRepositories.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.OrgsListPatGrantRepositories.Output.Ok.Headers = .init(), - body: Operations.OrgsListPatGrantRepositories.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/personal-access-tokens/{pat_id}/repositories/get(orgs/list-pat-grant-repositories)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/custom-properties-for-repos-delete-organization-definition)/responses/404`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListPatGrantRepositories.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListPatGrantRepositories.Output.Ok { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .ok(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "notFound", response: self ) } @@ -22174,21 +26022,21 @@ public enum Operations { } } } - /// Get all custom properties for an organization + /// List custom property values for organization repositories /// - /// Gets all custom properties defined for an organization. + /// Lists organization repositories with all of their custom property values. /// Organization members can read these properties. /// - /// - Remark: HTTP `GET /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)`. - public enum OrgsGetAllCustomProperties { - public static let id: Swift.String = "orgs/get-all-custom-properties" + /// - Remark: HTTP `GET /orgs/{org}/properties/values`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)`. + public enum OrgsCustomPropertiesForReposGetOrganizationValues { + public static let id: Swift.String = "orgs/custom-properties-for-repos-get-organization-values" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -22198,43 +26046,91 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsGetAllCustomProperties.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/GET/header`. + public var path: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/query/page`. + public var page: Components.Parameters.Page? + /// Finds repositories in the organization with a query containing one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/query/repository_query`. + public var repositoryQuery: Swift.String? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + /// - repositoryQuery: Finds repositories in the organization with a query containing one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil, + repositoryQuery: Swift.String? = nil + ) { + self.perPage = perPage + self.page = page + self.repositoryQuery = repositoryQuery + } + } + public var query: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsGetAllCustomProperties.Input.Headers + public var headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.OrgsGetAllCustomProperties.Input.Path, - headers: Operations.OrgsGetAllCustomProperties.Input.Headers = .init() + path: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Path, + query: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Query = .init(), + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/GET/responses/200/content/application\/json`. - case json([Components.Schemas.CustomProperty]) + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/responses/200/content/application\/json`. + case json([Components.Schemas.OrgRepoCustomPropertyValues]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.CustomProperty] { + public var json: [Components.Schemas.OrgRepoCustomPropertyValues] { get throws { switch self { case let .json(body): @@ -22244,26 +26140,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsGetAllCustomProperties.Output.Ok.Body + public var body: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.OrgsGetAllCustomProperties.Output.Ok.Body) { + public init( + headers: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetAllCustomProperties.Output.Ok) + case ok(Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsGetAllCustomProperties.Output.Ok { + public var ok: Operations.OrgsCustomPropertiesForReposGetOrganizationValues.Output.Ok { get throws { switch self { case let .ok(response): @@ -22278,7 +26179,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -22301,7 +26202,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/get(orgs/get-all-custom-properties)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/custom-properties-for-repos-get-organization-values)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -22353,28 +26254,29 @@ public enum Operations { } } } - /// Create or update custom properties for an organization + /// Create or update custom property values for organization repositories /// - /// Creates new or updates existing custom properties defined for an organization in a batch. + /// Create new or update existing custom property values for repositories in a batch that belong to an organization. + /// Each target repository will have its custom property values updated to match the values provided in the request. /// - /// If the property already exists, the existing property will be replaced with the new values. - /// Missing optional values will fall back to default values, previous values will be overwritten. - /// E.g. if a property exists with `values_editable_by: org_and_repo_actors` and it's updated without specifying `values_editable_by`, it will be updated to default value `org_actors`. + /// A maximum of 30 repositories can be updated in a single request. + /// + /// Using a value of `null` for a custom property will remove or 'unset' the property value from the repository. /// /// To use this endpoint, the authenticated user must be one of: /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. + /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. /// - /// - Remark: HTTP `PATCH /orgs/{org}/properties/schema`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)`. - public enum OrgsCreateOrUpdateCustomProperties { - public static let id: Swift.String = "orgs/create-or-update-custom-properties" + /// - Remark: HTTP `PATCH /orgs/{org}/properties/values`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)`. + public enum OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues { + public static let id: Swift.String = "orgs/custom-properties-for-repos-create-or-update-organization-values" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -22384,42 +26286,52 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsCreateOrUpdateCustomProperties.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/header`. + public var path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsCreateOrUpdateCustomProperties.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/requestBody`. + public var headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The array of custom properties to create or update. + /// The names of repositories that the custom property values will be applied to. /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/requestBody/json/properties`. - public var properties: [Components.Schemas.CustomProperty] + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody/json/repository_names`. + public var repositoryNames: [Swift.String] + /// List of custom property names and associated values to apply to the repositories. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody/json/properties`. + public var properties: [Components.Schemas.CustomPropertyValue] /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - properties: The array of custom properties to create or update. - public init(properties: [Components.Schemas.CustomProperty]) { + /// - repositoryNames: The names of repositories that the custom property values will be applied to. + /// - properties: List of custom property names and associated values to apply to the repositories. + public init( + repositoryNames: [Swift.String], + properties: [Components.Schemas.CustomPropertyValue] + ) { + self.repositoryNames = repositoryNames self.properties = properties } public enum CodingKeys: String, CodingKey { + case repositoryNames = "repository_names" case properties } } - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/requestBody/content/application\/json`. - case json(Operations.OrgsCreateOrUpdateCustomProperties.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody/content/application\/json`. + case json(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Body.JsonPayload) } - public var body: Operations.OrgsCreateOrUpdateCustomProperties.Input.Body + public var body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -22427,9 +26339,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.OrgsCreateOrUpdateCustomProperties.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomProperties.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomProperties.Input.Body + path: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Path, + headers: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Headers = .init(), + body: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Input.Body ) { self.path = path self.headers = headers @@ -22437,52 +26349,36 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/PATCH/responses/200/content/application\/json`. - case json([Components.Schemas.CustomProperty]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.CustomProperty] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OrgsCreateOrUpdateCustomProperties.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OrgsCreateOrUpdateCustomProperties.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Response + /// No Content when custom property values are successfully created or updated /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsCreateOrUpdateCustomProperties.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Output.NoContent) + /// No Content when custom property values are successfully created or updated /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsCreateOrUpdateCustomProperties.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsCustomPropertiesForReposCreateOrUpdateOrganizationValues.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } @@ -22490,7 +26386,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -22513,7 +26409,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/patch(orgs/create-or-update-custom-properties)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -22534,6 +26430,29 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/custom-properties-for-repos-create-or-update-organization-values)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -22565,76 +26484,107 @@ public enum Operations { } } } - /// Get a custom property for an organization + /// List public organization members /// - /// Gets a custom property that is defined for an organization. - /// Organization members can read these properties. + /// Members of an organization can choose to have their membership publicized or not. /// - /// - Remark: HTTP `GET /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)`. - public enum OrgsGetCustomProperty { - public static let id: Swift.String = "orgs/get-custom-property" + /// - Remark: HTTP `GET /orgs/{org}/public_members`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/get(orgs/list-public-members)`. + public enum OrgsListPublicMembers { + public static let id: Swift.String = "orgs/list-public-members" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/path/org`. public var org: Components.Parameters.Org - /// The custom property name - /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/path/custom_property_name`. - public var customPropertyName: Components.Parameters.CustomPropertyName /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - customPropertyName: The custom property name + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsListPublicMembers.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." public init( - org: Components.Parameters.Org, - customPropertyName: Components.Parameters.CustomPropertyName + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil ) { - self.org = org - self.customPropertyName = customPropertyName + self.perPage = perPage + self.page = page } } - public var path: Operations.OrgsGetCustomProperty.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/header`. + public var query: Operations.OrgsListPublicMembers.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsGetCustomProperty.Input.Headers + public var headers: Operations.OrgsListPublicMembers.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.OrgsGetCustomProperty.Input.Path, - headers: Operations.OrgsGetCustomProperty.Input.Headers = .init() + path: Operations.OrgsListPublicMembers.Input.Path, + query: Operations.OrgsListPublicMembers.Input.Query = .init(), + headers: Operations.OrgsListPublicMembers.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.OrgsListPublicMembers.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.CustomProperty) + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.CustomProperty { + public var json: [Components.Schemas.SimpleUser] { get throws { switch self { case let .json(body): @@ -22644,26 +26594,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsGetCustomProperty.Output.Ok.Body + public var body: Operations.OrgsListPublicMembers.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.OrgsGetCustomProperty.Output.Ok.Body) { + public init( + headers: Operations.OrgsListPublicMembers.Output.Ok.Headers = .init(), + body: Operations.OrgsListPublicMembers.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/get(orgs/list-public-members)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetCustomProperty.Output.Ok) + case ok(Operations.OrgsListPublicMembers.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsGetCustomProperty.Output.Ok { + public var ok: Operations.OrgsListPublicMembers.Output.Ok { get throws { switch self { case let .ok(response): @@ -22676,52 +26631,6 @@ public enum Operations { } } } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/get(orgs/get-custom-property)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -22753,163 +26662,106 @@ public enum Operations { } } } - /// Create or update a custom property for an organization - /// - /// Creates a new or updates an existing custom property that is defined for an organization. + /// Check public organization membership for a user /// - /// To use this endpoint, the authenticated user must be one of: - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. + /// Check if the provided user is a public member of the organization. /// - /// - Remark: HTTP `PUT /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)`. - public enum OrgsCreateOrUpdateCustomProperty { - public static let id: Swift.String = "orgs/create-or-update-custom-property" + /// - Remark: HTTP `GET /orgs/{org}/public_members/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/get(orgs/check-public-membership-for-user)`. + public enum OrgsCheckPublicMembershipForUser { + public static let id: Swift.String = "orgs/check-public-membership-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/GET/path/org`. public var org: Components.Parameters.Org - /// The custom property name + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/path/custom_property_name`. - public var customPropertyName: Components.Parameters.CustomPropertyName + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - customPropertyName: The custom property name + /// - username: The handle for the GitHub user account. public init( org: Components.Parameters.Org, - customPropertyName: Components.Parameters.CustomPropertyName + username: Components.Parameters.Username ) { self.org = org - self.customPropertyName = customPropertyName - } - } - public var path: Operations.OrgsCreateOrUpdateCustomProperty.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + self.username = username } } - public var headers: Operations.OrgsCreateOrUpdateCustomProperty.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/requestBody/content/application\/json`. - case json(Components.Schemas.CustomPropertySetPayload) - } - public var body: Operations.OrgsCreateOrUpdateCustomProperty.Input.Body + public var path: Operations.OrgsCheckPublicMembershipForUser.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: - /// - body: - public init( - path: Operations.OrgsCreateOrUpdateCustomProperty.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomProperty.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomProperty.Input.Body - ) { + public init(path: Operations.OrgsCheckPublicMembershipForUser.Input.Path) { self.path = path - self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/PUT/responses/200/content/application\/json`. - case json(Components.Schemas.CustomProperty) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.CustomProperty { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OrgsCreateOrUpdateCustomProperty.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OrgsCreateOrUpdateCustomProperty.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)/responses/200`. + /// Response if user is a public member /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsCreateOrUpdateCustomProperty.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/get(orgs/check-public-membership-for-user)/responses/204`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsCreateOrUpdateCustomProperty.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Forbidden + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsCheckPublicMembershipForUser.Output.NoContent) + /// Response if user is a public member /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/get(orgs/check-public-membership-for-user)/responses/204`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsCheckPublicMembershipForUser.Output.NoContent { get throws { switch self { - case let .forbidden(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "noContent", response: self ) } } } - /// Resource not found + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Not Found if user is not a public member /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/put(orgs/create-or-update-custom-property)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/get(orgs/check-public-membership-for-user)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) + case notFound(Operations.OrgsCheckPublicMembershipForUser.Output.NotFound) + /// Not Found if user is not a public member + /// + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/get(orgs/check-public-membership-for-user)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + public var notFound: Operations.OrgsCheckPublicMembershipForUser.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -22927,104 +26779,81 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } } - /// Remove a custom property for an organization + /// Set public organization membership for the authenticated user /// - /// Removes a custom property that is defined for an organization. + /// The user can publicize their own membership. (A user cannot publicize the membership for another user.) /// - /// To use this endpoint, the authenticated user must be one of: - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. + /// Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." /// - /// - Remark: HTTP `DELETE /orgs/{org}/properties/schema/{custom_property_name}`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)`. - public enum OrgsRemoveCustomProperty { - public static let id: Swift.String = "orgs/remove-custom-property" + /// - Remark: HTTP `PUT /orgs/{org}/public_members/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/put(orgs/set-public-membership-for-authenticated-user)`. + public enum OrgsSetPublicMembershipForAuthenticatedUser { + public static let id: Swift.String = "orgs/set-public-membership-for-authenticated-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/PUT/path/org`. public var org: Components.Parameters.Org - /// The custom property name + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/DELETE/path/custom_property_name`. - public var customPropertyName: Components.Parameters.CustomPropertyName + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/PUT/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - customPropertyName: The custom property name + /// - username: The handle for the GitHub user account. public init( org: Components.Parameters.Org, - customPropertyName: Components.Parameters.CustomPropertyName + username: Components.Parameters.Username ) { self.org = org - self.customPropertyName = customPropertyName + self.username = username } } - public var path: Operations.OrgsRemoveCustomProperty.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/properties/schema/{custom_property_name}/DELETE/header`. + public var path: Operations.OrgsSetPublicMembershipForAuthenticatedUser.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsRemoveCustomProperty.Input.Headers + public var headers: Operations.OrgsSetPublicMembershipForAuthenticatedUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.OrgsRemoveCustomProperty.Input.Path, - headers: Operations.OrgsRemoveCustomProperty.Input.Headers = .init() + path: Operations.OrgsSetPublicMembershipForAuthenticatedUser.Input.Path, + headers: Operations.OrgsSetPublicMembershipForAuthenticatedUser.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - /// A header with no content is returned. + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/put(orgs/set-public-membership-for-authenticated-user)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Components.Responses.NoContent) - /// A header with no content is returned. + case noContent(Operations.OrgsSetPublicMembershipForAuthenticatedUser.Output.NoContent) + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/put(orgs/set-public-membership-for-authenticated-user)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -23034,7 +26863,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Components.Responses.NoContent { + public var noContent: Operations.OrgsSetPublicMembershipForAuthenticatedUser.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -23049,7 +26878,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/put(orgs/set-public-membership-for-authenticated-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -23070,29 +26899,6 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/schema/{custom_property_name}/delete(orgs/remove-custom-property)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -23124,74 +26930,158 @@ public enum Operations { } } } - /// List custom property values for organization repositories + /// Remove public organization membership for the authenticated user /// - /// Lists organization repositories with all of their custom property values. - /// Organization members can read these properties. + /// Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default. /// - /// - Remark: HTTP `GET /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)`. - public enum OrgsListCustomPropertiesValuesForRepos { - public static let id: Swift.String = "orgs/list-custom-properties-values-for-repos" + /// - Remark: HTTP `DELETE /orgs/{org}/public_members/{username}`. + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/delete(orgs/remove-public-membership-for-authenticated-user)`. + public enum OrgsRemovePublicMembershipForAuthenticatedUser { + public static let id: Swift.String = "orgs/remove-public-membership-for-authenticated-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/DELETE/path/org`. public var org: Components.Parameters.Org + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/DELETE/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - username: The handle for the GitHub user account. + public init( + org: Components.Parameters.Org, + username: Components.Parameters.Username + ) { self.org = org + self.username = username } } - public var path: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/query`. + public var path: Operations.OrgsRemovePublicMembershipForAuthenticatedUser.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.OrgsRemovePublicMembershipForAuthenticatedUser.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/delete(orgs/remove-public-membership-for-authenticated-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsRemovePublicMembershipForAuthenticatedUser.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/delete(orgs/remove-public-membership-for-authenticated-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsRemovePublicMembershipForAuthenticatedUser.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Get organization ruleset history + /// + /// Get the history of an organization ruleset. + /// + /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)`. + public enum OrgsGetOrgRulesetHistory { + public static let id: Swift.String = "orgs/get-org-ruleset-history" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/path/org`. + public var org: Components.Parameters.Org + /// The ID of the ruleset. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/path/ruleset_id`. + public var rulesetId: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - rulesetId: The ID of the ruleset. + public init( + org: Components.Parameters.Org, + rulesetId: Swift.Int + ) { + self.org = org + self.rulesetId = rulesetId + } + } + public var path: Operations.OrgsGetOrgRulesetHistory.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/query`. public struct Query: Sendable, Hashable { /// The number of results per page (max 100). 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/query/page`. + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/query/page`. public var page: Components.Parameters.Page? - /// Finds repositories in the organization with a query containing one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/query/repository_query`. - public var repositoryQuery: Swift.String? /// Creates a new `Query`. /// /// - Parameters: /// - perPage: The number of results per page (max 100). 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)." /// - page: The page number of the results to fetch. 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)." - /// - repositoryQuery: Finds repositories in the organization with a query containing one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as the web interface for GitHub. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/search/search#constructing-a-search-query). See "[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. public init( perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil, - repositoryQuery: Swift.String? = nil + page: Components.Parameters.Page? = nil ) { self.perPage = perPage self.page = page - self.repositoryQuery = repositoryQuery } } - public var query: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/header`. + public var query: Operations.OrgsGetOrgRulesetHistory.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Headers + public var headers: Operations.OrgsGetOrgRulesetHistory.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -23199,9 +27089,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Path, - query: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Query = .init(), - headers: Operations.OrgsListCustomPropertiesValuesForRepos.Input.Headers = .init() + path: Operations.OrgsGetOrgRulesetHistory.Input.Path, + query: Operations.OrgsGetOrgRulesetHistory.Input.Query = .init(), + headers: Operations.OrgsGetOrgRulesetHistory.Input.Headers = .init() ) { self.path = path self.query = query @@ -23210,29 +27100,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/GET/responses/200/content/application\/json`. - case json([Components.Schemas.OrgRepoCustomPropertyValues]) + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/responses/200/content/application\/json`. + case json([Components.Schemas.RulesetVersion]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.OrgRepoCustomPropertyValues] { + public var json: [Components.Schemas.RulesetVersion] { get throws { switch self { case let .json(body): @@ -23242,31 +27118,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Body + public var body: Operations.OrgsGetOrgRulesetHistory.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Headers = .init(), - body: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.OrgsGetOrgRulesetHistory.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok) + case ok(Operations.OrgsGetOrgRulesetHistory.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListCustomPropertiesValuesForRepos.Output.Ok { + public var ok: Operations.OrgsGetOrgRulesetHistory.Output.Ok { get throws { switch self { case let .ok(response): @@ -23279,47 +27150,47 @@ public enum Operations { } } } - /// Forbidden + /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)/responses/404`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .forbidden(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "notFound", response: self ) } } } - /// Resource not found + /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/get(orgs/list-custom-properties-values-for-repos)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)/responses/500`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { get throws { switch self { - case let .notFound(response): + case let .internalServerError(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "internalServerError", response: self ) } @@ -23356,154 +27227,118 @@ public enum Operations { } } } - /// Create or update custom property values for organization repositories - /// - /// Create new or update existing custom property values for repositories in a batch that belong to an organization. - /// Each target repository will have its custom property values updated to match the values provided in the request. - /// - /// A maximum of 30 repositories can be updated in a single request. - /// - /// Using a value of `null` for a custom property will remove or 'unset' the property value from the repository. + /// Get organization ruleset version /// - /// To use this endpoint, the authenticated user must be one of: - /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization. + /// Get a version of an organization ruleset. /// - /// - Remark: HTTP `PATCH /orgs/{org}/properties/values`. - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)`. - public enum OrgsCreateOrUpdateCustomPropertiesValuesForRepos { - public static let id: Swift.String = "orgs/create-or-update-custom-properties-values-for-repos" + /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)`. + public enum OrgsGetOrgRulesetVersion { + public static let id: Swift.String = "orgs/get-org-ruleset-version" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/path/org`. public var org: Components.Parameters.Org + /// The ID of the ruleset. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/path/ruleset_id`. + public var rulesetId: Swift.Int + /// The ID of the version + /// + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/path/version_id`. + public var versionId: Swift.Int /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { + /// - rulesetId: The ID of the ruleset. + /// - versionId: The ID of the version + public init( + org: Components.Parameters.Org, + rulesetId: Swift.Int, + versionId: Swift.Int + ) { self.org = org + self.rulesetId = rulesetId + self.versionId = versionId } } - public var path: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/header`. + public var path: Operations.OrgsGetOrgRulesetVersion.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The names of repositories that the custom property values will be applied to. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody/json/repository_names`. - public var repositoryNames: [Swift.String] - /// List of custom property names and associated values to apply to the repositories. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody/json/properties`. - public var properties: [Components.Schemas.CustomPropertyValue] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - repositoryNames: The names of repositories that the custom property values will be applied to. - /// - properties: List of custom property names and associated values to apply to the repositories. - public init( - repositoryNames: [Swift.String], - properties: [Components.Schemas.CustomPropertyValue] - ) { - self.repositoryNames = repositoryNames - self.properties = properties - } - public enum CodingKeys: String, CodingKey { - case repositoryNames = "repository_names" - case properties - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/properties/values/PATCH/requestBody/content/application\/json`. - case json(Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Body.JsonPayload) - } - public var body: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Body + public var headers: Operations.OrgsGetOrgRulesetVersion.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Path, - headers: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Headers = .init(), - body: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Input.Body + path: Operations.OrgsGetOrgRulesetVersion.Input.Path, + headers: Operations.OrgsGetOrgRulesetVersion.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// No Content when custom property values are successfully created or updated - /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Output.NoContent) - /// No Content when custom property values are successfully created or updated - /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsCreateOrUpdateCustomPropertiesValuesForRepos.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.RulesetVersionWithState) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.RulesetVersionWithState { + get throws { + switch self { + case let .json(body): + return body + } + } } } + /// Received HTTP response body + public var body: Operations.OrgsGetOrgRulesetVersion.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsGetOrgRulesetVersion.Output.Ok.Body) { + self.body = body + } } - /// Forbidden + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)/responses/200`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsGetOrgRulesetVersion.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsGetOrgRulesetVersion.Output.Ok { get throws { switch self { - case let .forbidden(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "ok", response: self ) } @@ -23511,7 +27346,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -23532,24 +27367,24 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. + /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/properties/values/patch(orgs/create-or-update-custom-properties-values-for-repos)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)/responses/500`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { get throws { switch self { - case let .unprocessableContent(response): + case let .internalServerError(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "internalServerError", response: self ) } @@ -23586,20 +27421,21 @@ public enum Operations { } } } - /// List public organization members + /// List security manager teams /// - /// Members of an organization can choose to have their membership publicized or not. + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// - /// - Remark: HTTP `GET /orgs/{org}/public_members`. - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/get(orgs/list-public-members)`. - public enum OrgsListPublicMembers { - public static let id: Swift.String = "orgs/list-public-members" + /// - Remark: HTTP `GET /orgs/{org}/security-managers`. + /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/get(orgs/list-security-manager-teams)`. + public enum OrgsListSecurityManagerTeams { + public static let id: Swift.String = "orgs/list-security-manager-teams" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -23609,84 +27445,43 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsListPublicMembers.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page - } - } - public var query: Operations.OrgsListPublicMembers.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/header`. + public var path: Operations.OrgsListSecurityManagerTeams.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsListPublicMembers.Input.Headers + public var headers: Operations.OrgsListSecurityManagerTeams.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.OrgsListPublicMembers.Input.Path, - query: Operations.OrgsListPublicMembers.Input.Query = .init(), - headers: Operations.OrgsListPublicMembers.Input.Headers = .init() + path: Operations.OrgsListSecurityManagerTeams.Input.Path, + headers: Operations.OrgsListSecurityManagerTeams.Input.Headers = .init() ) { self.path = path - self.query = query - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.OrgsListPublicMembers.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/responses/200/content`. + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/GET/responses/200/content/application\/json`. - case json([Components.Schemas.SimpleUser]) + /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/GET/responses/200/content/application\/json`. + case json([Components.Schemas.TeamSimple]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.SimpleUser] { + public var json: [Components.Schemas.TeamSimple] { get throws { switch self { case let .json(body): @@ -23696,31 +27491,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsListPublicMembers.Output.Ok.Body + public var body: Operations.OrgsListSecurityManagerTeams.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.OrgsListPublicMembers.Output.Ok.Headers = .init(), - body: Operations.OrgsListPublicMembers.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.OrgsListSecurityManagerTeams.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/get(orgs/list-public-members)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/get(orgs/list-security-manager-teams)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListPublicMembers.Output.Ok) + case ok(Operations.OrgsListSecurityManagerTeams.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListPublicMembers.Output.Ok { + public var ok: Operations.OrgsListSecurityManagerTeams.Output.Ok { get throws { switch self { case let .ok(response): @@ -23764,182 +27554,46 @@ public enum Operations { } } } - /// Check public organization membership for a user - /// - /// Check if the provided user is a public member of the organization. - /// - /// - Remark: HTTP `GET /orgs/{org}/public_members/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/get(orgs/check-public-membership-for-user)`. - public enum OrgsCheckPublicMembershipForUser { - public static let id: Swift.String = "orgs/check-public-membership-for-user" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/GET/path/org`. - public var org: Components.Parameters.Org - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/GET/path/username`. - public var username: Components.Parameters.Username - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. - public init( - org: Components.Parameters.Org, - username: Components.Parameters.Username - ) { - self.org = org - self.username = username - } - } - public var path: Operations.OrgsCheckPublicMembershipForUser.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.OrgsCheckPublicMembershipForUser.Input.Path) { - self.path = path - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response if user is a public member - /// - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/get(orgs/check-public-membership-for-user)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsCheckPublicMembershipForUser.Output.NoContent) - /// Response if user is a public member - /// - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/get(orgs/check-public-membership-for-user)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsCheckPublicMembershipForUser.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. - public init() {} - } - /// Not Found if user is not a public member - /// - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/get(orgs/check-public-membership-for-user)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.OrgsCheckPublicMembershipForUser.Output.NotFound) - /// Not Found if user is not a public member - /// - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/get(orgs/check-public-membership-for-user)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) - } - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.OrgsCheckPublicMembershipForUser.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// Set public organization membership for the authenticated user - /// - /// The user can publicize their own membership. (A user cannot publicize the membership for another user.) + /// Add a security manager team /// - /// Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// - /// - Remark: HTTP `PUT /orgs/{org}/public_members/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/put(orgs/set-public-membership-for-authenticated-user)`. - public enum OrgsSetPublicMembershipForAuthenticatedUser { - public static let id: Swift.String = "orgs/set-public-membership-for-authenticated-user" + /// - Remark: HTTP `PUT /orgs/{org}/security-managers/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/put(orgs/add-security-manager-team)`. + public enum OrgsAddSecurityManagerTeam { + public static let id: Swift.String = "orgs/add-security-manager-team" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/teams/{team_slug}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/teams/{team_slug}/PUT/path/org`. public var org: Components.Parameters.Org - /// The handle for the GitHub user account. + /// The slug of the team name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/PUT/path/username`. - public var username: Components.Parameters.Username + /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/teams/{team_slug}/PUT/path/team_slug`. + public var teamSlug: Components.Parameters.TeamSlug /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. + /// - teamSlug: The slug of the team name. public init( org: Components.Parameters.Org, - username: Components.Parameters.Username + teamSlug: Components.Parameters.TeamSlug ) { self.org = org - self.username = username - } - } - public var path: Operations.OrgsSetPublicMembershipForAuthenticatedUser.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/PUT/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + self.teamSlug = teamSlug } } - public var headers: Operations.OrgsSetPublicMembershipForAuthenticatedUser.Input.Headers + public var path: Operations.OrgsAddSecurityManagerTeam.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: - public init( - path: Operations.OrgsSetPublicMembershipForAuthenticatedUser.Input.Path, - headers: Operations.OrgsSetPublicMembershipForAuthenticatedUser.Input.Headers = .init() - ) { + public init(path: Operations.OrgsAddSecurityManagerTeam.Input.Path) { self.path = path - self.headers = headers } } @frozen public enum Output: Sendable, Hashable { @@ -23949,13 +27603,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/put(orgs/set-public-membership-for-authenticated-user)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/put(orgs/add-security-manager-team)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsSetPublicMembershipForAuthenticatedUser.Output.NoContent) + case noContent(Operations.OrgsAddSecurityManagerTeam.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/put(orgs/set-public-membership-for-authenticated-user)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/put(orgs/add-security-manager-team)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -23965,7 +27619,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsSetPublicMembershipForAuthenticatedUser.Output.NoContent { + public var noContent: Operations.OrgsAddSecurityManagerTeam.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -23978,98 +27632,51 @@ public enum Operations { } } } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/put(orgs/set-public-membership-for-authenticated-user)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } } - /// Remove public organization membership for the authenticated user + /// Remove a security manager team /// - /// Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default. + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. /// - /// - Remark: HTTP `DELETE /orgs/{org}/public_members/{username}`. - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/delete(orgs/remove-public-membership-for-authenticated-user)`. - public enum OrgsRemovePublicMembershipForAuthenticatedUser { - public static let id: Swift.String = "orgs/remove-public-membership-for-authenticated-user" + /// - Remark: HTTP `DELETE /orgs/{org}/security-managers/teams/{team_slug}`. + /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/delete(orgs/remove-security-manager-team)`. + public enum OrgsRemoveSecurityManagerTeam { + public static let id: Swift.String = "orgs/remove-security-manager-team" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/teams/{team_slug}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/teams/{team_slug}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The handle for the GitHub user account. + /// The slug of the team name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/public_members/{username}/DELETE/path/username`. - public var username: Components.Parameters.Username + /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/teams/{team_slug}/DELETE/path/team_slug`. + public var teamSlug: Components.Parameters.TeamSlug /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - username: The handle for the GitHub user account. + /// - teamSlug: The slug of the team name. public init( org: Components.Parameters.Org, - username: Components.Parameters.Username + teamSlug: Components.Parameters.TeamSlug ) { self.org = org - self.username = username + self.teamSlug = teamSlug } } - public var path: Operations.OrgsRemovePublicMembershipForAuthenticatedUser.Input.Path + public var path: Operations.OrgsRemoveSecurityManagerTeam.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.OrgsRemovePublicMembershipForAuthenticatedUser.Input.Path) { + public init(path: Operations.OrgsRemoveSecurityManagerTeam.Input.Path) { self.path = path } } @@ -24080,13 +27687,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/delete(orgs/remove-public-membership-for-authenticated-user)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/delete(orgs/remove-security-manager-team)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsRemovePublicMembershipForAuthenticatedUser.Output.NoContent) + case noContent(Operations.OrgsRemoveSecurityManagerTeam.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/public_members/{username}/delete(orgs/remove-public-membership-for-authenticated-user)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/delete(orgs/remove-security-manager-team)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -24096,7 +27703,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsRemovePublicMembershipForAuthenticatedUser.Output.NoContent { + public var noContent: Operations.OrgsRemoveSecurityManagerTeam.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -24115,102 +27722,68 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// Get organization ruleset history + /// Get immutable releases settings for an organization /// - /// Get the history of an organization ruleset. + /// Gets the immutable releases policy for repositories in an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history`. - /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)`. - public enum OrgsGetOrgRulesetHistory { - public static let id: Swift.String = "orgs/get-org-ruleset-history" + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/get(orgs/get-immutable-releases-settings)`. + public enum OrgsGetImmutableReleasesSettings { + public static let id: Swift.String = "orgs/get-immutable-releases-settings" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/GET/path/org`. public var org: Components.Parameters.Org - /// The ID of the ruleset. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/path/ruleset_id`. - public var rulesetId: Swift.Int /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - rulesetId: The ID of the ruleset. - public init( - org: Components.Parameters.Org, - rulesetId: Swift.Int - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.rulesetId = rulesetId - } - } - public var path: Operations.OrgsGetOrgRulesetHistory.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page } } - public var query: Operations.OrgsGetOrgRulesetHistory.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/header`. + public var path: Operations.OrgsGetImmutableReleasesSettings.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsGetOrgRulesetHistory.Input.Headers + public var headers: Operations.OrgsGetImmutableReleasesSettings.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.OrgsGetOrgRulesetHistory.Input.Path, - query: Operations.OrgsGetOrgRulesetHistory.Input.Query = .init(), - headers: Operations.OrgsGetOrgRulesetHistory.Input.Headers = .init() + path: Operations.OrgsGetImmutableReleasesSettings.Input.Path, + headers: Operations.OrgsGetImmutableReleasesSettings.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/GET/responses/200/content/application\/json`. - case json([Components.Schemas.RulesetVersion]) + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ImmutableReleasesOrganizationSettings) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.RulesetVersion] { + public var json: Components.Schemas.ImmutableReleasesOrganizationSettings { get throws { switch self { case let .json(body): @@ -24220,26 +27793,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsGetOrgRulesetHistory.Output.Ok.Body + public var body: Operations.OrgsGetImmutableReleasesSettings.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsGetOrgRulesetHistory.Output.Ok.Body) { + public init(body: Operations.OrgsGetImmutableReleasesSettings.Output.Ok.Body) { self.body = body } } - /// Response + /// Immutable releases settings response /// - /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/get(orgs/get-immutable-releases-settings)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetOrgRulesetHistory.Output.Ok) + case ok(Operations.OrgsGetImmutableReleasesSettings.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsGetOrgRulesetHistory.Output.Ok { + public var ok: Operations.OrgsGetImmutableReleasesSettings.Output.Ok { get throws { switch self { case let .ok(response): @@ -24252,52 +27825,6 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Internal Error - /// - /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/get(orgs/get-org-ruleset-history)/responses/500`. - /// - /// HTTP response code: `500 internalServerError`. - case internalServerError(Components.Responses.InternalError) - /// The associated value of the enum case if `self` is `.internalServerError`. - /// - /// - Throws: An error if `self` is not `.internalServerError`. - /// - SeeAlso: `.internalServerError`. - public var internalServerError: Components.Responses.InternalError { - get throws { - switch self { - case let .internalServerError(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "internalServerError", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -24329,82 +27856,240 @@ public enum Operations { } } } - /// Get organization ruleset version + /// Set immutable releases settings for an organization /// - /// Get a version of an organization ruleset. + /// Sets the immutable releases policy for repositories in an organization. /// - /// - Remark: HTTP `GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)`. - public enum OrgsGetOrgRulesetVersion { - public static let id: Swift.String = "orgs/get-org-ruleset-version" + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/put(orgs/set-immutable-releases-settings)`. + public enum OrgsSetImmutableReleasesSettings { + public static let id: Swift.String = "orgs/set-immutable-releases-settings" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/path/org`. public var org: Components.Parameters.Org - /// The ID of the ruleset. + /// Creates a new `Path`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/path/ruleset_id`. - public var rulesetId: Swift.Int - /// The ID of the version + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsSetImmutableReleasesSettings.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The policy that controls how immutable releases are enforced in the organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/requestBody/json/enforced_repositories`. + @frozen public enum EnforcedRepositoriesPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case none = "none" + case selected = "selected" + } + /// The policy that controls how immutable releases are enforced in the organization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/requestBody/json/enforced_repositories`. + public var enforcedRepositories: Operations.OrgsSetImmutableReleasesSettings.Input.Body.JsonPayload.EnforcedRepositoriesPayload + /// An array of repository ids for which immutable releases enforcement should be applied. You can only provide a list of repository ids when the `enforced_repositories` is set to `selected`. You can add and remove individual repositories using the [Enable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#enable-a-selected-repository-for-immutable-releases-in-an-organization) and [Disable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#disable-a-selected-repository-for-immutable-releases-in-an-organization) endpoints. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enforcedRepositories: The policy that controls how immutable releases are enforced in the organization. + /// - selectedRepositoryIds: An array of repository ids for which immutable releases enforcement should be applied. You can only provide a list of repository ids when the `enforced_repositories` is set to `selected`. You can add and remove individual repositories using the [Enable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#enable-a-selected-repository-for-immutable-releases-in-an-organization) and [Disable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#disable-a-selected-repository-for-immutable-releases-in-an-organization) endpoints. + public init( + enforcedRepositories: Operations.OrgsSetImmutableReleasesSettings.Input.Body.JsonPayload.EnforcedRepositoriesPayload, + selectedRepositoryIds: [Swift.Int]? = nil + ) { + self.enforcedRepositories = enforcedRepositories + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case enforcedRepositories = "enforced_repositories" + case selectedRepositoryIds = "selected_repository_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/PUT/requestBody/content/application\/json`. + case json(Operations.OrgsSetImmutableReleasesSettings.Input.Body.JsonPayload) + } + public var body: Operations.OrgsSetImmutableReleasesSettings.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.OrgsSetImmutableReleasesSettings.Input.Path, + body: Operations.OrgsSetImmutableReleasesSettings.Input.Body + ) { + self.path = path + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/put(orgs/set-immutable-releases-settings)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsSetImmutableReleasesSettings.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/put(orgs/set-immutable-releases-settings)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsSetImmutableReleasesSettings.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// List selected repositories for immutable releases enforcement + /// + /// List all of the repositories that have been selected for immutable releases enforcement in an organization. + /// + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/get(orgs/get-immutable-releases-settings-repositories)`. + public enum OrgsGetImmutableReleasesSettingsRepositories { + public static let id: Swift.String = "orgs/get-immutable-releases-settings-repositories" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/query`. + public struct Query: Sendable, Hashable { + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of results per page (max 100). 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)." /// - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/path/version_id`. - public var versionId: Swift.Int - /// Creates a new `Path`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - rulesetId: The ID of the ruleset. - /// - versionId: The ID of the version + /// - page: The page number of the results to fetch. 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)." + /// - perPage: The number of results per page (max 100). 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)." public init( - org: Components.Parameters.Org, - rulesetId: Swift.Int, - versionId: Swift.Int + page: Components.Parameters.Page? = nil, + perPage: Components.Parameters.PerPage? = nil ) { - self.org = org - self.rulesetId = rulesetId - self.versionId = versionId + self.page = page + self.perPage = perPage } } - public var path: Operations.OrgsGetOrgRulesetVersion.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/header`. + public var query: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.OrgsGetOrgRulesetVersion.Input.Headers + public var headers: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.OrgsGetOrgRulesetVersion.Input.Path, - headers: Operations.OrgsGetOrgRulesetVersion.Input.Headers = .init() + path: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Path, + query: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Query = .init(), + headers: Operations.OrgsGetImmutableReleasesSettingsRepositories.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.RulesetVersionWithState) + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/responses/200/content/json/repositories`. + public var repositories: [Components.Schemas.MinimalRepository] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - repositories: + public init( + totalCount: Swift.Int, + repositories: [Components.Schemas.MinimalRepository] + ) { + self.totalCount = totalCount + self.repositories = repositories + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case repositories + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/GET/responses/200/content/application\/json`. + case json(Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.RulesetVersionWithState { + public var json: Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -24414,26 +28099,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsGetOrgRulesetVersion.Output.Ok.Body + public var body: Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsGetOrgRulesetVersion.Output.Ok.Body) { + public init(body: Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/get(orgs/get-immutable-releases-settings-repositories)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsGetOrgRulesetVersion.Output.Ok) + case ok(Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsGetOrgRulesetVersion.Output.Ok { + public var ok: Operations.OrgsGetImmutableReleasesSettingsRepositories.Output.Ok { get throws { switch self { case let .ok(response): @@ -24446,52 +28131,6 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Internal Error - /// - /// - Remark: Generated from `#/paths//orgs/{org}/rulesets/{ruleset_id}/history/{version_id}/get(orgs/get-org-ruleset-version)/responses/500`. - /// - /// HTTP response code: `500 internalServerError`. - case internalServerError(Components.Responses.InternalError) - /// The associated value of the enum case if `self` is `.internalServerError`. - /// - /// - Throws: An error if `self` is not `.internalServerError`. - /// - SeeAlso: `.internalServerError`. - public var internalServerError: Components.Responses.InternalError { - get throws { - switch self { - case let .internalServerError(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "internalServerError", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -24523,21 +28162,22 @@ public enum Operations { } } } - /// List security manager teams + /// Set selected repositories for immutable releases enforcement /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. + /// Replaces all repositories that have been selected for immutable releases enforcement in an organization. To use this endpoint, the organization immutable releases policy for `enforced_repositories` must be configured to `selected`. /// - /// - Remark: HTTP `GET /orgs/{org}/security-managers`. - /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/get(orgs/list-security-manager-teams)`. - public enum OrgsListSecurityManagerTeams { - public static let id: Swift.String = "orgs/list-security-manager-teams" + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/put(orgs/set-immutable-releases-settings-repositories)`. + public enum OrgsSetImmutableReleasesSettingsRepositories { + public static let id: Swift.String = "orgs/set-immutable-releases-settings-repositories" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -24547,79 +28187,74 @@ public enum Operations { self.org = org } } - public var path: Operations.OrgsListSecurityManagerTeams.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + public var path: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// An array of repository ids for which immutable releases enforcement should be applied. You can only provide a list of repository ids when the `enforced_repositories` is set to `selected`. You can add and remove individual repositories using the [Enable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#enable-a-selected-repository-for-immutable-releases-in-an-organization) and [Disable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#disable-a-selected-repository-for-immutable-releases-in-an-organization) endpoints. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedRepositoryIds: An array of repository ids for which immutable releases enforcement should be applied. You can only provide a list of repository ids when the `enforced_repositories` is set to `selected`. You can add and remove individual repositories using the [Enable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#enable-a-selected-repository-for-immutable-releases-in-an-organization) and [Disable a selected repository for immutable releases in an organization](https://docs.github.com/rest/orgs/orgs#disable-a-selected-repository-for-immutable-releases-in-an-organization) endpoints. + public init(selectedRepositoryIds: [Swift.Int]) { + self.selectedRepositoryIds = selectedRepositoryIds + } + public enum CodingKeys: String, CodingKey { + case selectedRepositoryIds = "selected_repository_ids" + } } + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.OrgsSetImmutableReleasesSettingsRepositories.Input.Body.JsonPayload) } - public var headers: Operations.OrgsListSecurityManagerTeams.Input.Headers + public var body: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - headers: + /// - body: public init( - path: Operations.OrgsListSecurityManagerTeams.Input.Path, - headers: Operations.OrgsListSecurityManagerTeams.Input.Headers = .init() + path: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input.Path, + body: Operations.OrgsSetImmutableReleasesSettingsRepositories.Input.Body ) { self.path = path - self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/GET/responses/200/content/application\/json`. - case json([Components.Schemas.TeamSimple]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.TeamSimple] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OrgsListSecurityManagerTeams.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OrgsListSecurityManagerTeams.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/get(orgs/list-security-manager-teams)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/put(orgs/set-immutable-releases-settings-repositories)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.OrgsListSecurityManagerTeams.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsSetImmutableReleasesSettingsRepositories.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.OrgsListSecurityManagerTeams.Output.Ok { + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/put(orgs/set-immutable-releases-settings-repositories)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsSetImmutableReleasesSettingsRepositories.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } @@ -24630,71 +28265,47 @@ public enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } } - /// Add a security manager team + /// Enable a selected repository for immutable releases in an organization /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. + /// Adds a repository to the list of selected repositories that are enforced for immutable releases in an organization. To use this endpoint, the organization immutable releases policy for `enforced_repositories` must be configured to `selected`. /// - /// - Remark: HTTP `PUT /orgs/{org}/security-managers/teams/{team_slug}`. - /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/put(orgs/add-security-manager-team)`. - public enum OrgsAddSecurityManagerTeam { - public static let id: Swift.String = "orgs/add-security-manager-team" + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/put(orgs/enable-selected-repository-immutable-releases-organization)`. + public enum OrgsEnableSelectedRepositoryImmutableReleasesOrganization { + public static let id: Swift.String = "orgs/enable-selected-repository-immutable-releases-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/teams/{team_slug}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/{repository_id}/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/teams/{team_slug}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/{repository_id}/PUT/path/org`. public var org: Components.Parameters.Org - /// The slug of the team name. + /// The unique identifier of the repository. /// - /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/teams/{team_slug}/PUT/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/{repository_id}/PUT/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. + /// - repositoryId: The unique identifier of the repository. public init( org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug + repositoryId: Components.Parameters.RepositoryId ) { self.org = org - self.teamSlug = teamSlug + self.repositoryId = repositoryId } } - public var path: Operations.OrgsAddSecurityManagerTeam.Input.Path + public var path: Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.OrgsAddSecurityManagerTeam.Input.Path) { + public init(path: Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Input.Path) { self.path = path } } @@ -24705,13 +28316,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/put(orgs/add-security-manager-team)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/put(orgs/enable-selected-repository-immutable-releases-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsAddSecurityManagerTeam.Output.NoContent) + case noContent(Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/put(orgs/add-security-manager-team)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/put(orgs/enable-selected-repository-immutable-releases-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -24721,7 +28332,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsAddSecurityManagerTeam.Output.NoContent { + public var noContent: Operations.OrgsEnableSelectedRepositoryImmutableReleasesOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -24740,45 +28351,46 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } - /// Remove a security manager team + /// Disable a selected repository for immutable releases in an organization /// - /// > [!WARNING] - /// > **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. + /// Removes a repository from the list of selected repositories that are enforced for immutable releases in an organization. To use this endpoint, the organization immutable releases policy for `enforced_repositories` must be configured to `selected`. /// - /// - Remark: HTTP `DELETE /orgs/{org}/security-managers/teams/{team_slug}`. - /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/delete(orgs/remove-security-manager-team)`. - public enum OrgsRemoveSecurityManagerTeam { - public static let id: Swift.String = "orgs/remove-security-manager-team" + /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/delete(orgs/disable-selected-repository-immutable-releases-organization)`. + public enum OrgsDisableSelectedRepositoryImmutableReleasesOrganization { + public static let id: Swift.String = "orgs/disable-selected-repository-immutable-releases-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/teams/{team_slug}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/{repository_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/teams/{team_slug}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/{repository_id}/DELETE/path/org`. public var org: Components.Parameters.Org - /// The slug of the team name. + /// The unique identifier of the repository. /// - /// - Remark: Generated from `#/paths/orgs/{org}/security-managers/teams/{team_slug}/DELETE/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug + /// - Remark: Generated from `#/paths/orgs/{org}/settings/immutable-releases/repositories/{repository_id}/DELETE/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. + /// - repositoryId: The unique identifier of the repository. public init( org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug + repositoryId: Components.Parameters.RepositoryId ) { self.org = org - self.teamSlug = teamSlug + self.repositoryId = repositoryId } } - public var path: Operations.OrgsRemoveSecurityManagerTeam.Input.Path + public var path: Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Input.Path /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.OrgsRemoveSecurityManagerTeam.Input.Path) { + public init(path: Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Input.Path) { self.path = path } } @@ -24789,13 +28401,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/delete(orgs/remove-security-manager-team)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/delete(orgs/disable-selected-repository-immutable-releases-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.OrgsRemoveSecurityManagerTeam.Output.NoContent) + case noContent(Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/security-managers/teams/{team_slug}/delete(orgs/remove-security-manager-team)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/delete(orgs/disable-selected-repository-immutable-releases-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -24805,7 +28417,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.OrgsRemoveSecurityManagerTeam.Output.NoContent { + public var noContent: Operations.OrgsDisableSelectedRepositoryImmutableReleasesOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): diff --git a/Sources/packages/Types.swift b/Sources/packages/Types.swift index 99a71ce25dc..17bd9829232 100644 --- a/Sources/packages/Types.swift +++ b/Sources/packages/Types.swift @@ -1206,6 +1206,11 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -1226,6 +1231,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -1371,7 +1381,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: @@ -1667,6 +1677,30 @@ public enum Components { public var webCommitSignoffRequired: Swift.Bool? /// - Remark: Generated from `#/components/schemas/nullable-minimal-repository/security_and_analysis`. public var securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/nullable-minimal-repository/custom_properties`. + public struct CustomPropertiesPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CustomPropertiesPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/nullable-minimal-repository/custom_properties`. + public var customProperties: Components.Schemas.NullableMinimalRepository.CustomPropertiesPayload? /// Creates a new `NullableMinimalRepository`. /// /// - Parameters: @@ -1757,6 +1791,7 @@ public enum Components { /// - allowForking: /// - webCommitSignoffRequired: /// - securityAndAnalysis: + /// - customProperties: The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. public init( id: Swift.Int64, nodeId: Swift.String, @@ -1844,7 +1879,8 @@ public enum Components { watchers: Swift.Int? = nil, allowForking: Swift.Bool? = nil, webCommitSignoffRequired: Swift.Bool? = nil, - securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil + securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil, + customProperties: Components.Schemas.NullableMinimalRepository.CustomPropertiesPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -1933,6 +1969,7 @@ public enum Components { self.allowForking = allowForking self.webCommitSignoffRequired = webCommitSignoffRequired self.securityAndAnalysis = securityAndAnalysis + self.customProperties = customProperties } public enum CodingKeys: String, CodingKey { case id @@ -2022,6 +2059,7 @@ public enum Components { case allowForking = "allow_forking" case webCommitSignoffRequired = "web_commit_signoff_required" case securityAndAnalysis = "security_and_analysis" + case customProperties = "custom_properties" } } /// A software package @@ -2285,14 +2323,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String /// The handle for the GitHub user account. /// /// - Remark: Generated from `#/components/parameters/username`. public typealias Username = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// The selected visibility of the packages. This parameter is optional and only filters an existing result set. /// /// The `internal` visibility is only supported for GitHub Packages registries that allow for granular permissions. For other ecosystems `internal` is synonymous with `private`. diff --git a/Sources/private-registries/Types.swift b/Sources/private-registries/Types.swift index d89d001fbc8..48220a69a05 100644 --- a/Sources/private-registries/Types.swift +++ b/Sources/private-registries/Types.swift @@ -440,6 +440,20 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/registry_type`. @frozen public enum RegistryTypePayload: String, Codable, Hashable, Sendable, CaseIterable { case mavenRepository = "maven_repository" + case nugetFeed = "nuget_feed" + case goproxyServer = "goproxy_server" + case npmRegistry = "npm_registry" + case rubygemsServer = "rubygems_server" + case cargoRegistry = "cargo_registry" + case composerRepository = "composer_repository" + case dockerRegistry = "docker_registry" + case gitSource = "git_source" + case helmRegistry = "helm_registry" + case hexOrganization = "hex_organization" + case hexRepository = "hex_repository" + case pubRepository = "pub_repository" + case pythonIndex = "python_index" + case terraformRegistry = "terraform_registry" } /// The registry type. /// @@ -511,6 +525,20 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/registry_type`. @frozen public enum RegistryTypePayload: String, Codable, Hashable, Sendable, CaseIterable { case mavenRepository = "maven_repository" + case nugetFeed = "nuget_feed" + case goproxyServer = "goproxy_server" + case npmRegistry = "npm_registry" + case rubygemsServer = "rubygems_server" + case cargoRegistry = "cargo_registry" + case composerRepository = "composer_repository" + case dockerRegistry = "docker_registry" + case gitSource = "git_source" + case helmRegistry = "helm_registry" + case hexOrganization = "hex_organization" + case hexRepository = "hex_repository" + case pubRepository = "pub_repository" + case pythonIndex = "python_index" + case terraformRegistry = "terraform_registry" } /// The registry type. /// @@ -1024,11 +1052,29 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/registry_type`. @frozen public enum RegistryTypePayload: String, Codable, Hashable, Sendable, CaseIterable { case mavenRepository = "maven_repository" + case nugetFeed = "nuget_feed" + case goproxyServer = "goproxy_server" + case npmRegistry = "npm_registry" + case rubygemsServer = "rubygems_server" + case cargoRegistry = "cargo_registry" + case composerRepository = "composer_repository" + case dockerRegistry = "docker_registry" + case gitSource = "git_source" + case helmRegistry = "helm_registry" + case hexOrganization = "hex_organization" + case hexRepository = "hex_repository" + case pubRepository = "pub_repository" + case pythonIndex = "python_index" + case terraformRegistry = "terraform_registry" } /// The registry type. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/registry_type`. public var registryType: Operations.PrivateRegistriesCreateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload + /// The URL of the private registry. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/url`. + public var url: Swift.String /// The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/username`. @@ -1061,6 +1107,7 @@ public enum Operations { /// /// - Parameters: /// - registryType: The registry type. + /// - url: The URL of the private registry. /// - username: The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. /// - encryptedValue: The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. /// - keyId: The ID of the key you used to encrypt the secret. @@ -1068,6 +1115,7 @@ public enum Operations { /// - selectedRepositoryIds: An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. You can manage the list of selected repositories using the [Update a private registry for an organization](https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization) endpoint. This field should be omitted if `visibility` is set to `all` or `private`. public init( registryType: Operations.PrivateRegistriesCreateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload, + url: Swift.String, username: Swift.String? = nil, encryptedValue: Swift.String, keyId: Swift.String, @@ -1075,6 +1123,7 @@ public enum Operations { selectedRepositoryIds: [Swift.Int]? = nil ) { self.registryType = registryType + self.url = url self.username = username self.encryptedValue = encryptedValue self.keyId = keyId @@ -1083,6 +1132,7 @@ public enum Operations { } public enum CodingKeys: String, CodingKey { case registryType = "registry_type" + case url case username case encryptedValue = "encrypted_value" case keyId = "key_id" @@ -1667,11 +1717,29 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/registry_type`. @frozen public enum RegistryTypePayload: String, Codable, Hashable, Sendable, CaseIterable { case mavenRepository = "maven_repository" + case nugetFeed = "nuget_feed" + case goproxyServer = "goproxy_server" + case npmRegistry = "npm_registry" + case rubygemsServer = "rubygems_server" + case cargoRegistry = "cargo_registry" + case composerRepository = "composer_repository" + case dockerRegistry = "docker_registry" + case gitSource = "git_source" + case helmRegistry = "helm_registry" + case hexOrganization = "hex_organization" + case hexRepository = "hex_repository" + case pubRepository = "pub_repository" + case pythonIndex = "python_index" + case terraformRegistry = "terraform_registry" } /// The registry type. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/registry_type`. public var registryType: Operations.PrivateRegistriesUpdateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload? + /// The URL of the private registry. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/url`. + public var url: Swift.String? /// The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/username`. @@ -1704,6 +1772,7 @@ public enum Operations { /// /// - Parameters: /// - registryType: The registry type. + /// - url: The URL of the private registry. /// - username: The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. /// - encryptedValue: The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. /// - keyId: The ID of the key you used to encrypt the secret. @@ -1711,6 +1780,7 @@ public enum Operations { /// - selectedRepositoryIds: An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. This field should be omitted if `visibility` is set to `all` or `private`. public init( registryType: Operations.PrivateRegistriesUpdateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload? = nil, + url: Swift.String? = nil, username: Swift.String? = nil, encryptedValue: Swift.String? = nil, keyId: Swift.String? = nil, @@ -1718,6 +1788,7 @@ public enum Operations { selectedRepositoryIds: [Swift.Int]? = nil ) { self.registryType = registryType + self.url = url self.username = username self.encryptedValue = encryptedValue self.keyId = keyId @@ -1726,6 +1797,7 @@ public enum Operations { } public enum CodingKeys: String, CodingKey { case registryType = "registry_type" + case url case username case encryptedValue = "encrypted_value" case keyId = "key_id" diff --git a/Sources/projects-classic/Client.swift b/Sources/projects-classic/Client.swift new file mode 100644 index 00000000000..c8f33335d8c --- /dev/null +++ b/Sources/projects-classic/Client.swift @@ -0,0 +1,2823 @@ +// 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 + } + /// List organization projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects-classic/list-for-org)`. + @available(*, deprecated) + public func projectsClassicListForOrg(_ input: Operations.ProjectsClassicListForOrg.Input) async throws -> Operations.ProjectsClassicListForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicListForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projects", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "state", + value: input.query.state + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsClassicListForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicListForOrg.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.Project].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create an organization project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)`. + @available(*, deprecated) + public func projectsClassicCreateForOrg(_ input: Operations.ProjectsClassicCreateForOrg.Input) async throws -> Operations.ProjectsClassicCreateForOrg.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicCreateForOrg.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/projects", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicCreateForOrg.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Project.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)`. + @available(*, deprecated) + public func projectsClassicGetColumn(_ input: Operations.ProjectsClassicGetColumn.Input) async throws -> Operations.ProjectsClassicGetColumn.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicGetColumn.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/columns/{}", + parameters: [ + input.path.columnId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicGetColumn.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectColumn.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update an existing project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)`. + @available(*, deprecated) + public func projectsClassicUpdateColumn(_ input: Operations.ProjectsClassicUpdateColumn.Input) async throws -> Operations.ProjectsClassicUpdateColumn.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicUpdateColumn.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/columns/{}", + parameters: [ + input.path.columnId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicUpdateColumn.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectColumn.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)`. + @available(*, deprecated) + public func projectsClassicDeleteColumn(_ input: Operations.ProjectsClassicDeleteColumn.Input) async throws -> Operations.ProjectsClassicDeleteColumn.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicDeleteColumn.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/columns/{}", + parameters: [ + input.path.columnId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Move a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)`. + @available(*, deprecated) + public func projectsClassicMoveColumn(_ input: Operations.ProjectsClassicMoveColumn.Input) async throws -> Operations.ProjectsClassicMoveColumn.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicMoveColumn.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/columns/{}/moves", + parameters: [ + input.path.columnId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicMoveColumn.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ProjectsClassicMoveColumn.Output.Created.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)`. + @available(*, deprecated) + public func projectsClassicGet(_ input: Operations.ProjectsClassicGet.Input) async throws -> Operations.ProjectsClassicGet.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicGet.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}", + parameters: [ + input.path.projectId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicGet.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Project.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)`. + @available(*, deprecated) + public func projectsClassicUpdate(_ input: Operations.ProjectsClassicUpdate.Input) async throws -> Operations.ProjectsClassicUpdate.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicUpdate.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}", + parameters: [ + input.path.projectId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case .none: + body = nil + case let .json(value): + body = try converter.setOptionalRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicUpdate.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Project.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + return .notFound(.init()) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicUpdate.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ProjectsClassicUpdate.Output.Forbidden.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)`. + @available(*, deprecated) + public func projectsClassicDelete(_ input: Operations.ProjectsClassicDelete.Input) async throws -> Operations.ProjectsClassicDelete.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicDelete.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}", + parameters: [ + input.path.projectId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicDelete.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ProjectsClassicDelete.Output.Forbidden.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List project collaborators + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)`. + @available(*, deprecated) + public func projectsClassicListCollaborators(_ input: Operations.ProjectsClassicListCollaborators.Input) async throws -> Operations.ProjectsClassicListCollaborators.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicListCollaborators.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}/collaborators", + parameters: [ + input.path.projectId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "affiliation", + value: input.query.affiliation + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsClassicListCollaborators.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicListCollaborators.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.SimpleUser].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add project collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)`. + @available(*, deprecated) + public func projectsClassicAddCollaborator(_ input: Operations.ProjectsClassicAddCollaborator.Input) async throws -> Operations.ProjectsClassicAddCollaborator.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicAddCollaborator.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}/collaborators/{}", + parameters: [ + input.path.projectId, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case .none: + body = nil + case let .json(value): + body = try converter.setOptionalRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove user as a collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)`. + @available(*, deprecated) + public func projectsClassicRemoveCollaborator(_ input: Operations.ProjectsClassicRemoveCollaborator.Input) async throws -> Operations.ProjectsClassicRemoveCollaborator.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicRemoveCollaborator.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}/collaborators/{}", + parameters: [ + input.path.projectId, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 304: + return .notModified(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get project permission for a user + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)`. + @available(*, deprecated) + public func projectsClassicGetPermissionForUser(_ input: Operations.ProjectsClassicGetPermissionForUser.Input) async throws -> Operations.ProjectsClassicGetPermissionForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicGetPermissionForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}/collaborators/{}/permission", + parameters: [ + input.path.projectId, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicGetPermissionForUser.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectCollaboratorPermission.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List project columns + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)`. + @available(*, deprecated) + public func projectsClassicListColumns(_ input: Operations.ProjectsClassicListColumns.Input) async throws -> Operations.ProjectsClassicListColumns.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicListColumns.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}/columns", + parameters: [ + input.path.projectId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsClassicListColumns.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicListColumns.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.ProjectColumn].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)`. + @available(*, deprecated) + public func projectsClassicCreateColumn(_ input: Operations.ProjectsClassicCreateColumn.Input) async throws -> Operations.ProjectsClassicCreateColumn.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicCreateColumn.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/projects/{}/columns", + parameters: [ + input.path.projectId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicCreateColumn.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectColumn.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List repository projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)`. + @available(*, deprecated) + public func projectsClassicListForRepo(_ input: Operations.ProjectsClassicListForRepo.Input) async throws -> Operations.ProjectsClassicListForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicListForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/projects", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "state", + value: input.query.state + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsClassicListForRepo.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicListForRepo.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.Project].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create a repository project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)`. + @available(*, deprecated) + public func projectsClassicCreateForRepo(_ input: Operations.ProjectsClassicCreateForRepo.Input) async throws -> Operations.ProjectsClassicCreateForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicCreateForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/projects", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicCreateForRepo.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Project.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create a user project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /user/projects`. + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)`. + @available(*, deprecated) + public func projectsClassicCreateForAuthenticatedUser(_ input: Operations.ProjectsClassicCreateForAuthenticatedUser.Input) async throws -> Operations.ProjectsClassicCreateForAuthenticatedUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicCreateForAuthenticatedUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/user/projects", + parameters: [] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicCreateForAuthenticatedUser.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Project.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailedSimple.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationErrorSimple.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List user projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /users/{username}/projects`. + /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects-classic/list-for-user)`. + @available(*, deprecated) + public func projectsClassicListForUser(_ input: Operations.ProjectsClassicListForUser.Input) async throws -> Operations.ProjectsClassicListForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsClassicListForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projects", + parameters: [ + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "state", + value: input.query.state + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsClassicListForUser.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsClassicListForUser.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.Project].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } +} diff --git a/Sources/projects-classic/Types.swift b/Sources/projects-classic/Types.swift new file mode 100644 index 00000000000..0777019b336 --- /dev/null +++ b/Sources/projects-classic/Types.swift @@ -0,0 +1,6590 @@ +// 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 { + /// List organization projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects-classic/list-for-org)`. + @available(*, deprecated) + func projectsClassicListForOrg(_ input: Operations.ProjectsClassicListForOrg.Input) async throws -> Operations.ProjectsClassicListForOrg.Output + /// Create an organization project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)`. + @available(*, deprecated) + func projectsClassicCreateForOrg(_ input: Operations.ProjectsClassicCreateForOrg.Input) async throws -> Operations.ProjectsClassicCreateForOrg.Output + /// Get a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)`. + @available(*, deprecated) + func projectsClassicGetColumn(_ input: Operations.ProjectsClassicGetColumn.Input) async throws -> Operations.ProjectsClassicGetColumn.Output + /// Update an existing project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)`. + @available(*, deprecated) + func projectsClassicUpdateColumn(_ input: Operations.ProjectsClassicUpdateColumn.Input) async throws -> Operations.ProjectsClassicUpdateColumn.Output + /// Delete a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)`. + @available(*, deprecated) + func projectsClassicDeleteColumn(_ input: Operations.ProjectsClassicDeleteColumn.Input) async throws -> Operations.ProjectsClassicDeleteColumn.Output + /// Move a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)`. + @available(*, deprecated) + func projectsClassicMoveColumn(_ input: Operations.ProjectsClassicMoveColumn.Input) async throws -> Operations.ProjectsClassicMoveColumn.Output + /// Get a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)`. + @available(*, deprecated) + func projectsClassicGet(_ input: Operations.ProjectsClassicGet.Input) async throws -> Operations.ProjectsClassicGet.Output + /// Update a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)`. + @available(*, deprecated) + func projectsClassicUpdate(_ input: Operations.ProjectsClassicUpdate.Input) async throws -> Operations.ProjectsClassicUpdate.Output + /// Delete a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)`. + @available(*, deprecated) + func projectsClassicDelete(_ input: Operations.ProjectsClassicDelete.Input) async throws -> Operations.ProjectsClassicDelete.Output + /// List project collaborators + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)`. + @available(*, deprecated) + func projectsClassicListCollaborators(_ input: Operations.ProjectsClassicListCollaborators.Input) async throws -> Operations.ProjectsClassicListCollaborators.Output + /// Add project collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)`. + @available(*, deprecated) + func projectsClassicAddCollaborator(_ input: Operations.ProjectsClassicAddCollaborator.Input) async throws -> Operations.ProjectsClassicAddCollaborator.Output + /// Remove user as a collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)`. + @available(*, deprecated) + func projectsClassicRemoveCollaborator(_ input: Operations.ProjectsClassicRemoveCollaborator.Input) async throws -> Operations.ProjectsClassicRemoveCollaborator.Output + /// Get project permission for a user + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)`. + @available(*, deprecated) + func projectsClassicGetPermissionForUser(_ input: Operations.ProjectsClassicGetPermissionForUser.Input) async throws -> Operations.ProjectsClassicGetPermissionForUser.Output + /// List project columns + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)`. + @available(*, deprecated) + func projectsClassicListColumns(_ input: Operations.ProjectsClassicListColumns.Input) async throws -> Operations.ProjectsClassicListColumns.Output + /// Create a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)`. + @available(*, deprecated) + func projectsClassicCreateColumn(_ input: Operations.ProjectsClassicCreateColumn.Input) async throws -> Operations.ProjectsClassicCreateColumn.Output + /// List repository projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)`. + @available(*, deprecated) + func projectsClassicListForRepo(_ input: Operations.ProjectsClassicListForRepo.Input) async throws -> Operations.ProjectsClassicListForRepo.Output + /// Create a repository project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)`. + @available(*, deprecated) + func projectsClassicCreateForRepo(_ input: Operations.ProjectsClassicCreateForRepo.Input) async throws -> Operations.ProjectsClassicCreateForRepo.Output + /// Create a user project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /user/projects`. + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)`. + @available(*, deprecated) + func projectsClassicCreateForAuthenticatedUser(_ input: Operations.ProjectsClassicCreateForAuthenticatedUser.Input) async throws -> Operations.ProjectsClassicCreateForAuthenticatedUser.Output + /// List user projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /users/{username}/projects`. + /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects-classic/list-for-user)`. + @available(*, deprecated) + func projectsClassicListForUser(_ input: Operations.ProjectsClassicListForUser.Input) async throws -> Operations.ProjectsClassicListForUser.Output +} + +/// Convenience overloads for operation inputs. +extension APIProtocol { + /// List organization projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects-classic/list-for-org)`. + @available(*, deprecated) + public func projectsClassicListForOrg( + path: Operations.ProjectsClassicListForOrg.Input.Path, + query: Operations.ProjectsClassicListForOrg.Input.Query = .init(), + headers: Operations.ProjectsClassicListForOrg.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicListForOrg.Output { + try await projectsClassicListForOrg(Operations.ProjectsClassicListForOrg.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create an organization project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)`. + @available(*, deprecated) + public func projectsClassicCreateForOrg( + path: Operations.ProjectsClassicCreateForOrg.Input.Path, + headers: Operations.ProjectsClassicCreateForOrg.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateForOrg.Input.Body + ) async throws -> Operations.ProjectsClassicCreateForOrg.Output { + try await projectsClassicCreateForOrg(Operations.ProjectsClassicCreateForOrg.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)`. + @available(*, deprecated) + public func projectsClassicGetColumn( + path: Operations.ProjectsClassicGetColumn.Input.Path, + headers: Operations.ProjectsClassicGetColumn.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicGetColumn.Output { + try await projectsClassicGetColumn(Operations.ProjectsClassicGetColumn.Input( + path: path, + headers: headers + )) + } + /// Update an existing project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)`. + @available(*, deprecated) + public func projectsClassicUpdateColumn( + path: Operations.ProjectsClassicUpdateColumn.Input.Path, + headers: Operations.ProjectsClassicUpdateColumn.Input.Headers = .init(), + body: Operations.ProjectsClassicUpdateColumn.Input.Body + ) async throws -> Operations.ProjectsClassicUpdateColumn.Output { + try await projectsClassicUpdateColumn(Operations.ProjectsClassicUpdateColumn.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)`. + @available(*, deprecated) + public func projectsClassicDeleteColumn( + path: Operations.ProjectsClassicDeleteColumn.Input.Path, + headers: Operations.ProjectsClassicDeleteColumn.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicDeleteColumn.Output { + try await projectsClassicDeleteColumn(Operations.ProjectsClassicDeleteColumn.Input( + path: path, + headers: headers + )) + } + /// Move a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)`. + @available(*, deprecated) + public func projectsClassicMoveColumn( + path: Operations.ProjectsClassicMoveColumn.Input.Path, + headers: Operations.ProjectsClassicMoveColumn.Input.Headers = .init(), + body: Operations.ProjectsClassicMoveColumn.Input.Body + ) async throws -> Operations.ProjectsClassicMoveColumn.Output { + try await projectsClassicMoveColumn(Operations.ProjectsClassicMoveColumn.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)`. + @available(*, deprecated) + public func projectsClassicGet( + path: Operations.ProjectsClassicGet.Input.Path, + headers: Operations.ProjectsClassicGet.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicGet.Output { + try await projectsClassicGet(Operations.ProjectsClassicGet.Input( + path: path, + headers: headers + )) + } + /// Update a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)`. + @available(*, deprecated) + public func projectsClassicUpdate( + path: Operations.ProjectsClassicUpdate.Input.Path, + headers: Operations.ProjectsClassicUpdate.Input.Headers = .init(), + body: Operations.ProjectsClassicUpdate.Input.Body? = nil + ) async throws -> Operations.ProjectsClassicUpdate.Output { + try await projectsClassicUpdate(Operations.ProjectsClassicUpdate.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)`. + @available(*, deprecated) + public func projectsClassicDelete( + path: Operations.ProjectsClassicDelete.Input.Path, + headers: Operations.ProjectsClassicDelete.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicDelete.Output { + try await projectsClassicDelete(Operations.ProjectsClassicDelete.Input( + path: path, + headers: headers + )) + } + /// List project collaborators + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)`. + @available(*, deprecated) + public func projectsClassicListCollaborators( + path: Operations.ProjectsClassicListCollaborators.Input.Path, + query: Operations.ProjectsClassicListCollaborators.Input.Query = .init(), + headers: Operations.ProjectsClassicListCollaborators.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicListCollaborators.Output { + try await projectsClassicListCollaborators(Operations.ProjectsClassicListCollaborators.Input( + path: path, + query: query, + headers: headers + )) + } + /// Add project collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)`. + @available(*, deprecated) + public func projectsClassicAddCollaborator( + path: Operations.ProjectsClassicAddCollaborator.Input.Path, + headers: Operations.ProjectsClassicAddCollaborator.Input.Headers = .init(), + body: Operations.ProjectsClassicAddCollaborator.Input.Body? = nil + ) async throws -> Operations.ProjectsClassicAddCollaborator.Output { + try await projectsClassicAddCollaborator(Operations.ProjectsClassicAddCollaborator.Input( + path: path, + headers: headers, + body: body + )) + } + /// Remove user as a collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)`. + @available(*, deprecated) + public func projectsClassicRemoveCollaborator( + path: Operations.ProjectsClassicRemoveCollaborator.Input.Path, + headers: Operations.ProjectsClassicRemoveCollaborator.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicRemoveCollaborator.Output { + try await projectsClassicRemoveCollaborator(Operations.ProjectsClassicRemoveCollaborator.Input( + path: path, + headers: headers + )) + } + /// Get project permission for a user + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)`. + @available(*, deprecated) + public func projectsClassicGetPermissionForUser( + path: Operations.ProjectsClassicGetPermissionForUser.Input.Path, + headers: Operations.ProjectsClassicGetPermissionForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicGetPermissionForUser.Output { + try await projectsClassicGetPermissionForUser(Operations.ProjectsClassicGetPermissionForUser.Input( + path: path, + headers: headers + )) + } + /// List project columns + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)`. + @available(*, deprecated) + public func projectsClassicListColumns( + path: Operations.ProjectsClassicListColumns.Input.Path, + query: Operations.ProjectsClassicListColumns.Input.Query = .init(), + headers: Operations.ProjectsClassicListColumns.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicListColumns.Output { + try await projectsClassicListColumns(Operations.ProjectsClassicListColumns.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)`. + @available(*, deprecated) + public func projectsClassicCreateColumn( + path: Operations.ProjectsClassicCreateColumn.Input.Path, + headers: Operations.ProjectsClassicCreateColumn.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateColumn.Input.Body + ) async throws -> Operations.ProjectsClassicCreateColumn.Output { + try await projectsClassicCreateColumn(Operations.ProjectsClassicCreateColumn.Input( + path: path, + headers: headers, + body: body + )) + } + /// List repository projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)`. + @available(*, deprecated) + public func projectsClassicListForRepo( + path: Operations.ProjectsClassicListForRepo.Input.Path, + query: Operations.ProjectsClassicListForRepo.Input.Query = .init(), + headers: Operations.ProjectsClassicListForRepo.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicListForRepo.Output { + try await projectsClassicListForRepo(Operations.ProjectsClassicListForRepo.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create a repository project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)`. + @available(*, deprecated) + public func projectsClassicCreateForRepo( + path: Operations.ProjectsClassicCreateForRepo.Input.Path, + headers: Operations.ProjectsClassicCreateForRepo.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateForRepo.Input.Body + ) async throws -> Operations.ProjectsClassicCreateForRepo.Output { + try await projectsClassicCreateForRepo(Operations.ProjectsClassicCreateForRepo.Input( + path: path, + headers: headers, + body: body + )) + } + /// Create a user project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /user/projects`. + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)`. + @available(*, deprecated) + public func projectsClassicCreateForAuthenticatedUser( + headers: Operations.ProjectsClassicCreateForAuthenticatedUser.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateForAuthenticatedUser.Input.Body + ) async throws -> Operations.ProjectsClassicCreateForAuthenticatedUser.Output { + try await projectsClassicCreateForAuthenticatedUser(Operations.ProjectsClassicCreateForAuthenticatedUser.Input( + headers: headers, + body: body + )) + } + /// List user projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /users/{username}/projects`. + /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects-classic/list-for-user)`. + @available(*, deprecated) + public func projectsClassicListForUser( + path: Operations.ProjectsClassicListForUser.Input.Path, + query: Operations.ProjectsClassicListForUser.Input.Query = .init(), + headers: Operations.ProjectsClassicListForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsClassicListForUser.Output { + try await projectsClassicListForUser(Operations.ProjectsClassicListForUser.Input( + path: path, + query: query, + headers: headers + )) + } +} + +/// 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 { + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/simple-user`. + public struct SimpleUser: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/simple-user/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/avatar_url`. + public var avatarUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/gravatar_id`. + public var gravatarId: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/followers_url`. + public var followersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/following_url`. + public var followingUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/gists_url`. + public var gistsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/starred_url`. + public var starredUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/subscriptions_url`. + public var subscriptionsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/organizations_url`. + public var organizationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/repos_url`. + public var reposUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/received_events_url`. + public var receivedEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/site_admin`. + public var siteAdmin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. + public var starredAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `SimpleUser`. + /// + /// - Parameters: + /// - name: + /// - email: + /// - login: + /// - id: + /// - nodeId: + /// - avatarUrl: + /// - gravatarId: + /// - url: + /// - htmlUrl: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - starredUrl: + /// - subscriptionsUrl: + /// - organizationsUrl: + /// - reposUrl: + /// - eventsUrl: + /// - receivedEventsUrl: + /// - _type: + /// - siteAdmin: + /// - starredAt: + /// - userViewType: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + avatarUrl: Swift.String, + gravatarId: Swift.String? = nil, + url: Swift.String, + htmlUrl: Swift.String, + followersUrl: Swift.String, + followingUrl: Swift.String, + gistsUrl: Swift.String, + starredUrl: Swift.String, + subscriptionsUrl: Swift.String, + organizationsUrl: Swift.String, + reposUrl: Swift.String, + eventsUrl: Swift.String, + receivedEventsUrl: Swift.String, + _type: Swift.String, + siteAdmin: Swift.Bool, + starredAt: Swift.String? = nil, + userViewType: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.nodeId = nodeId + self.avatarUrl = avatarUrl + self.gravatarId = gravatarId + self.url = url + self.htmlUrl = htmlUrl + self.followersUrl = followersUrl + self.followingUrl = followingUrl + self.gistsUrl = gistsUrl + self.starredUrl = starredUrl + self.subscriptionsUrl = subscriptionsUrl + self.organizationsUrl = organizationsUrl + self.reposUrl = reposUrl + self.eventsUrl = eventsUrl + self.receivedEventsUrl = receivedEventsUrl + self._type = _type + self.siteAdmin = siteAdmin + self.starredAt = starredAt + self.userViewType = userViewType + } + public enum CodingKeys: String, CodingKey { + case name + case email + case login + case id + case nodeId = "node_id" + case avatarUrl = "avatar_url" + case gravatarId = "gravatar_id" + case url + case htmlUrl = "html_url" + case followersUrl = "followers_url" + case followingUrl = "following_url" + case gistsUrl = "gists_url" + case starredUrl = "starred_url" + case subscriptionsUrl = "subscriptions_url" + case organizationsUrl = "organizations_url" + case reposUrl = "repos_url" + case eventsUrl = "events_url" + case receivedEventsUrl = "received_events_url" + case _type = "type" + case siteAdmin = "site_admin" + case starredAt = "starred_at" + case userViewType = "user_view_type" + } + } + /// Basic Error + /// + /// - Remark: Generated from `#/components/schemas/basic-error`. + public struct BasicError: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/basic-error/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/status`. + public var status: Swift.String? + /// Creates a new `BasicError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - url: + /// - status: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + url: Swift.String? = nil, + status: Swift.String? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.url = url + self.status = status + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case url + case status + } + } + /// Validation Error Simple + /// + /// - Remark: Generated from `#/components/schemas/validation-error-simple`. + public struct ValidationErrorSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error-simple/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error-simple/documentation_url`. + public var documentationUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error-simple/errors`. + public var errors: [Swift.String]? + /// Creates a new `ValidationErrorSimple`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String, + documentationUrl: Swift.String, + errors: [Swift.String]? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// Validation Error + /// + /// - Remark: Generated from `#/components/schemas/validation-error`. + public struct ValidationError: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. + public var documentationUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/field`. + public var field: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/code`. + public var code: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/index`. + public var index: Swift.Int? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case1`. + case case1(Swift.String?) + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case2`. + case case2(Swift.Int?) + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. + case case3([Swift.String]?) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value`. + public var value: Components.Schemas.ValidationError.ErrorsPayloadPayload.ValuePayload? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - resource: + /// - field: + /// - message: + /// - code: + /// - index: + /// - value: + public init( + resource: Swift.String? = nil, + field: Swift.String? = nil, + message: Swift.String? = nil, + code: Swift.String, + index: Swift.Int? = nil, + value: Components.Schemas.ValidationError.ErrorsPayloadPayload.ValuePayload? = nil + ) { + self.resource = resource + self.field = field + self.message = message + self.code = code + self.index = index + self.value = value + } + public enum CodingKeys: String, CodingKey { + case resource + case field + case message + case code + case index + case value + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public typealias ErrorsPayload = [Components.Schemas.ValidationError.ErrorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public var errors: Components.Schemas.ValidationError.ErrorsPayload? + /// Creates a new `ValidationError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String, + documentationUrl: Swift.String, + errors: Components.Schemas.ValidationError.ErrorsPayload? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. + public struct NullableSimpleUser: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/avatar_url`. + public var avatarUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gravatar_id`. + public var gravatarId: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/followers_url`. + public var followersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/following_url`. + public var followingUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/gists_url`. + public var gistsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_url`. + public var starredUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/subscriptions_url`. + public var subscriptionsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/organizations_url`. + public var organizationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/repos_url`. + public var reposUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/received_events_url`. + public var receivedEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/site_admin`. + public var siteAdmin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/starred_at`. + public var starredAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-simple-user/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `NullableSimpleUser`. + /// + /// - Parameters: + /// - name: + /// - email: + /// - login: + /// - id: + /// - nodeId: + /// - avatarUrl: + /// - gravatarId: + /// - url: + /// - htmlUrl: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - starredUrl: + /// - subscriptionsUrl: + /// - organizationsUrl: + /// - reposUrl: + /// - eventsUrl: + /// - receivedEventsUrl: + /// - _type: + /// - siteAdmin: + /// - starredAt: + /// - userViewType: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + avatarUrl: Swift.String, + gravatarId: Swift.String? = nil, + url: Swift.String, + htmlUrl: Swift.String, + followersUrl: Swift.String, + followingUrl: Swift.String, + gistsUrl: Swift.String, + starredUrl: Swift.String, + subscriptionsUrl: Swift.String, + organizationsUrl: Swift.String, + reposUrl: Swift.String, + eventsUrl: Swift.String, + receivedEventsUrl: Swift.String, + _type: Swift.String, + siteAdmin: Swift.Bool, + starredAt: Swift.String? = nil, + userViewType: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.nodeId = nodeId + self.avatarUrl = avatarUrl + self.gravatarId = gravatarId + self.url = url + self.htmlUrl = htmlUrl + self.followersUrl = followersUrl + self.followingUrl = followingUrl + self.gistsUrl = gistsUrl + self.starredUrl = starredUrl + self.subscriptionsUrl = subscriptionsUrl + self.organizationsUrl = organizationsUrl + self.reposUrl = reposUrl + self.eventsUrl = eventsUrl + self.receivedEventsUrl = receivedEventsUrl + self._type = _type + self.siteAdmin = siteAdmin + self.starredAt = starredAt + self.userViewType = userViewType + } + public enum CodingKeys: String, CodingKey { + case name + case email + case login + case id + case nodeId = "node_id" + case avatarUrl = "avatar_url" + case gravatarId = "gravatar_id" + case url + case htmlUrl = "html_url" + case followersUrl = "followers_url" + case followingUrl = "following_url" + case gistsUrl = "gists_url" + case starredUrl = "starred_url" + case subscriptionsUrl = "subscriptions_url" + case organizationsUrl = "organizations_url" + case reposUrl = "repos_url" + case eventsUrl = "events_url" + case receivedEventsUrl = "received_events_url" + case _type = "type" + case siteAdmin = "site_admin" + case starredAt = "starred_at" + case userViewType = "user_view_type" + } + } + /// Projects are a way to organize columns and cards of work. + /// + /// - Remark: Generated from `#/components/schemas/project`. + public struct Project: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/project/owner_url`. + public var ownerUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/project/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/project/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/project/columns_url`. + public var columnsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/project/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/project/node_id`. + public var nodeId: Swift.String + /// Name of the project + /// + /// - Remark: Generated from `#/components/schemas/project/name`. + public var name: Swift.String + /// Body of the project + /// + /// - Remark: Generated from `#/components/schemas/project/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/project/number`. + public var number: Swift.Int + /// State of the project; either 'open' or 'closed' + /// + /// - Remark: Generated from `#/components/schemas/project/state`. + public var state: Swift.String + /// - Remark: Generated from `#/components/schemas/project/creator`. + public var creator: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/project/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/project/updated_at`. + public var updatedAt: Foundation.Date + /// The baseline permission that all organization members have on this project. Only present if owner is an organization. + /// + /// - Remark: Generated from `#/components/schemas/project/organization_permission`. + @frozen public enum OrganizationPermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + case admin = "admin" + case none = "none" + } + /// The baseline permission that all organization members have on this project. Only present if owner is an organization. + /// + /// - Remark: Generated from `#/components/schemas/project/organization_permission`. + public var organizationPermission: Components.Schemas.Project.OrganizationPermissionPayload? + /// Whether or not this project can be seen by everyone. Only present if owner is an organization. + /// + /// - Remark: Generated from `#/components/schemas/project/private`. + public var _private: Swift.Bool? + /// Creates a new `Project`. + /// + /// - Parameters: + /// - ownerUrl: + /// - url: + /// - htmlUrl: + /// - columnsUrl: + /// - id: + /// - nodeId: + /// - name: Name of the project + /// - body: Body of the project + /// - number: + /// - state: State of the project; either 'open' or 'closed' + /// - creator: + /// - createdAt: + /// - updatedAt: + /// - organizationPermission: The baseline permission that all organization members have on this project. Only present if owner is an organization. + /// - _private: Whether or not this project can be seen by everyone. Only present if owner is an organization. + public init( + ownerUrl: Swift.String, + url: Swift.String, + htmlUrl: Swift.String, + columnsUrl: Swift.String, + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + body: Swift.String? = nil, + number: Swift.Int, + state: Swift.String, + creator: Components.Schemas.NullableSimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + organizationPermission: Components.Schemas.Project.OrganizationPermissionPayload? = nil, + _private: Swift.Bool? = nil + ) { + self.ownerUrl = ownerUrl + self.url = url + self.htmlUrl = htmlUrl + self.columnsUrl = columnsUrl + self.id = id + self.nodeId = nodeId + self.name = name + self.body = body + self.number = number + self.state = state + self.creator = creator + self.createdAt = createdAt + self.updatedAt = updatedAt + self.organizationPermission = organizationPermission + self._private = _private + } + public enum CodingKeys: String, CodingKey { + case ownerUrl = "owner_url" + case url + case htmlUrl = "html_url" + case columnsUrl = "columns_url" + case id + case nodeId = "node_id" + case name + case body + case number + case state + case creator + case createdAt = "created_at" + case updatedAt = "updated_at" + case organizationPermission = "organization_permission" + case _private = "private" + } + } + /// Project columns contain cards of work. + /// + /// - Remark: Generated from `#/components/schemas/project-column`. + public struct ProjectColumn: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/project-column/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/project-column/project_url`. + public var projectUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/project-column/cards_url`. + public var cardsUrl: Swift.String + /// The unique identifier of the project column + /// + /// - Remark: Generated from `#/components/schemas/project-column/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/project-column/node_id`. + public var nodeId: Swift.String + /// Name of the project column + /// + /// - Remark: Generated from `#/components/schemas/project-column/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/project-column/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/project-column/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `ProjectColumn`. + /// + /// - Parameters: + /// - url: + /// - projectUrl: + /// - cardsUrl: + /// - id: The unique identifier of the project column + /// - nodeId: + /// - name: Name of the project column + /// - createdAt: + /// - updatedAt: + public init( + url: Swift.String, + projectUrl: Swift.String, + cardsUrl: Swift.String, + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.url = url + self.projectUrl = projectUrl + self.cardsUrl = cardsUrl + self.id = id + self.nodeId = nodeId + self.name = name + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case url + case projectUrl = "project_url" + case cardsUrl = "cards_url" + case id + case nodeId = "node_id" + case name + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + /// Project Collaborator Permission + /// + /// - Remark: Generated from `#/components/schemas/project-collaborator-permission`. + public struct ProjectCollaboratorPermission: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/project-collaborator-permission/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/project-collaborator-permission/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `ProjectCollaboratorPermission`. + /// + /// - Parameters: + /// - permission: + /// - user: + public init( + permission: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil + ) { + self.permission = permission + self.user = user + } + public enum CodingKeys: String, CodingKey { + case permission + case user + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/components/parameters/per-page`. + public typealias PerPage = Swift.Int + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/components/parameters/page`. + public typealias Page = Swift.Int + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/owner`. + public typealias Owner = Swift.String + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/repo`. + public typealias Repo = Swift.String + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/components/parameters/project-id`. + public typealias ProjectId = Swift.Int + /// The unique identifier of the column. + /// + /// - Remark: Generated from `#/components/parameters/column-id`. + public typealias ColumnId = Swift.Int + } + /// 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 { + public struct ValidationFailedSimple: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. + case json(Components.Schemas.ValidationErrorSimple) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationErrorSimple { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailedSimple.Body + /// Creates a new `ValidationFailedSimple`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailedSimple.Body) { + self.body = body + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.NotFound.Body) { + self.body = body + } + } + public struct ValidationFailed: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content/application\/json`. + case json(Components.Schemas.ValidationError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailed.Body + /// Creates a new `ValidationFailed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailed.Body) { + self.body = body + } + } + public struct NotModified: Sendable, Hashable { + /// Creates a new `NotModified`. + public init() {} + } + public struct RequiresAuthentication: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.RequiresAuthentication.Body + /// Creates a new `RequiresAuthentication`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.RequiresAuthentication.Body) { + self.body = body + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Forbidden.Body) { + self.body = body + } + } + public struct Gone: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/gone/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/gone/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Gone.Body + /// Creates a new `Gone`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Gone.Body) { + self.body = body + } + } + } + /// Types generated from the `#/components/headers` section of the OpenAPI document. + public enum Headers { + /// - Remark: Generated from `#/components/headers/link`. + public typealias Link = Swift.String + } +} + +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations { + /// List organization projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects-classic/list-for-org)`. + public enum ProjectsClassicListForOrg { + public static let id: Swift.String = "projects-classic/list-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ProjectsClassicListForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + case all = "all" + } + /// Indicates the state of the projects to return. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query/state`. + public var state: Operations.ProjectsClassicListForOrg.Input.Query.StatePayload? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - state: Indicates the state of the projects to return. + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + state: Operations.ProjectsClassicListForOrg.Input.Query.StatePayload? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.state = state + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ProjectsClassicListForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicListForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsClassicListForOrg.Input.Path, + query: Operations.ProjectsClassicListForOrg.Input.Query = .init(), + headers: Operations.ProjectsClassicListForOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsClassicListForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Project]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.Project] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicListForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsClassicListForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsClassicListForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects-classic/list-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicListForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsClassicListForOrg.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects-classic/list-for-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create an organization project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /orgs/{org}/projects`. + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)`. + public enum ProjectsClassicCreateForOrg { + public static let id: Swift.String = "projects-classic/create-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ProjectsClassicCreateForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicCreateForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the project. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/json/name`. + public var name: Swift.String + /// The description of the project. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/json/body`. + public var body: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the project. + /// - body: The description of the project. + public init( + name: Swift.String, + body: Swift.String? = nil + ) { + self.name = name + self.body = body + } + public enum CodingKeys: String, CodingKey { + case name + case body + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicCreateForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicCreateForOrg.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicCreateForOrg.Input.Path, + headers: Operations.ProjectsClassicCreateForOrg.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateForOrg.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/responses/201/content/application\/json`. + case json(Components.Schemas.Project) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Project { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicCreateForOrg.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicCreateForOrg.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsClassicCreateForOrg.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsClassicCreateForOrg.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects-classic/create-for-org)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)`. + public enum ProjectsClassicGetColumn { + public static let id: Swift.String = "projects-classic/get-column" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the column. + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/path/column_id`. + public var columnId: Components.Parameters.ColumnId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - columnId: The unique identifier of the column. + public init(columnId: Components.Parameters.ColumnId) { + self.columnId = columnId + } + } + public var path: Operations.ProjectsClassicGetColumn.Input.Path + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicGetColumn.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsClassicGetColumn.Input.Path, + headers: Operations.ProjectsClassicGetColumn.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectColumn) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectColumn { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicGetColumn.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicGetColumn.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicGetColumn.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsClassicGetColumn.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects-classic/get-column)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update an existing project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)`. + public enum ProjectsClassicUpdateColumn { + public static let id: Swift.String = "projects-classic/update-column" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the column. + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/path/column_id`. + public var columnId: Components.Parameters.ColumnId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - columnId: The unique identifier of the column. + public init(columnId: Components.Parameters.ColumnId) { + self.columnId = columnId + } + } + public var path: Operations.ProjectsClassicUpdateColumn.Input.Path + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicUpdateColumn.Input.Headers + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Name of the project column + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody/json/name`. + public var name: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: Name of the project column + public init(name: Swift.String) { + self.name = name + } + public enum CodingKeys: String, CodingKey { + case name + } + } + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicUpdateColumn.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicUpdateColumn.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicUpdateColumn.Input.Path, + headers: Operations.ProjectsClassicUpdateColumn.Input.Headers = .init(), + body: Operations.ProjectsClassicUpdateColumn.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectColumn) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectColumn { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicUpdateColumn.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicUpdateColumn.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicUpdateColumn.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsClassicUpdateColumn.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects-classic/update-column)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)`. + public enum ProjectsClassicDeleteColumn { + public static let id: Swift.String = "projects-classic/delete-column" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the column. + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/DELETE/path/column_id`. + public var columnId: Components.Parameters.ColumnId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - columnId: The unique identifier of the column. + public init(columnId: Components.Parameters.ColumnId) { + self.columnId = columnId + } + } + public var path: Operations.ProjectsClassicDeleteColumn.Input.Path + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicDeleteColumn.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsClassicDeleteColumn.Input.Path, + headers: Operations.ProjectsClassicDeleteColumn.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsClassicDeleteColumn.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsClassicDeleteColumn.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects-classic/delete-column)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Move a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)`. + public enum ProjectsClassicMoveColumn { + public static let id: Swift.String = "projects-classic/move-column" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the column. + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/path/column_id`. + public var columnId: Components.Parameters.ColumnId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - columnId: The unique identifier of the column. + public init(columnId: Components.Parameters.ColumnId) { + self.columnId = columnId + } + } + public var path: Operations.ProjectsClassicMoveColumn.Input.Path + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicMoveColumn.Input.Headers + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column. + /// + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody/json/position`. + public var position: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - position: The position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column. + public init(position: Swift.String) { + self.position = position + } + public enum CodingKeys: String, CodingKey { + case position + } + } + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicMoveColumn.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicMoveColumn.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicMoveColumn.Input.Path, + headers: Operations.ProjectsClassicMoveColumn.Input.Headers = .init(), + body: Operations.ProjectsClassicMoveColumn.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/responses/201/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Creates a new `JsonPayload`. + public init() {} + public init(from decoder: any Decoder) throws { + try decoder.ensureNoAdditionalProperties(knownKeys: []) + } + } + /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/responses/201/content/application\/json`. + case json(Operations.ProjectsClassicMoveColumn.Output.Created.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ProjectsClassicMoveColumn.Output.Created.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicMoveColumn.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicMoveColumn.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsClassicMoveColumn.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsClassicMoveColumn.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects-classic/move-column)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)`. + public enum ProjectsClassicGet { + public static let id: Swift.String = "projects-classic/get" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/GET/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + public init(projectId: Components.Parameters.ProjectId) { + self.projectId = projectId + } + } + public var path: Operations.ProjectsClassicGet.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicGet.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsClassicGet.Input.Path, + headers: Operations.ProjectsClassicGet.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.Project) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Project { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicGet.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicGet.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicGet.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsClassicGet.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects-classic/get)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PATCH /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)`. + public enum ProjectsClassicUpdate { + public static let id: Swift.String = "projects-classic/update" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + public init(projectId: Components.Parameters.ProjectId) { + self.projectId = projectId + } + } + public var path: Operations.ProjectsClassicUpdate.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicUpdate.Input.Headers + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Name of the project + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// Body of the project + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/body`. + public var body: Swift.String? + /// State of the project; either 'open' or 'closed' + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/state`. + public var state: Swift.String? + /// The baseline permission that all organization members have on this project + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/organization_permission`. + @frozen public enum OrganizationPermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + case admin = "admin" + case none = "none" + } + /// The baseline permission that all organization members have on this project + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/organization_permission`. + public var organizationPermission: Operations.ProjectsClassicUpdate.Input.Body.JsonPayload.OrganizationPermissionPayload? + /// Whether or not this project can be seen by everyone. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/private`. + public var _private: Swift.Bool? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: Name of the project + /// - body: Body of the project + /// - state: State of the project; either 'open' or 'closed' + /// - organizationPermission: The baseline permission that all organization members have on this project + /// - _private: Whether or not this project can be seen by everyone. + public init( + name: Swift.String? = nil, + body: Swift.String? = nil, + state: Swift.String? = nil, + organizationPermission: Operations.ProjectsClassicUpdate.Input.Body.JsonPayload.OrganizationPermissionPayload? = nil, + _private: Swift.Bool? = nil + ) { + self.name = name + self.body = body + self.state = state + self.organizationPermission = organizationPermission + self._private = _private + } + public enum CodingKeys: String, CodingKey { + case name + case body + case state + case organizationPermission = "organization_permission" + case _private = "private" + } + } + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicUpdate.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicUpdate.Input.Body? + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicUpdate.Input.Path, + headers: Operations.ProjectsClassicUpdate.Input.Headers = .init(), + body: Operations.ProjectsClassicUpdate.Input.Body? = nil + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.Project) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Project { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicUpdate.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicUpdate.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicUpdate.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsClassicUpdate.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Not Found if the authenticated user does not have access to the project + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.ProjectsClassicUpdate.Output.NotFound) + /// Not Found if the authenticated user does not have access to the project + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.ProjectsClassicUpdate.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json/errors`. + public var errors: [Swift.String]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + errors: [Swift.String]? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/application\/json`. + case json(Operations.ProjectsClassicUpdate.Output.Forbidden.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ProjectsClassicUpdate.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicUpdate.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicUpdate.Output.Forbidden.Body) { + self.body = body + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.ProjectsClassicUpdate.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.ProjectsClassicUpdate.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects-classic/update)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete a project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)`. + public enum ProjectsClassicDelete { + public static let id: Swift.String = "projects-classic/delete" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + public init(projectId: Components.Parameters.ProjectId) { + self.projectId = projectId + } + } + public var path: Operations.ProjectsClassicDelete.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicDelete.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsClassicDelete.Input.Path, + headers: Operations.ProjectsClassicDelete.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Delete Success + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsClassicDelete.Output.NoContent) + /// Delete Success + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsClassicDelete.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json/errors`. + public var errors: [Swift.String]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + errors: [Swift.String]? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/application\/json`. + case json(Operations.ProjectsClassicDelete.Output.Forbidden.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ProjectsClassicDelete.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicDelete.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicDelete.Output.Forbidden.Body) { + self.body = body + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.ProjectsClassicDelete.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.ProjectsClassicDelete.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects-classic/delete)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List project collaborators + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)`. + public enum ProjectsClassicListCollaborators { + public static let id: Swift.String = "projects-classic/list-collaborators" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + public init(projectId: Components.Parameters.ProjectId) { + self.projectId = projectId + } + } + public var path: Operations.ProjectsClassicListCollaborators.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query/affiliation`. + @frozen public enum AffiliationPayload: String, Codable, Hashable, Sendable, CaseIterable { + case outside = "outside" + case direct = "direct" + case all = "all" + } + /// Filters the collaborators by their affiliation. `outside` means outside collaborators of a project that are not a member of the project's organization. `direct` means collaborators with permissions to a project, regardless of organization membership status. `all` means all collaborators the authenticated user can see. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query/affiliation`. + public var affiliation: Operations.ProjectsClassicListCollaborators.Input.Query.AffiliationPayload? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - affiliation: Filters the collaborators by their affiliation. `outside` means outside collaborators of a project that are not a member of the project's organization. `direct` means collaborators with permissions to a project, regardless of organization membership status. `all` means all collaborators the authenticated user can see. + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + affiliation: Operations.ProjectsClassicListCollaborators.Input.Query.AffiliationPayload? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.affiliation = affiliation + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ProjectsClassicListCollaborators.Input.Query + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicListCollaborators.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsClassicListCollaborators.Input.Path, + query: Operations.ProjectsClassicListCollaborators.Input.Query = .init(), + headers: Operations.ProjectsClassicListCollaborators.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsClassicListCollaborators.Output.Ok.Headers + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.SimpleUser] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicListCollaborators.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsClassicListCollaborators.Output.Ok.Headers = .init(), + body: Operations.ProjectsClassicListCollaborators.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicListCollaborators.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsClassicListCollaborators.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects-classic/list-collaborators)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Add project collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)`. + public enum ProjectsClassicAddCollaborator { + public static let id: Swift.String = "projects-classic/add-collaborator" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + /// - username: The handle for the GitHub user account. + public init( + projectId: Components.Parameters.ProjectId, + username: Components.Parameters.Username + ) { + self.projectId = projectId + self.username = username + } + } + public var path: Operations.ProjectsClassicAddCollaborator.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicAddCollaborator.Input.Headers + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The permission to grant the collaborator. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/json/permission`. + @frozen public enum PermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case read = "read" + case write = "write" + case admin = "admin" + } + /// The permission to grant the collaborator. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/json/permission`. + public var permission: Operations.ProjectsClassicAddCollaborator.Input.Body.JsonPayload.PermissionPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - permission: The permission to grant the collaborator. + public init(permission: Operations.ProjectsClassicAddCollaborator.Input.Body.JsonPayload.PermissionPayload? = nil) { + self.permission = permission + } + public enum CodingKeys: String, CodingKey { + case permission + } + } + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicAddCollaborator.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicAddCollaborator.Input.Body? + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicAddCollaborator.Input.Path, + headers: Operations.ProjectsClassicAddCollaborator.Input.Headers = .init(), + body: Operations.ProjectsClassicAddCollaborator.Input.Body? = nil + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsClassicAddCollaborator.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsClassicAddCollaborator.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects-classic/add-collaborator)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Remove user as a collaborator + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)`. + public enum ProjectsClassicRemoveCollaborator { + public static let id: Swift.String = "projects-classic/remove-collaborator" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/DELETE/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/DELETE/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + /// - username: The handle for the GitHub user account. + public init( + projectId: Components.Parameters.ProjectId, + username: Components.Parameters.Username + ) { + self.projectId = projectId + self.username = username + } + } + public var path: Operations.ProjectsClassicRemoveCollaborator.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicRemoveCollaborator.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsClassicRemoveCollaborator.Input.Path, + headers: Operations.ProjectsClassicRemoveCollaborator.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsClassicRemoveCollaborator.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsClassicRemoveCollaborator.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects-classic/remove-collaborator)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get project permission for a user + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)`. + public enum ProjectsClassicGetPermissionForUser { + public static let id: Swift.String = "projects-classic/get-permission-for-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + /// - username: The handle for the GitHub user account. + public init( + projectId: Components.Parameters.ProjectId, + username: Components.Parameters.Username + ) { + self.projectId = projectId + self.username = username + } + } + public var path: Operations.ProjectsClassicGetPermissionForUser.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicGetPermissionForUser.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsClassicGetPermissionForUser.Input.Path, + headers: Operations.ProjectsClassicGetPermissionForUser.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectCollaboratorPermission) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectCollaboratorPermission { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicGetPermissionForUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicGetPermissionForUser.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicGetPermissionForUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsClassicGetPermissionForUser.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects-classic/get-permission-for-user)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List project columns + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)`. + public enum ProjectsClassicListColumns { + public static let id: Swift.String = "projects-classic/list-columns" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + public init(projectId: Components.Parameters.ProjectId) { + self.projectId = projectId + } + } + public var path: Operations.ProjectsClassicListColumns.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ProjectsClassicListColumns.Input.Query + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicListColumns.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsClassicListColumns.Input.Path, + query: Operations.ProjectsClassicListColumns.Input.Query = .init(), + headers: Operations.ProjectsClassicListColumns.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsClassicListColumns.Output.Ok.Headers + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectColumn]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.ProjectColumn] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicListColumns.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsClassicListColumns.Output.Ok.Headers = .init(), + body: Operations.ProjectsClassicListColumns.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicListColumns.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsClassicListColumns.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects-classic/list-columns)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create a project column + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /projects/{project_id}/columns`. + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)`. + public enum ProjectsClassicCreateColumn { + public static let id: Swift.String = "projects-classic/create-column" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the project. + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/path/project_id`. + public var projectId: Components.Parameters.ProjectId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectId: The unique identifier of the project. + public init(projectId: Components.Parameters.ProjectId) { + self.projectId = projectId + } + } + public var path: Operations.ProjectsClassicCreateColumn.Input.Path + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicCreateColumn.Input.Headers + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Name of the project column + /// + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody/json/name`. + public var name: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: Name of the project column + public init(name: Swift.String) { + self.name = name + } + public enum CodingKeys: String, CodingKey { + case name + } + } + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicCreateColumn.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicCreateColumn.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicCreateColumn.Input.Path, + headers: Operations.ProjectsClassicCreateColumn.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateColumn.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectColumn) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectColumn { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicCreateColumn.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicCreateColumn.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsClassicCreateColumn.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsClassicCreateColumn.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects-classic/create-column)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List repository projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)`. + public enum ProjectsClassicListForRepo { + public static let id: Swift.String = "projects-classic/list-for-repo" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ProjectsClassicListForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + case all = "all" + } + /// Indicates the state of the projects to return. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query/state`. + public var state: Operations.ProjectsClassicListForRepo.Input.Query.StatePayload? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - state: Indicates the state of the projects to return. + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + state: Operations.ProjectsClassicListForRepo.Input.Query.StatePayload? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.state = state + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ProjectsClassicListForRepo.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicListForRepo.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsClassicListForRepo.Input.Path, + query: Operations.ProjectsClassicListForRepo.Input.Query = .init(), + headers: Operations.ProjectsClassicListForRepo.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsClassicListForRepo.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Project]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.Project] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicListForRepo.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsClassicListForRepo.Output.Ok.Headers = .init(), + body: Operations.ProjectsClassicListForRepo.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicListForRepo.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsClassicListForRepo.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects-classic/list-for-repo)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create a repository project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)`. + public enum ProjectsClassicCreateForRepo { + public static let id: Swift.String = "projects-classic/create-for-repo" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ProjectsClassicCreateForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicCreateForRepo.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the project. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/json/name`. + public var name: Swift.String + /// The description of the project. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/json/body`. + public var body: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the project. + /// - body: The description of the project. + public init( + name: Swift.String, + body: Swift.String? = nil + ) { + self.name = name + self.body = body + } + public enum CodingKeys: String, CodingKey { + case name + case body + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicCreateForRepo.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicCreateForRepo.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.ProjectsClassicCreateForRepo.Input.Path, + headers: Operations.ProjectsClassicCreateForRepo.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateForRepo.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/responses/201/content/application\/json`. + case json(Components.Schemas.Project) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Project { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicCreateForRepo.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicCreateForRepo.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsClassicCreateForRepo.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsClassicCreateForRepo.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects-classic/create-for-repo)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create a user project + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `POST /user/projects`. + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)`. + public enum ProjectsClassicCreateForAuthenticatedUser { + public static let id: Swift.String = "projects-classic/create-for-authenticated-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/user/projects/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicCreateForAuthenticatedUser.Input.Headers + /// - Remark: Generated from `#/paths/user/projects/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Name of the project + /// + /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/json/name`. + public var name: Swift.String + /// Body of the project + /// + /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/json/body`. + public var body: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: Name of the project + /// - body: Body of the project + public init( + name: Swift.String, + body: Swift.String? = nil + ) { + self.name = name + self.body = body + } + public enum CodingKeys: String, CodingKey { + case name + case body + } + } + /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsClassicCreateForAuthenticatedUser.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsClassicCreateForAuthenticatedUser.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - headers: + /// - body: + public init( + headers: Operations.ProjectsClassicCreateForAuthenticatedUser.Input.Headers = .init(), + body: Operations.ProjectsClassicCreateForAuthenticatedUser.Input.Body + ) { + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/user/projects/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/user/projects/POST/responses/201/content/application\/json`. + case json(Components.Schemas.Project) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Project { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicCreateForAuthenticatedUser.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsClassicCreateForAuthenticatedUser.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.ProjectsClassicCreateForAuthenticatedUser.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsClassicCreateForAuthenticatedUser.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//user/projects/post(projects-classic/create-for-authenticated-user)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List user projects + /// + /// > [!WARNING] + /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. + /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// + /// - Remark: HTTP `GET /users/{username}/projects`. + /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects-classic/list-for-user)`. + public enum ProjectsClassicListForUser { + public static let id: Swift.String = "projects-classic/list-for-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/path`. + public struct Path: Sendable, Hashable { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - username: The handle for the GitHub user account. + public init(username: Components.Parameters.Username) { + self.username = username + } + } + public var path: Operations.ProjectsClassicListForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + case all = "all" + } + /// Indicates the state of the projects to return. + /// + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query/state`. + public var state: Operations.ProjectsClassicListForUser.Input.Query.StatePayload? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - state: Indicates the state of the projects to return. + /// - perPage: The number of results per page (max 100). 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)." + /// - page: The page number of the results to fetch. 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)." + public init( + state: Operations.ProjectsClassicListForUser.Input.Query.StatePayload? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.state = state + self.perPage = perPage + self.page = page + } + } + public var query: Operations.ProjectsClassicListForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsClassicListForUser.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ProjectsClassicListForUser.Input.Path, + query: Operations.ProjectsClassicListForUser.Input.Query = .init(), + headers: Operations.ProjectsClassicListForUser.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsClassicListForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projects/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Project]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.Project] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsClassicListForUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsClassicListForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsClassicListForUser.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects-classic/list-for-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsClassicListForUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsClassicListForUser.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects-classic/list-for-user)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } +} diff --git a/Sources/projects/Client.swift b/Sources/projects/Client.swift index 2d3ace7c90b..fb63d961271 100644 --- a/Sources/projects/Client.swift +++ b/Sources/projects/Client.swift @@ -38,22 +38,19 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } - /// List organization projects + /// List projects for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all projects owned by a specific organization accessible by the authenticated user. /// - /// - Remark: HTTP `GET /orgs/{org}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)`. - @available(*, deprecated) + /// - Remark: HTTP `GET /orgs/{org}/projectsV2`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)`. public func projectsListForOrg(_ input: Operations.ProjectsListForOrg.Input) async throws -> Operations.ProjectsListForOrg.Output { try await client.send( input: input, forOperation: Operations.ProjectsListForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/projects", + template: "/orgs/{}/projectsV2", parameters: [ input.path.org ] @@ -67,1246 +64,22 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "state", - value: input.query.state + name: "q", + value: input.query.q ) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let headers: Operations.ProjectsListForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsListForOrg.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Project].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init( - headers: headers, - body: body - )) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Create an organization project - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `POST /orgs/{org}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)`. - @available(*, deprecated) - public func projectsCreateForOrg(_ input: Operations.ProjectsCreateForOrg.Input) async throws -> Operations.ProjectsCreateForOrg.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsCreateForOrg.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/projects", - parameters: [ - input.path.org - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsCreateForOrg.Output.Created.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Project.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 410: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .gone(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get a project card - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /projects/columns/cards/{card_id}`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)`. - @available(*, deprecated) - public func projectsGetCard(_ input: Operations.ProjectsGetCard.Input) async throws -> Operations.ProjectsGetCard.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsGetCard.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/cards/{}", - parameters: [ - input.path.cardId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsGetCard.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ProjectCard.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 304: - return .notModified(.init()) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update an existing project card - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `PATCH /projects/columns/cards/{card_id}`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)`. - @available(*, deprecated) - public func projectsUpdateCard(_ input: Operations.ProjectsUpdateCard.Input) async throws -> Operations.ProjectsUpdateCard.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsUpdateCard.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/cards/{}", - parameters: [ - input.path.cardId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .patch - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case .none: - body = nil - case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsUpdateCard.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ProjectCard.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 304: - return .notModified(.init()) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete a project card - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `DELETE /projects/columns/cards/{card_id}`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)`. - @available(*, deprecated) - public func projectsDeleteCard(_ input: Operations.ProjectsDeleteCard.Input) async throws -> Operations.ProjectsDeleteCard.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsDeleteCard.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/cards/{}", - parameters: [ - input.path.cardId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - case 304: - return .notModified(.init()) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsDeleteCard.Output.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsDeleteCard.Output.Forbidden.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Move a project card - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `POST /projects/columns/cards/{card_id}/moves`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)`. - @available(*, deprecated) - public func projectsMoveCard(_ input: Operations.ProjectsMoveCard.Input) async throws -> Operations.ProjectsMoveCard.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsMoveCard.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/cards/{}/moves", - parameters: [ - input.path.cardId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsMoveCard.Output.Created.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsMoveCard.Output.Created.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) - case 304: - return .notModified(.init()) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsMoveCard.Output.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsMoveCard.Output.Forbidden.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - case 503: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .serviceUnavailable(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Get a project column - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /projects/columns/{column_id}`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)`. - @available(*, deprecated) - public func projectsGetColumn(_ input: Operations.ProjectsGetColumn.Input) async throws -> Operations.ProjectsGetColumn.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsGetColumn.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/{}", - parameters: [ - input.path.columnId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsGetColumn.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ProjectColumn.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 304: - return .notModified(.init()) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Update an existing project column - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)`. - @available(*, deprecated) - public func projectsUpdateColumn(_ input: Operations.ProjectsUpdateColumn.Input) async throws -> Operations.ProjectsUpdateColumn.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsUpdateColumn.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/{}", - parameters: [ - input.path.columnId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .patch - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsUpdateColumn.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ProjectColumn.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) - case 304: - return .notModified(.init()) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Delete a project column - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)`. - @available(*, deprecated) - public func projectsDeleteColumn(_ input: Operations.ProjectsDeleteColumn.Input) async throws -> Operations.ProjectsDeleteColumn.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsDeleteColumn.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/{}", - parameters: [ - input.path.columnId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .delete - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 204: - return .noContent(.init()) - case 304: - return .notModified(.init()) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// List project cards - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /projects/columns/{column_id}/cards`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)`. - @available(*, deprecated) - public func projectsListCards(_ input: Operations.ProjectsListCards.Input) async throws -> Operations.ProjectsListCards.Output { - try await client.send( - input: input, - forOperation: Operations.ProjectsListCards.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/projects/columns/{}/cards", - parameters: [ - input.path.columnId - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .get + name: "before", + value: input.query.before ) - suppressMutabilityWarning(&request) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "archived_state", - value: input.query.archivedState + name: "after", + value: input.query.after ) try converter.setQueryItemAsURI( in: &request, @@ -1315,13 +88,6 @@ public struct Client: APIProtocol { name: "per_page", value: input.query.perPage ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1331,13 +97,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ProjectsListCards.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.ProjectsListForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, name: "Link", as: Components.Headers.Link.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsListCards.Output.Ok.Body + let body: Operations.ProjectsListForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1347,7 +113,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.ProjectCard].self, + [Components.Schemas.ProjectsV2].self, from: responseBody, transforming: { value in .json(value) @@ -1418,51 +184,45 @@ public struct Client: APIProtocol { } ) } - /// Create a project card + /// Get project for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific organization-owned project. /// - /// - Remark: HTTP `POST /projects/columns/{column_id}/cards`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)`. - @available(*, deprecated) - public func projectsCreateCard(_ input: Operations.ProjectsCreateCard.Input) async throws -> Operations.ProjectsCreateCard.Output { + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)`. + public func projectsGetForOrg(_ input: Operations.ProjectsGetForOrg.Input) async throws -> Operations.ProjectsGetForOrg.Output { try await client.send( input: input, - forOperation: Operations.ProjectsCreateCard.id, + forOperation: Operations.ProjectsGetForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/projects/columns/{}/cards", + template: "/orgs/{}/projectsV2/{}", parameters: [ - input.path.columnId + input.path.org, + input.path.projectNumber ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 200: + let headers: Operations.ProjectsGetForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsCreateCard.Output.Created.Body + let body: Operations.ProjectsGetForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1472,7 +232,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ProjectCard.self, + Components.Schemas.ProjectsV2.self, from: responseBody, transforming: { value in .json(value) @@ -1481,7 +241,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) case 304: return .notModified(.init()) case 403: @@ -1528,50 +291,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .unauthorized(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsCreateCard.Output.UnprocessableContent.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsCreateCard.Output.UnprocessableContent.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) - case 503: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsCreateCard.Output.ServiceUnavailable.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsCreateCard.Output.ServiceUnavailable.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .serviceUnavailable(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1584,51 +303,66 @@ public struct Client: APIProtocol { } ) } - /// Move a project column + /// List project fields for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all fields for a specific organization-owned project. /// - /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)`. - @available(*, deprecated) - public func projectsMoveColumn(_ input: Operations.ProjectsMoveColumn.Input) async throws -> Operations.ProjectsMoveColumn.Output { + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)`. + public func projectsListFieldsForOrg(_ input: Operations.ProjectsListFieldsForOrg.Input) async throws -> Operations.ProjectsListFieldsForOrg.Output { try await client.send( input: input, - forOperation: Operations.ProjectsMoveColumn.id, + forOperation: Operations.ProjectsListFieldsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/projects/columns/{}/moves", + template: "/orgs/{}/projectsV2/{}/fields", parameters: [ - input.path.columnId + input.path.org, + input.path.projectNumber ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after ) - suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 200: + let headers: Operations.ProjectsListFieldsForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsMoveColumn.Output.Created.Body + let body: Operations.ProjectsListFieldsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1638,7 +372,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsMoveColumn.Output.Created.Body.JsonPayload.self, + [Components.Schemas.ProjectsV2Field].self, from: responseBody, transforming: { value in .json(value) @@ -1647,7 +381,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) case 304: return .notModified(.init()) case 403: @@ -1672,28 +409,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .forbidden(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.RequiresAuthentication.Body @@ -1728,24 +443,23 @@ public struct Client: APIProtocol { } ) } - /// Get a project + /// Get project field for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific field for an organization-owned project. /// - /// - Remark: HTTP `GET /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)`. - @available(*, deprecated) - public func projectsGet(_ input: Operations.ProjectsGet.Input) async throws -> Operations.ProjectsGet.Output { + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)`. + public func projectsGetFieldForOrg(_ input: Operations.ProjectsGetFieldForOrg.Input) async throws -> Operations.ProjectsGetFieldForOrg.Output { try await client.send( input: input, - forOperation: Operations.ProjectsGet.id, + forOperation: Operations.ProjectsGetFieldForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/projects/{}", + template: "/orgs/{}/projectsV2/{}/fields/{}", parameters: [ - input.path.projectId + input.path.org, + input.path.projectNumber, + input.path.fieldId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1762,8 +476,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.ProjectsGetFieldForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsGet.Output.Ok.Body + let body: Operations.ProjectsGetFieldForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1773,7 +492,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Project.self, + Components.Schemas.ProjectsV2Field.self, from: responseBody, transforming: { value in .json(value) @@ -1782,7 +501,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) case 304: return .notModified(.init()) case 403: @@ -1841,53 +563,80 @@ public struct Client: APIProtocol { } ) } - /// Update a project + /// List items for an organization owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all items for a specific organization-owned project accessible by the authenticated user. /// - /// - Remark: HTTP `PATCH /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)`. - @available(*, deprecated) - public func projectsUpdate(_ input: Operations.ProjectsUpdate.Input) async throws -> Operations.ProjectsUpdate.Output { + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)`. + public func projectsListItemsForOrg(_ input: Operations.ProjectsListItemsForOrg.Input) async throws -> Operations.ProjectsListItemsForOrg.Output { try await client.send( input: input, - forOperation: Operations.ProjectsUpdate.id, + forOperation: Operations.ProjectsListItemsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/projects/{}", + template: "/orgs/{}/projectsV2/{}/items", parameters: [ - input.path.projectId + input.path.org, + input.path.projectNumber ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "q", + value: input.query.q + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "fields", + value: input.query.fields + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case .none: - body = nil - case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.ProjectsListItemsForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsUpdate.Output.Ok.Body + let body: Operations.ProjectsListItemsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1897,7 +646,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Project.self, + [Components.Schemas.ProjectsV2ItemWithContent].self, from: responseBody, transforming: { value in .json(value) @@ -1906,14 +655,15 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 404: - return .notFound(.init()) + return .ok(.init( + headers: headers, + body: body + )) case 304: return .notModified(.init()) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsUpdate.Output.Forbidden.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1923,7 +673,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsUpdate.Output.Forbidden.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -1955,50 +705,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .unauthorized(.init(body: body)) - case 410: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .gone(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2011,68 +717,49 @@ public struct Client: APIProtocol { } ) } - /// Delete a project + /// Add item to organization owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Add an issue or pull request item to the specified organization owned project. /// - /// - Remark: HTTP `DELETE /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)`. - @available(*, deprecated) - public func projectsDelete(_ input: Operations.ProjectsDelete.Input) async throws -> Operations.ProjectsDelete.Output { + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)`. + public func projectsAddItemForOrg(_ input: Operations.ProjectsAddItemForOrg.Input) async throws -> Operations.ProjectsAddItemForOrg.Output { try await client.send( input: input, - forOperation: Operations.ProjectsDelete.id, + forOperation: Operations.ProjectsAddItemForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/projects/{}", + template: "/orgs/{}/projectsV2/{}/items", parameters: [ - input.path.projectId + input.path.org, + input.path.projectNumber ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 304: - return .notModified(.init()) - case 403: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsDelete.Output.Forbidden.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ProjectsDelete.Output.Forbidden.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .forbidden(.init(body: body)) - case 401: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body + let body: Operations.ProjectsAddItemForOrg.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2082,7 +769,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ProjectsV2ItemSimple.self, from: responseBody, transforming: { value in .json(value) @@ -2091,10 +778,12 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unauthorized(.init(body: body)) - case 410: + return .created(.init(body: body)) + case 304: + return .notModified(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2113,10 +802,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) - case 404: + return .forbidden(.init(body: body)) + case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.RequiresAuthentication.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2135,7 +824,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .unauthorized(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2148,24 +837,23 @@ public struct Client: APIProtocol { } ) } - /// List project collaborators + /// Get an item for an organization owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific item from an organization-owned project. /// - /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)`. - @available(*, deprecated) - public func projectsListCollaborators(_ input: Operations.ProjectsListCollaborators.Input) async throws -> Operations.ProjectsListCollaborators.Output { + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)`. + public func projectsGetOrgItem(_ input: Operations.ProjectsGetOrgItem.Input) async throws -> Operations.ProjectsGetOrgItem.Output { try await client.send( input: input, - forOperation: Operations.ProjectsListCollaborators.id, + forOperation: Operations.ProjectsGetOrgItem.id, serializer: { input in let path = try converter.renderedPath( - template: "/projects/{}/collaborators", + template: "/orgs/{}/projectsV2/{}/items/{}", parameters: [ - input.path.projectId + input.path.org, + input.path.projectNumber, + input.path.itemId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -2177,22 +865,8 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "affiliation", - value: input.query.affiliation - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page + name: "fields", + value: input.query.fields ) converter.setAcceptHeader( in: &request.headerFields, @@ -2203,13 +877,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ProjectsListCollaborators.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.ProjectsGetOrgItem.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, name: "Link", as: Components.Headers.Link.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsListCollaborators.Output.Ok.Body + let body: Operations.ProjectsGetOrgItem.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2219,7 +893,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.SimpleUser].self, + Components.Schemas.ProjectsV2ItemWithContent.self, from: responseBody, transforming: { value in .json(value) @@ -2232,50 +906,6 @@ public struct Client: APIProtocol { headers: headers, body: body )) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) case 304: return .notModified(.init()) case 403: @@ -2334,30 +964,28 @@ public struct Client: APIProtocol { } ) } - /// Add project collaborator + /// Update project item for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Update a specific item in an organization-owned project. /// - /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)`. - @available(*, deprecated) - public func projectsAddCollaborator(_ input: Operations.ProjectsAddCollaborator.Input) async throws -> Operations.ProjectsAddCollaborator.Output { + /// - Remark: HTTP `PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)`. + public func projectsUpdateItemForOrg(_ input: Operations.ProjectsUpdateItemForOrg.Input) async throws -> Operations.ProjectsUpdateItemForOrg.Output { try await client.send( input: input, - forOperation: Operations.ProjectsAddCollaborator.id, + forOperation: Operations.ProjectsUpdateItemForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/projects/{}/collaborators/{}", + template: "/orgs/{}/projectsV2/{}/items/{}", parameters: [ - input.path.projectId, - input.path.username + input.path.org, + input.path.projectNumber, + input.path.itemId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .patch ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -2366,10 +994,8 @@ public struct Client: APIProtocol { ) let body: OpenAPIRuntime.HTTPBody? switch input.body { - case .none: - body = nil case let .json(value): - body = try converter.setOptionalRequestBodyAsJSON( + body = try converter.setRequiredRequestBodyAsJSON( value, headerFields: &request.headerFields, contentType: "application/json; charset=utf-8" @@ -2379,11 +1005,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 404: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.ProjectsUpdateItemForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2393,7 +1017,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ProjectsV2ItemWithContent.self, from: responseBody, transforming: { value in .json(value) @@ -2402,10 +1026,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 422: + return .ok(.init(body: body)) + case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.RequiresAuthentication.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2415,7 +1039,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -2424,9 +1048,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) - case 304: - return .notModified(.init()) + return .unauthorized(.init(body: body)) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -2449,9 +1071,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .forbidden(.init(body: body)) - case 401: + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2470,7 +1092,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unauthorized(.init(body: body)) + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2483,25 +1127,23 @@ public struct Client: APIProtocol { } ) } - /// Remove user as a collaborator + /// Delete project item for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Delete a specific item from an organization-owned project. /// - /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)`. - @available(*, deprecated) - public func projectsRemoveCollaborator(_ input: Operations.ProjectsRemoveCollaborator.Input) async throws -> Operations.ProjectsRemoveCollaborator.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)`. + public func projectsDeleteItemForOrg(_ input: Operations.ProjectsDeleteItemForOrg.Input) async throws -> Operations.ProjectsDeleteItemForOrg.Output { try await client.send( input: input, - forOperation: Operations.ProjectsRemoveCollaborator.id, + forOperation: Operations.ProjectsDeleteItemForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/projects/{}/collaborators/{}", + template: "/orgs/{}/projectsV2/{}/items/{}", parameters: [ - input.path.projectId, - input.path.username + input.path.org, + input.path.projectNumber, + input.path.itemId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -2519,30 +1161,6 @@ public struct Client: APIProtocol { switch response.status.code { case 204: return .noContent(.init()) - case 304: - return .notModified(.init()) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -2565,28 +1183,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .forbidden(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.RequiresAuthentication.Body @@ -2621,24 +1217,20 @@ public struct Client: APIProtocol { } ) } - /// Get project permission for a user + /// List projects for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all projects owned by a specific user accessible by the authenticated user. /// - /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)`. - @available(*, deprecated) - public func projectsGetPermissionForUser(_ input: Operations.ProjectsGetPermissionForUser.Input) async throws -> Operations.ProjectsGetPermissionForUser.Output { + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + public func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output { try await client.send( input: input, - forOperation: Operations.ProjectsGetPermissionForUser.id, + forOperation: Operations.ProjectsListForUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/projects/{}/collaborators/{}/permission", + template: "/users/{}/projectsV2", parameters: [ - input.path.projectId, input.path.username ] ) @@ -2647,6 +1239,34 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "q", + value: input.query.q + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -2656,8 +1276,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.ProjectsListForUser.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsGetPermissionForUser.Output.Ok.Body + let body: Operations.ProjectsListForUser.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2667,7 +1292,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ProjectCollaboratorPermission.self, + [Components.Schemas.ProjectsV2].self, from: responseBody, transforming: { value in .json(value) @@ -2676,10 +1301,15 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 404: + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2698,10 +1328,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 422: + return .forbidden(.init(body: body)) + case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.RequiresAuthentication.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2711,7 +1341,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -2720,7 +1350,80 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get project for user + /// + /// Get a specific user-owned project. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)`. + public func projectsGetForUser(_ input: Operations.ProjectsGetForUser.Input) async throws -> Operations.ProjectsGetForUser.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsGetForUser.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2/{}", + parameters: [ + input.path.username, + input.path.projectNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsGetForUser.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ProjectsGetForUser.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ProjectsV2.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) case 304: return .notModified(.init()) case 403: @@ -2779,24 +1482,22 @@ public struct Client: APIProtocol { } ) } - /// List project columns + /// List project fields for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all fields for a specific user-owned project. /// - /// - Remark: HTTP `GET /projects/{project_id}/columns`. - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)`. - @available(*, deprecated) - public func projectsListColumns(_ input: Operations.ProjectsListColumns.Input) async throws -> Operations.ProjectsListColumns.Output { + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + public func projectsListFieldsForUser(_ input: Operations.ProjectsListFieldsForUser.Input) async throws -> Operations.ProjectsListFieldsForUser.Output { try await client.send( input: input, - forOperation: Operations.ProjectsListColumns.id, + forOperation: Operations.ProjectsListFieldsForUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/projects/{}/columns", + template: "/users/{}/projectsV2/{}/fields", parameters: [ - input.path.projectId + input.path.username, + input.path.projectNumber ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -2815,8 +1516,15 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "page", - value: input.query.page + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after ) converter.setAcceptHeader( in: &request.headerFields, @@ -2827,13 +1535,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ProjectsListColumns.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, name: "Link", as: Components.Headers.Link.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsListColumns.Output.Ok.Body + let body: Operations.ProjectsListFieldsForUser.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2843,7 +1551,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.ProjectColumn].self, + [Components.Schemas.ProjectsV2Field].self, from: responseBody, transforming: { value in .json(value) @@ -2914,75 +1622,46 @@ public struct Client: APIProtocol { } ) } - /// Create a project column + /// Get project field for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific field for a user-owned project. /// - /// - Remark: HTTP `POST /projects/{project_id}/columns`. - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)`. - @available(*, deprecated) - public func projectsCreateColumn(_ input: Operations.ProjectsCreateColumn.Input) async throws -> Operations.ProjectsCreateColumn.Output { + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + public func projectsGetFieldForUser(_ input: Operations.ProjectsGetFieldForUser.Input) async throws -> Operations.ProjectsGetFieldForUser.Output { try await client.send( input: input, - forOperation: Operations.ProjectsCreateColumn.id, + forOperation: Operations.ProjectsGetFieldForUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/projects/{}/columns", + template: "/users/{}/projectsV2/{}/fields/{}", parameters: [ - input.path.projectId + input.path.username, + input.path.projectNumber, + input.path.fieldId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsCreateColumn.Output.Created.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ProjectColumn.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) - case 304: - return .notModified(.init()) - case 403: + case 200: + let headers: Operations.ProjectsGetFieldForUser.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Operations.ProjectsGetFieldForUser.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2992,7 +1671,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ProjectsV2Field.self, from: responseBody, transforming: { value in .json(value) @@ -3001,10 +1680,15 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 422: + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3014,7 +1698,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -3023,7 +1707,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .forbidden(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.RequiresAuthentication.Body @@ -3058,25 +1742,22 @@ public struct Client: APIProtocol { } ) } - /// List repository projects + /// List items for a user owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all items for a specific user-owned project accessible by the authenticated user. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)`. - @available(*, deprecated) - public func projectsListForRepo(_ input: Operations.ProjectsListForRepo.Input) async throws -> Operations.ProjectsListForRepo.Output { + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + public func projectsListItemsForUser(_ input: Operations.ProjectsListItemsForUser.Input) async throws -> Operations.ProjectsListItemsForUser.Output { try await client.send( input: input, - forOperation: Operations.ProjectsListForRepo.id, + forOperation: Operations.ProjectsListItemsForUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/projects", + template: "/users/{}/projectsV2/{}/items", parameters: [ - input.path.owner, - input.path.repo + input.path.username, + input.path.projectNumber ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3088,8 +1769,15 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "state", - value: input.query.state + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after ) try converter.setQueryItemAsURI( in: &request, @@ -3102,8 +1790,15 @@ public struct Client: APIProtocol { in: &request, style: .form, explode: true, - name: "page", - value: input.query.page + name: "q", + value: input.query.q + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "fields", + value: input.query.fields ) converter.setAcceptHeader( in: &request.headerFields, @@ -3114,13 +1809,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.ProjectsListForRepo.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.ProjectsListItemsForUser.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, name: "Link", as: Components.Headers.Link.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsListForRepo.Output.Ok.Body + let body: Operations.ProjectsListItemsForUser.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3130,7 +1825,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Project].self, + [Components.Schemas.ProjectsV2ItemWithContent].self, from: responseBody, transforming: { value in .json(value) @@ -3143,28 +1838,8 @@ public struct Client: APIProtocol { headers: headers, body: body )) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) + case 304: + return .notModified(.init()) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -3187,31 +1862,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .forbidden(.init(body: body)) - case 404: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .notFound(.init(body: body)) - case 410: + case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body + let body: Components.Responses.RequiresAuthentication.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3230,29 +1883,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) + return .unauthorized(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3265,25 +1896,22 @@ public struct Client: APIProtocol { } ) } - /// Create a repository project + /// Add item to user owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Add an issue or pull request item to the specified user owned project. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)`. - @available(*, deprecated) - public func projectsCreateForRepo(_ input: Operations.ProjectsCreateForRepo.Input) async throws -> Operations.ProjectsCreateForRepo.Output { + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + public func projectsAddItemForUser(_ input: Operations.ProjectsAddItemForUser.Input) async throws -> Operations.ProjectsAddItemForUser.Output { try await client.send( input: input, - forOperation: Operations.ProjectsCreateForRepo.id, + forOperation: Operations.ProjectsAddItemForUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/projects", + template: "/users/{}/projectsV2/{}/items", parameters: [ - input.path.owner, - input.path.repo + input.path.username, + input.path.projectNumber ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -3310,7 +1938,7 @@ public struct Client: APIProtocol { switch response.status.code { case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsCreateForRepo.Output.Created.Body + let body: Operations.ProjectsAddItemForUser.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3320,7 +1948,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Project.self, + Components.Schemas.ProjectsV2ItemSimple.self, from: responseBody, transforming: { value in .json(value) @@ -3330,9 +1958,11 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .created(.init(body: body)) - case 401: + case 304: + return .notModified(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3351,10 +1981,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unauthorized(.init(body: body)) - case 403: + return .forbidden(.init(body: body)) + case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Components.Responses.RequiresAuthentication.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3373,10 +2003,66 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 404: + return .unauthorized(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get an item for a user owned project + /// + /// Get a specific item from a user-owned project. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + public func projectsGetUserItem(_ input: Operations.ProjectsGetUserItem.Input) async throws -> Operations.ProjectsGetUserItem.Output { + try await client.send( + input: input, + forOperation: Operations.ProjectsGetUserItem.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/projectsV2/{}/items/{}", + parameters: [ + input.path.username, + input.path.projectNumber, + input.path.itemId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "fields", + value: input.query.fields + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ProjectsGetUserItem.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.Link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Operations.ProjectsGetUserItem.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3386,7 +2072,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.ProjectsV2ItemWithContent.self, from: responseBody, transforming: { value in .json(value) @@ -3395,10 +2081,15 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 410: + return .ok(.init( + headers: headers, + body: body + )) + case 304: + return .notModified(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Gone.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3417,10 +2108,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .gone(.init(body: body)) - case 422: + return .forbidden(.init(body: body)) + case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body + let body: Components.Responses.RequiresAuthentication.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3430,7 +2121,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -3439,7 +2130,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .unauthorized(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -3452,27 +2143,28 @@ public struct Client: APIProtocol { } ) } - /// Create a user project + /// Update project item for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Update a specific item in a user-owned project. /// - /// - Remark: HTTP `POST /user/projects`. - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)`. - @available(*, deprecated) - public func projectsCreateForAuthenticatedUser(_ input: Operations.ProjectsCreateForAuthenticatedUser.Input) async throws -> Operations.ProjectsCreateForAuthenticatedUser.Output { + /// - Remark: HTTP `PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + public func projectsUpdateItemForUser(_ input: Operations.ProjectsUpdateItemForUser.Input) async throws -> Operations.ProjectsUpdateItemForUser.Output { try await client.send( input: input, - forOperation: Operations.ProjectsCreateForAuthenticatedUser.id, + forOperation: Operations.ProjectsUpdateItemForUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/user/projects", - parameters: [] + template: "/users/{}/projectsV2/{}/items/{}", + parameters: [ + input.path.username, + input.path.projectNumber, + input.path.itemId + ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .patch ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -3492,9 +2184,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsCreateForAuthenticatedUser.Output.Created.Body + let body: Operations.ProjectsUpdateItemForUser.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3504,7 +2196,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Project.self, + Components.Schemas.ProjectsV2ItemWithContent.self, from: responseBody, transforming: { value in .json(value) @@ -3513,9 +2205,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) - case 304: - return .notModified(.init()) + return .ok(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -3538,9 +2250,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .forbidden(.init(body: body)) - case 401: + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3559,10 +2271,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unauthorized(.init(body: body)) + return .notFound(.init(body: body)) case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body + let body: Components.Responses.ValidationFailed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3572,7 +2284,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, + Components.Schemas.ValidationError.self, from: responseBody, transforming: { value in .json(value) @@ -3594,52 +2306,30 @@ public struct Client: APIProtocol { } ) } - /// List user projects + /// Delete project item for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Delete a specific item from a user-owned project. /// - /// - Remark: HTTP `GET /users/{username}/projects`. - /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)`. - @available(*, deprecated) - public func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output { + /// - Remark: HTTP `DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + public func projectsDeleteItemForUser(_ input: Operations.ProjectsDeleteItemForUser.Input) async throws -> Operations.ProjectsDeleteItemForUser.Output { try await client.send( input: input, - forOperation: Operations.ProjectsListForUser.id, + forOperation: Operations.ProjectsDeleteItemForUser.id, serializer: { input in let path = try converter.renderedPath( - template: "/users/{}/projects", + template: "/users/{}/projectsV2/{}/items/{}", parameters: [ - input.path.username + input.path.username, + input.path.projectNumber, + input.path.itemId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "state", - value: input.query.state - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -3648,14 +2338,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let headers: Operations.ProjectsListForUser.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) + case 204: + return .noContent(.init()) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ProjectsListForUser.Output.Ok.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3665,7 +2352,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Project].self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -3674,13 +2361,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) - case 422: + return .forbidden(.init(body: body)) + case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.RequiresAuthentication.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -3690,7 +2374,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -3699,7 +2383,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .unauthorized(.init(body: body)) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/projects/Types.swift b/Sources/projects/Types.swift index 161fe318c32..ea34381e5bb 100644 --- a/Sources/projects/Types.swift +++ b/Sources/projects/Types.swift @@ -11,269 +11,142 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { - /// List organization projects + /// List projects for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all projects owned by a specific organization accessible by the authenticated user. /// - /// - Remark: HTTP `GET /orgs/{org}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)`. - @available(*, deprecated) + /// - Remark: HTTP `GET /orgs/{org}/projectsV2`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)`. func projectsListForOrg(_ input: Operations.ProjectsListForOrg.Input) async throws -> Operations.ProjectsListForOrg.Output - /// Create an organization project + /// Get project for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific organization-owned project. /// - /// - Remark: HTTP `POST /orgs/{org}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)`. - @available(*, deprecated) - func projectsCreateForOrg(_ input: Operations.ProjectsCreateForOrg.Input) async throws -> Operations.ProjectsCreateForOrg.Output - /// Get a project card + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)`. + func projectsGetForOrg(_ input: Operations.ProjectsGetForOrg.Input) async throws -> Operations.ProjectsGetForOrg.Output + /// List project fields for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all fields for a specific organization-owned project. /// - /// - Remark: HTTP `GET /projects/columns/cards/{card_id}`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)`. - @available(*, deprecated) - func projectsGetCard(_ input: Operations.ProjectsGetCard.Input) async throws -> Operations.ProjectsGetCard.Output - /// Update an existing project card + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)`. + func projectsListFieldsForOrg(_ input: Operations.ProjectsListFieldsForOrg.Input) async throws -> Operations.ProjectsListFieldsForOrg.Output + /// Get project field for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific field for an organization-owned project. /// - /// - Remark: HTTP `PATCH /projects/columns/cards/{card_id}`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)`. - @available(*, deprecated) - func projectsUpdateCard(_ input: Operations.ProjectsUpdateCard.Input) async throws -> Operations.ProjectsUpdateCard.Output - /// Delete a project card + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)`. + func projectsGetFieldForOrg(_ input: Operations.ProjectsGetFieldForOrg.Input) async throws -> Operations.ProjectsGetFieldForOrg.Output + /// List items for an organization owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all items for a specific organization-owned project accessible by the authenticated user. /// - /// - Remark: HTTP `DELETE /projects/columns/cards/{card_id}`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)`. - @available(*, deprecated) - func projectsDeleteCard(_ input: Operations.ProjectsDeleteCard.Input) async throws -> Operations.ProjectsDeleteCard.Output - /// Move a project card + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)`. + func projectsListItemsForOrg(_ input: Operations.ProjectsListItemsForOrg.Input) async throws -> Operations.ProjectsListItemsForOrg.Output + /// Add item to organization owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Add an issue or pull request item to the specified organization owned project. /// - /// - Remark: HTTP `POST /projects/columns/cards/{card_id}/moves`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)`. - @available(*, deprecated) - func projectsMoveCard(_ input: Operations.ProjectsMoveCard.Input) async throws -> Operations.ProjectsMoveCard.Output - /// Get a project column + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)`. + func projectsAddItemForOrg(_ input: Operations.ProjectsAddItemForOrg.Input) async throws -> Operations.ProjectsAddItemForOrg.Output + /// Get an item for an organization owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific item from an organization-owned project. /// - /// - Remark: HTTP `GET /projects/columns/{column_id}`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)`. - @available(*, deprecated) - func projectsGetColumn(_ input: Operations.ProjectsGetColumn.Input) async throws -> Operations.ProjectsGetColumn.Output - /// Update an existing project column + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)`. + func projectsGetOrgItem(_ input: Operations.ProjectsGetOrgItem.Input) async throws -> Operations.ProjectsGetOrgItem.Output + /// Update project item for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Update a specific item in an organization-owned project. /// - /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)`. - @available(*, deprecated) - func projectsUpdateColumn(_ input: Operations.ProjectsUpdateColumn.Input) async throws -> Operations.ProjectsUpdateColumn.Output - /// Delete a project column + /// - Remark: HTTP `PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)`. + func projectsUpdateItemForOrg(_ input: Operations.ProjectsUpdateItemForOrg.Input) async throws -> Operations.ProjectsUpdateItemForOrg.Output + /// Delete project item for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Delete a specific item from an organization-owned project. /// - /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)`. - @available(*, deprecated) - func projectsDeleteColumn(_ input: Operations.ProjectsDeleteColumn.Input) async throws -> Operations.ProjectsDeleteColumn.Output - /// List project cards + /// - Remark: HTTP `DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)`. + func projectsDeleteItemForOrg(_ input: Operations.ProjectsDeleteItemForOrg.Input) async throws -> Operations.ProjectsDeleteItemForOrg.Output + /// List projects for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all projects owned by a specific user accessible by the authenticated user. /// - /// - Remark: HTTP `GET /projects/columns/{column_id}/cards`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)`. - @available(*, deprecated) - func projectsListCards(_ input: Operations.ProjectsListCards.Input) async throws -> Operations.ProjectsListCards.Output - /// Create a project card - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `POST /projects/columns/{column_id}/cards`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)`. - @available(*, deprecated) - func projectsCreateCard(_ input: Operations.ProjectsCreateCard.Input) async throws -> Operations.ProjectsCreateCard.Output - /// Move a project column - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)`. - @available(*, deprecated) - func projectsMoveColumn(_ input: Operations.ProjectsMoveColumn.Input) async throws -> Operations.ProjectsMoveColumn.Output - /// Get a project - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)`. - @available(*, deprecated) - func projectsGet(_ input: Operations.ProjectsGet.Input) async throws -> Operations.ProjectsGet.Output - /// Update a project - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `PATCH /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)`. - @available(*, deprecated) - func projectsUpdate(_ input: Operations.ProjectsUpdate.Input) async throws -> Operations.ProjectsUpdate.Output - /// Delete a project - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `DELETE /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)`. - @available(*, deprecated) - func projectsDelete(_ input: Operations.ProjectsDelete.Input) async throws -> Operations.ProjectsDelete.Output - /// List project collaborators - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)`. - @available(*, deprecated) - func projectsListCollaborators(_ input: Operations.ProjectsListCollaborators.Input) async throws -> Operations.ProjectsListCollaborators.Output - /// Add project collaborator - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)`. - @available(*, deprecated) - func projectsAddCollaborator(_ input: Operations.ProjectsAddCollaborator.Input) async throws -> Operations.ProjectsAddCollaborator.Output - /// Remove user as a collaborator + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output + /// Get project for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific user-owned project. /// - /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)`. - @available(*, deprecated) - func projectsRemoveCollaborator(_ input: Operations.ProjectsRemoveCollaborator.Input) async throws -> Operations.ProjectsRemoveCollaborator.Output - /// Get project permission for a user + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)`. + func projectsGetForUser(_ input: Operations.ProjectsGetForUser.Input) async throws -> Operations.ProjectsGetForUser.Output + /// List project fields for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all fields for a specific user-owned project. /// - /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)`. - @available(*, deprecated) - func projectsGetPermissionForUser(_ input: Operations.ProjectsGetPermissionForUser.Input) async throws -> Operations.ProjectsGetPermissionForUser.Output - /// List project columns + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + func projectsListFieldsForUser(_ input: Operations.ProjectsListFieldsForUser.Input) async throws -> Operations.ProjectsListFieldsForUser.Output + /// Get project field for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific field for a user-owned project. /// - /// - Remark: HTTP `GET /projects/{project_id}/columns`. - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)`. - @available(*, deprecated) - func projectsListColumns(_ input: Operations.ProjectsListColumns.Input) async throws -> Operations.ProjectsListColumns.Output - /// Create a project column + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + func projectsGetFieldForUser(_ input: Operations.ProjectsGetFieldForUser.Input) async throws -> Operations.ProjectsGetFieldForUser.Output + /// List items for a user owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all items for a specific user-owned project accessible by the authenticated user. /// - /// - Remark: HTTP `POST /projects/{project_id}/columns`. - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)`. - @available(*, deprecated) - func projectsCreateColumn(_ input: Operations.ProjectsCreateColumn.Input) async throws -> Operations.ProjectsCreateColumn.Output - /// List repository projects + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + func projectsListItemsForUser(_ input: Operations.ProjectsListItemsForUser.Input) async throws -> Operations.ProjectsListItemsForUser.Output + /// Add item to user owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Add an issue or pull request item to the specified user owned project. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)`. - @available(*, deprecated) - func projectsListForRepo(_ input: Operations.ProjectsListForRepo.Input) async throws -> Operations.ProjectsListForRepo.Output - /// Create a repository project + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + func projectsAddItemForUser(_ input: Operations.ProjectsAddItemForUser.Input) async throws -> Operations.ProjectsAddItemForUser.Output + /// Get an item for a user owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific item from a user-owned project. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)`. - @available(*, deprecated) - func projectsCreateForRepo(_ input: Operations.ProjectsCreateForRepo.Input) async throws -> Operations.ProjectsCreateForRepo.Output - /// Create a user project + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + func projectsGetUserItem(_ input: Operations.ProjectsGetUserItem.Input) async throws -> Operations.ProjectsGetUserItem.Output + /// Update project item for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Update a specific item in a user-owned project. /// - /// - Remark: HTTP `POST /user/projects`. - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)`. - @available(*, deprecated) - func projectsCreateForAuthenticatedUser(_ input: Operations.ProjectsCreateForAuthenticatedUser.Input) async throws -> Operations.ProjectsCreateForAuthenticatedUser.Output - /// List user projects + /// - Remark: HTTP `PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + func projectsUpdateItemForUser(_ input: Operations.ProjectsUpdateItemForUser.Input) async throws -> Operations.ProjectsUpdateItemForUser.Output + /// Delete project item for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Delete a specific item from a user-owned project. /// - /// - Remark: HTTP `GET /users/{username}/projects`. - /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)`. - @available(*, deprecated) - func projectsListForUser(_ input: Operations.ProjectsListForUser.Input) async throws -> Operations.ProjectsListForUser.Output + /// - Remark: HTTP `DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + func projectsDeleteItemForUser(_ input: Operations.ProjectsDeleteItemForUser.Input) async throws -> Operations.ProjectsDeleteItemForUser.Output } /// Convenience overloads for operation inputs. extension APIProtocol { - /// List organization projects + /// List projects for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all projects owned by a specific organization accessible by the authenticated user. /// - /// - Remark: HTTP `GET /orgs/{org}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)`. - @available(*, deprecated) + /// - Remark: HTTP `GET /orgs/{org}/projectsV2`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)`. public func projectsListForOrg( path: Operations.ProjectsListForOrg.Input.Path, query: Operations.ProjectsListForOrg.Input.Query = .init(), @@ -285,465 +158,280 @@ extension APIProtocol { headers: headers )) } - /// Create an organization project - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `POST /orgs/{org}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)`. - @available(*, deprecated) - public func projectsCreateForOrg( - path: Operations.ProjectsCreateForOrg.Input.Path, - headers: Operations.ProjectsCreateForOrg.Input.Headers = .init(), - body: Operations.ProjectsCreateForOrg.Input.Body - ) async throws -> Operations.ProjectsCreateForOrg.Output { - try await projectsCreateForOrg(Operations.ProjectsCreateForOrg.Input( - path: path, - headers: headers, - body: body - )) - } - /// Get a project card - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /projects/columns/cards/{card_id}`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)`. - @available(*, deprecated) - public func projectsGetCard( - path: Operations.ProjectsGetCard.Input.Path, - headers: Operations.ProjectsGetCard.Input.Headers = .init() - ) async throws -> Operations.ProjectsGetCard.Output { - try await projectsGetCard(Operations.ProjectsGetCard.Input( - path: path, - headers: headers - )) - } - /// Update an existing project card - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `PATCH /projects/columns/cards/{card_id}`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)`. - @available(*, deprecated) - public func projectsUpdateCard( - path: Operations.ProjectsUpdateCard.Input.Path, - headers: Operations.ProjectsUpdateCard.Input.Headers = .init(), - body: Operations.ProjectsUpdateCard.Input.Body? = nil - ) async throws -> Operations.ProjectsUpdateCard.Output { - try await projectsUpdateCard(Operations.ProjectsUpdateCard.Input( - path: path, - headers: headers, - body: body - )) - } - /// Delete a project card + /// Get project for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific organization-owned project. /// - /// - Remark: HTTP `DELETE /projects/columns/cards/{card_id}`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)`. - @available(*, deprecated) - public func projectsDeleteCard( - path: Operations.ProjectsDeleteCard.Input.Path, - headers: Operations.ProjectsDeleteCard.Input.Headers = .init() - ) async throws -> Operations.ProjectsDeleteCard.Output { - try await projectsDeleteCard(Operations.ProjectsDeleteCard.Input( + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)`. + public func projectsGetForOrg( + path: Operations.ProjectsGetForOrg.Input.Path, + headers: Operations.ProjectsGetForOrg.Input.Headers = .init() + ) async throws -> Operations.ProjectsGetForOrg.Output { + try await projectsGetForOrg(Operations.ProjectsGetForOrg.Input( path: path, headers: headers )) } - /// Move a project card - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `POST /projects/columns/cards/{card_id}/moves`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)`. - @available(*, deprecated) - public func projectsMoveCard( - path: Operations.ProjectsMoveCard.Input.Path, - headers: Operations.ProjectsMoveCard.Input.Headers = .init(), - body: Operations.ProjectsMoveCard.Input.Body - ) async throws -> Operations.ProjectsMoveCard.Output { - try await projectsMoveCard(Operations.ProjectsMoveCard.Input( - path: path, - headers: headers, - body: body - )) - } - /// Get a project column - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /projects/columns/{column_id}`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)`. - @available(*, deprecated) - public func projectsGetColumn( - path: Operations.ProjectsGetColumn.Input.Path, - headers: Operations.ProjectsGetColumn.Input.Headers = .init() - ) async throws -> Operations.ProjectsGetColumn.Output { - try await projectsGetColumn(Operations.ProjectsGetColumn.Input( + /// List project fields for organization + /// + /// List all fields for a specific organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)`. + public func projectsListFieldsForOrg( + path: Operations.ProjectsListFieldsForOrg.Input.Path, + query: Operations.ProjectsListFieldsForOrg.Input.Query = .init(), + headers: Operations.ProjectsListFieldsForOrg.Input.Headers = .init() + ) async throws -> Operations.ProjectsListFieldsForOrg.Output { + try await projectsListFieldsForOrg(Operations.ProjectsListFieldsForOrg.Input( path: path, + query: query, headers: headers )) } - /// Update an existing project column - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)`. - @available(*, deprecated) - public func projectsUpdateColumn( - path: Operations.ProjectsUpdateColumn.Input.Path, - headers: Operations.ProjectsUpdateColumn.Input.Headers = .init(), - body: Operations.ProjectsUpdateColumn.Input.Body - ) async throws -> Operations.ProjectsUpdateColumn.Output { - try await projectsUpdateColumn(Operations.ProjectsUpdateColumn.Input( - path: path, - headers: headers, - body: body - )) - } - /// Delete a project column + /// Get project field for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific field for an organization-owned project. /// - /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)`. - @available(*, deprecated) - public func projectsDeleteColumn( - path: Operations.ProjectsDeleteColumn.Input.Path, - headers: Operations.ProjectsDeleteColumn.Input.Headers = .init() - ) async throws -> Operations.ProjectsDeleteColumn.Output { - try await projectsDeleteColumn(Operations.ProjectsDeleteColumn.Input( + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)`. + public func projectsGetFieldForOrg( + path: Operations.ProjectsGetFieldForOrg.Input.Path, + headers: Operations.ProjectsGetFieldForOrg.Input.Headers = .init() + ) async throws -> Operations.ProjectsGetFieldForOrg.Output { + try await projectsGetFieldForOrg(Operations.ProjectsGetFieldForOrg.Input( path: path, headers: headers )) } - /// List project cards - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /projects/columns/{column_id}/cards`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)`. - @available(*, deprecated) - public func projectsListCards( - path: Operations.ProjectsListCards.Input.Path, - query: Operations.ProjectsListCards.Input.Query = .init(), - headers: Operations.ProjectsListCards.Input.Headers = .init() - ) async throws -> Operations.ProjectsListCards.Output { - try await projectsListCards(Operations.ProjectsListCards.Input( + /// List items for an organization owned project + /// + /// List all items for a specific organization-owned project accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)`. + public func projectsListItemsForOrg( + path: Operations.ProjectsListItemsForOrg.Input.Path, + query: Operations.ProjectsListItemsForOrg.Input.Query = .init(), + headers: Operations.ProjectsListItemsForOrg.Input.Headers = .init() + ) async throws -> Operations.ProjectsListItemsForOrg.Output { + try await projectsListItemsForOrg(Operations.ProjectsListItemsForOrg.Input( path: path, query: query, headers: headers )) } - /// Create a project card - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `POST /projects/columns/{column_id}/cards`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)`. - @available(*, deprecated) - public func projectsCreateCard( - path: Operations.ProjectsCreateCard.Input.Path, - headers: Operations.ProjectsCreateCard.Input.Headers = .init(), - body: Operations.ProjectsCreateCard.Input.Body - ) async throws -> Operations.ProjectsCreateCard.Output { - try await projectsCreateCard(Operations.ProjectsCreateCard.Input( - path: path, - headers: headers, - body: body - )) - } - /// Move a project column - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)`. - @available(*, deprecated) - public func projectsMoveColumn( - path: Operations.ProjectsMoveColumn.Input.Path, - headers: Operations.ProjectsMoveColumn.Input.Headers = .init(), - body: Operations.ProjectsMoveColumn.Input.Body - ) async throws -> Operations.ProjectsMoveColumn.Output { - try await projectsMoveColumn(Operations.ProjectsMoveColumn.Input( + /// Add item to organization owned project + /// + /// Add an issue or pull request item to the specified organization owned project. + /// + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)`. + public func projectsAddItemForOrg( + path: Operations.ProjectsAddItemForOrg.Input.Path, + headers: Operations.ProjectsAddItemForOrg.Input.Headers = .init(), + body: Operations.ProjectsAddItemForOrg.Input.Body + ) async throws -> Operations.ProjectsAddItemForOrg.Output { + try await projectsAddItemForOrg(Operations.ProjectsAddItemForOrg.Input( path: path, headers: headers, body: body )) } - /// Get a project - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)`. - @available(*, deprecated) - public func projectsGet( - path: Operations.ProjectsGet.Input.Path, - headers: Operations.ProjectsGet.Input.Headers = .init() - ) async throws -> Operations.ProjectsGet.Output { - try await projectsGet(Operations.ProjectsGet.Input( + /// Get an item for an organization owned project + /// + /// Get a specific item from an organization-owned project. + /// + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)`. + public func projectsGetOrgItem( + path: Operations.ProjectsGetOrgItem.Input.Path, + query: Operations.ProjectsGetOrgItem.Input.Query = .init(), + headers: Operations.ProjectsGetOrgItem.Input.Headers = .init() + ) async throws -> Operations.ProjectsGetOrgItem.Output { + try await projectsGetOrgItem(Operations.ProjectsGetOrgItem.Input( path: path, + query: query, headers: headers )) } - /// Update a project - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `PATCH /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)`. - @available(*, deprecated) - public func projectsUpdate( - path: Operations.ProjectsUpdate.Input.Path, - headers: Operations.ProjectsUpdate.Input.Headers = .init(), - body: Operations.ProjectsUpdate.Input.Body? = nil - ) async throws -> Operations.ProjectsUpdate.Output { - try await projectsUpdate(Operations.ProjectsUpdate.Input( + /// Update project item for organization + /// + /// Update a specific item in an organization-owned project. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)`. + public func projectsUpdateItemForOrg( + path: Operations.ProjectsUpdateItemForOrg.Input.Path, + headers: Operations.ProjectsUpdateItemForOrg.Input.Headers = .init(), + body: Operations.ProjectsUpdateItemForOrg.Input.Body + ) async throws -> Operations.ProjectsUpdateItemForOrg.Output { + try await projectsUpdateItemForOrg(Operations.ProjectsUpdateItemForOrg.Input( path: path, headers: headers, body: body )) } - /// Delete a project + /// Delete project item for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Delete a specific item from an organization-owned project. /// - /// - Remark: HTTP `DELETE /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)`. - @available(*, deprecated) - public func projectsDelete( - path: Operations.ProjectsDelete.Input.Path, - headers: Operations.ProjectsDelete.Input.Headers = .init() - ) async throws -> Operations.ProjectsDelete.Output { - try await projectsDelete(Operations.ProjectsDelete.Input( + /// - Remark: HTTP `DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)`. + public func projectsDeleteItemForOrg( + path: Operations.ProjectsDeleteItemForOrg.Input.Path, + headers: Operations.ProjectsDeleteItemForOrg.Input.Headers = .init() + ) async throws -> Operations.ProjectsDeleteItemForOrg.Output { + try await projectsDeleteItemForOrg(Operations.ProjectsDeleteItemForOrg.Input( path: path, headers: headers )) } - /// List project collaborators + /// List projects for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all projects owned by a specific user accessible by the authenticated user. /// - /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)`. - @available(*, deprecated) - public func projectsListCollaborators( - path: Operations.ProjectsListCollaborators.Input.Path, - query: Operations.ProjectsListCollaborators.Input.Query = .init(), - headers: Operations.ProjectsListCollaborators.Input.Headers = .init() - ) async throws -> Operations.ProjectsListCollaborators.Output { - try await projectsListCollaborators(Operations.ProjectsListCollaborators.Input( + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + public func projectsListForUser( + path: Operations.ProjectsListForUser.Input.Path, + query: Operations.ProjectsListForUser.Input.Query = .init(), + headers: Operations.ProjectsListForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsListForUser.Output { + try await projectsListForUser(Operations.ProjectsListForUser.Input( path: path, query: query, headers: headers )) } - /// Add project collaborator + /// Get project for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific user-owned project. /// - /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)`. - @available(*, deprecated) - public func projectsAddCollaborator( - path: Operations.ProjectsAddCollaborator.Input.Path, - headers: Operations.ProjectsAddCollaborator.Input.Headers = .init(), - body: Operations.ProjectsAddCollaborator.Input.Body? = nil - ) async throws -> Operations.ProjectsAddCollaborator.Output { - try await projectsAddCollaborator(Operations.ProjectsAddCollaborator.Input( + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)`. + public func projectsGetForUser( + path: Operations.ProjectsGetForUser.Input.Path, + headers: Operations.ProjectsGetForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsGetForUser.Output { + try await projectsGetForUser(Operations.ProjectsGetForUser.Input( path: path, - headers: headers, - body: body + headers: headers )) } - /// Remove user as a collaborator - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)`. - @available(*, deprecated) - public func projectsRemoveCollaborator( - path: Operations.ProjectsRemoveCollaborator.Input.Path, - headers: Operations.ProjectsRemoveCollaborator.Input.Headers = .init() - ) async throws -> Operations.ProjectsRemoveCollaborator.Output { - try await projectsRemoveCollaborator(Operations.ProjectsRemoveCollaborator.Input( + /// List project fields for user + /// + /// List all fields for a specific user-owned project. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + public func projectsListFieldsForUser( + path: Operations.ProjectsListFieldsForUser.Input.Path, + query: Operations.ProjectsListFieldsForUser.Input.Query = .init(), + headers: Operations.ProjectsListFieldsForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsListFieldsForUser.Output { + try await projectsListFieldsForUser(Operations.ProjectsListFieldsForUser.Input( path: path, + query: query, headers: headers )) } - /// Get project permission for a user + /// Get project field for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific field for a user-owned project. /// - /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)`. - @available(*, deprecated) - public func projectsGetPermissionForUser( - path: Operations.ProjectsGetPermissionForUser.Input.Path, - headers: Operations.ProjectsGetPermissionForUser.Input.Headers = .init() - ) async throws -> Operations.ProjectsGetPermissionForUser.Output { - try await projectsGetPermissionForUser(Operations.ProjectsGetPermissionForUser.Input( + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + public func projectsGetFieldForUser( + path: Operations.ProjectsGetFieldForUser.Input.Path, + headers: Operations.ProjectsGetFieldForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsGetFieldForUser.Output { + try await projectsGetFieldForUser(Operations.ProjectsGetFieldForUser.Input( path: path, headers: headers )) } - /// List project columns - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /projects/{project_id}/columns`. - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)`. - @available(*, deprecated) - public func projectsListColumns( - path: Operations.ProjectsListColumns.Input.Path, - query: Operations.ProjectsListColumns.Input.Query = .init(), - headers: Operations.ProjectsListColumns.Input.Headers = .init() - ) async throws -> Operations.ProjectsListColumns.Output { - try await projectsListColumns(Operations.ProjectsListColumns.Input( + /// List items for a user owned project + /// + /// List all items for a specific user-owned project accessible by the authenticated user. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + public func projectsListItemsForUser( + path: Operations.ProjectsListItemsForUser.Input.Path, + query: Operations.ProjectsListItemsForUser.Input.Query = .init(), + headers: Operations.ProjectsListItemsForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsListItemsForUser.Output { + try await projectsListItemsForUser(Operations.ProjectsListItemsForUser.Input( path: path, query: query, headers: headers )) } - /// Create a project column - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `POST /projects/{project_id}/columns`. - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)`. - @available(*, deprecated) - public func projectsCreateColumn( - path: Operations.ProjectsCreateColumn.Input.Path, - headers: Operations.ProjectsCreateColumn.Input.Headers = .init(), - body: Operations.ProjectsCreateColumn.Input.Body - ) async throws -> Operations.ProjectsCreateColumn.Output { - try await projectsCreateColumn(Operations.ProjectsCreateColumn.Input( + /// Add item to user owned project + /// + /// Add an issue or pull request item to the specified user owned project. + /// + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + public func projectsAddItemForUser( + path: Operations.ProjectsAddItemForUser.Input.Path, + headers: Operations.ProjectsAddItemForUser.Input.Headers = .init(), + body: Operations.ProjectsAddItemForUser.Input.Body + ) async throws -> Operations.ProjectsAddItemForUser.Output { + try await projectsAddItemForUser(Operations.ProjectsAddItemForUser.Input( path: path, headers: headers, body: body )) } - /// List repository projects - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)`. - @available(*, deprecated) - public func projectsListForRepo( - path: Operations.ProjectsListForRepo.Input.Path, - query: Operations.ProjectsListForRepo.Input.Query = .init(), - headers: Operations.ProjectsListForRepo.Input.Headers = .init() - ) async throws -> Operations.ProjectsListForRepo.Output { - try await projectsListForRepo(Operations.ProjectsListForRepo.Input( + /// Get an item for a user owned project + /// + /// Get a specific item from a user-owned project. + /// + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + public func projectsGetUserItem( + path: Operations.ProjectsGetUserItem.Input.Path, + query: Operations.ProjectsGetUserItem.Input.Query = .init(), + headers: Operations.ProjectsGetUserItem.Input.Headers = .init() + ) async throws -> Operations.ProjectsGetUserItem.Output { + try await projectsGetUserItem(Operations.ProjectsGetUserItem.Input( path: path, query: query, headers: headers )) } - /// Create a repository project - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)`. - @available(*, deprecated) - public func projectsCreateForRepo( - path: Operations.ProjectsCreateForRepo.Input.Path, - headers: Operations.ProjectsCreateForRepo.Input.Headers = .init(), - body: Operations.ProjectsCreateForRepo.Input.Body - ) async throws -> Operations.ProjectsCreateForRepo.Output { - try await projectsCreateForRepo(Operations.ProjectsCreateForRepo.Input( + /// Update project item for user + /// + /// Update a specific item in a user-owned project. + /// + /// - Remark: HTTP `PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + public func projectsUpdateItemForUser( + path: Operations.ProjectsUpdateItemForUser.Input.Path, + headers: Operations.ProjectsUpdateItemForUser.Input.Headers = .init(), + body: Operations.ProjectsUpdateItemForUser.Input.Body + ) async throws -> Operations.ProjectsUpdateItemForUser.Output { + try await projectsUpdateItemForUser(Operations.ProjectsUpdateItemForUser.Input( path: path, headers: headers, body: body )) } - /// Create a user project - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `POST /user/projects`. - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)`. - @available(*, deprecated) - public func projectsCreateForAuthenticatedUser( - headers: Operations.ProjectsCreateForAuthenticatedUser.Input.Headers = .init(), - body: Operations.ProjectsCreateForAuthenticatedUser.Input.Body - ) async throws -> Operations.ProjectsCreateForAuthenticatedUser.Output { - try await projectsCreateForAuthenticatedUser(Operations.ProjectsCreateForAuthenticatedUser.Input( - headers: headers, - body: body - )) - } - /// List user projects + /// Delete project item for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Delete a specific item from a user-owned project. /// - /// - Remark: HTTP `GET /users/{username}/projects`. - /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)`. - @available(*, deprecated) - public func projectsListForUser( - path: Operations.ProjectsListForUser.Input.Path, - query: Operations.ProjectsListForUser.Input.Query = .init(), - headers: Operations.ProjectsListForUser.Input.Headers = .init() - ) async throws -> Operations.ProjectsListForUser.Output { - try await projectsListForUser(Operations.ProjectsListForUser.Input( + /// - Remark: HTTP `DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + public func projectsDeleteItemForUser( + path: Operations.ProjectsDeleteItemForUser.Input.Path, + headers: Operations.ProjectsDeleteItemForUser.Input.Headers = .init() + ) async throws -> Operations.ProjectsDeleteItemForUser.Output { + try await projectsDeleteItemForUser(Operations.ProjectsDeleteItemForUser.Input( path: path, - query: query, headers: headers )) } @@ -954,35 +642,87 @@ public enum Components { case status } } - /// Validation Error Simple + /// An enterprise on GitHub. /// - /// - Remark: Generated from `#/components/schemas/validation-error-simple`. - public struct ValidationErrorSimple: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/validation-error-simple/message`. - public var message: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error-simple/documentation_url`. - public var documentationUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/validation-error-simple/errors`. - public var errors: [Swift.String]? - /// Creates a new `ValidationErrorSimple`. + /// - Remark: Generated from `#/components/schemas/enterprise`. + public struct Enterprise: Codable, Hashable, Sendable { + /// A short description of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/enterprise/html_url`. + public var htmlUrl: Swift.String + /// The enterprise's website URL. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/website_url`. + public var websiteUrl: Swift.String? + /// Unique identifier of the enterprise + /// + /// - Remark: Generated from `#/components/schemas/enterprise/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/enterprise/node_id`. + public var nodeId: Swift.String + /// The name of the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/name`. + public var name: Swift.String + /// The slug url identifier for the enterprise. + /// + /// - Remark: Generated from `#/components/schemas/enterprise/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/enterprise/created_at`. + public var createdAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/updated_at`. + public var updatedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/enterprise/avatar_url`. + public var avatarUrl: Swift.String + /// Creates a new `Enterprise`. /// /// - Parameters: - /// - message: - /// - documentationUrl: - /// - errors: + /// - description: A short description of the enterprise. + /// - htmlUrl: + /// - websiteUrl: The enterprise's website URL. + /// - id: Unique identifier of the enterprise + /// - nodeId: + /// - name: The name of the enterprise. + /// - slug: The slug url identifier for the enterprise. + /// - createdAt: + /// - updatedAt: + /// - avatarUrl: public init( - message: Swift.String, - documentationUrl: Swift.String, - errors: [Swift.String]? = nil + description: Swift.String? = nil, + htmlUrl: Swift.String, + websiteUrl: Swift.String? = nil, + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + slug: Swift.String, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + avatarUrl: Swift.String ) { - self.message = message - self.documentationUrl = documentationUrl - self.errors = errors + self.description = description + self.htmlUrl = htmlUrl + self.websiteUrl = websiteUrl + self.id = id + self.nodeId = nodeId + self.name = name + self.slug = slug + self.createdAt = createdAt + self.updatedAt = updatedAt + self.avatarUrl = avatarUrl } public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - case errors + case description + case htmlUrl = "html_url" + case websiteUrl = "website_url" + case id + case nodeId = "node_id" + case name + case slug + case createdAt = "created_at" + case updatedAt = "updated_at" + case avatarUrl = "avatar_url" } } /// Validation Error @@ -1255,2878 +995,4033 @@ public enum Components { case userViewType = "user_view_type" } } - /// Projects are a way to organize columns and cards of work. + /// License Simple /// - /// - Remark: Generated from `#/components/schemas/project`. - public struct Project: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/project/owner_url`. - public var ownerUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/project/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/project/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/project/columns_url`. - public var columnsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/project/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/project/node_id`. + /// - Remark: Generated from `#/components/schemas/nullable-license-simple`. + public struct NullableLicenseSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/key`. + public var key: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/spdx_id`. + public var spdxId: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/html_url`. + public var htmlUrl: Swift.String? + /// Creates a new `NullableLicenseSimple`. + /// + /// - Parameters: + /// - key: + /// - name: + /// - url: + /// - spdxId: + /// - nodeId: + /// - htmlUrl: + public init( + key: Swift.String, + name: Swift.String, + url: Swift.String? = nil, + spdxId: Swift.String? = nil, + nodeId: Swift.String, + htmlUrl: Swift.String? = nil + ) { + self.key = key + self.name = name + self.url = url + self.spdxId = spdxId + self.nodeId = nodeId + self.htmlUrl = htmlUrl + } + public enum CodingKeys: String, CodingKey { + case key + case name + case url + case spdxId = "spdx_id" + case nodeId = "node_id" + case htmlUrl = "html_url" + } + } + /// A repository on GitHub. + /// + /// - Remark: Generated from `#/components/schemas/repository`. + public struct Repository: Codable, Hashable, Sendable { + /// Unique identifier of the repository + /// + /// - Remark: Generated from `#/components/schemas/repository/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/repository/node_id`. public var nodeId: Swift.String - /// Name of the project + /// The name of the repository. /// - /// - Remark: Generated from `#/components/schemas/project/name`. + /// - Remark: Generated from `#/components/schemas/repository/name`. public var name: Swift.String - /// Body of the project + /// - Remark: Generated from `#/components/schemas/repository/full_name`. + public var fullName: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/license`. + public var license: Components.Schemas.NullableLicenseSimple? + /// - Remark: Generated from `#/components/schemas/repository/forks`. + public var forks: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/permissions/admin`. + public var admin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/permissions/triage`. + public var triage: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/permissions/maintain`. + public var maintain: Swift.Bool? + /// Creates a new `PermissionsPayload`. + /// + /// - Parameters: + /// - admin: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + public init( + admin: Swift.Bool, + pull: Swift.Bool, + triage: Swift.Bool? = nil, + push: Swift.Bool, + maintain: Swift.Bool? = nil + ) { + self.admin = admin + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + } + public enum CodingKeys: String, CodingKey { + case admin + case pull + case triage + case push + case maintain + } + } + /// - Remark: Generated from `#/components/schemas/repository/permissions`. + public var permissions: Components.Schemas.Repository.PermissionsPayload? + /// - Remark: Generated from `#/components/schemas/repository/owner`. + public var owner: Components.Schemas.SimpleUser + /// Whether the repository is private or public. + /// + /// - Remark: Generated from `#/components/schemas/repository/private`. + public var _private: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/fork`. + public var fork: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/archive_url`. + public var archiveUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/assignees_url`. + public var assigneesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/blobs_url`. + public var blobsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/branches_url`. + public var branchesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/collaborators_url`. + public var collaboratorsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/commits_url`. + public var commitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/compare_url`. + public var compareUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/contents_url`. + public var contentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/contributors_url`. + public var contributorsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/deployments_url`. + public var deploymentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/downloads_url`. + public var downloadsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/forks_url`. + public var forksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/git_commits_url`. + public var gitCommitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/git_refs_url`. + public var gitRefsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/git_tags_url`. + public var gitTagsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/git_url`. + public var gitUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/issue_comment_url`. + public var issueCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/issue_events_url`. + public var issueEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/issues_url`. + public var issuesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/keys_url`. + public var keysUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/labels_url`. + public var labelsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/languages_url`. + public var languagesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/merges_url`. + public var mergesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/milestones_url`. + public var milestonesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/notifications_url`. + public var notificationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/pulls_url`. + public var pullsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/releases_url`. + public var releasesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/ssh_url`. + public var sshUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/stargazers_url`. + public var stargazersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/subscribers_url`. + public var subscribersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/subscription_url`. + public var subscriptionUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/tags_url`. + public var tagsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/teams_url`. + public var teamsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/trees_url`. + public var treesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/clone_url`. + public var cloneUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/mirror_url`. + public var mirrorUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/hooks_url`. + public var hooksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/svn_url`. + public var svnUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/homepage`. + public var homepage: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/language`. + public var language: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/forks_count`. + public var forksCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository/stargazers_count`. + public var stargazersCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository/watchers_count`. + public var watchersCount: Swift.Int + /// The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + /// + /// - Remark: Generated from `#/components/schemas/repository/size`. + public var size: Swift.Int + /// The default branch of the repository. + /// + /// - Remark: Generated from `#/components/schemas/repository/default_branch`. + public var defaultBranch: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/open_issues_count`. + public var openIssuesCount: Swift.Int + /// Whether this repository acts as a template that can be used to generate new repositories. + /// + /// - Remark: Generated from `#/components/schemas/repository/is_template`. + public var isTemplate: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/topics`. + public var topics: [Swift.String]? + /// Whether issues are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_issues`. + public var hasIssues: Swift.Bool + /// Whether projects are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_projects`. + public var hasProjects: Swift.Bool + /// Whether the wiki is enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_wiki`. + public var hasWiki: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/has_pages`. + public var hasPages: Swift.Bool + /// Whether downloads are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_downloads`. + @available(*, deprecated) + public var hasDownloads: Swift.Bool + /// Whether discussions are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_discussions`. + public var hasDiscussions: Swift.Bool? + /// Whether the repository is archived. + /// + /// - Remark: Generated from `#/components/schemas/repository/archived`. + public var archived: Swift.Bool + /// Returns whether or not this repository disabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/disabled`. + public var disabled: Swift.Bool + /// The repository visibility: public, private, or internal. + /// + /// - Remark: Generated from `#/components/schemas/repository/visibility`. + public var visibility: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/pushed_at`. + public var pushedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/repository/created_at`. + public var createdAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/repository/updated_at`. + public var updatedAt: Foundation.Date? + /// Whether to allow rebase merges for pull requests. + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_rebase_merge`. + public var allowRebaseMerge: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/temp_clone_token`. + public var tempCloneToken: Swift.String? + /// Whether to allow squash merges for pull requests. + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_squash_merge`. + public var allowSquashMerge: Swift.Bool? + /// Whether to allow Auto-merge to be used on pull requests. + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_auto_merge`. + public var allowAutoMerge: Swift.Bool? + /// Whether to delete head branches when pull requests are merged + /// + /// - Remark: Generated from `#/components/schemas/repository/delete_branch_on_merge`. + public var deleteBranchOnMerge: Swift.Bool? + /// Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_update_branch`. + public var allowUpdateBranch: Swift.Bool? + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. + /// + /// - Remark: Generated from `#/components/schemas/repository/use_squash_pr_title_as_default`. + @available(*, deprecated) + public var useSquashPrTitleAsDefault: Swift.Bool? + /// The default value for a squash merge commit title: + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// + /// - Remark: Generated from `#/components/schemas/repository/squash_merge_commit_title`. + @frozen public enum SquashMergeCommitTitlePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prTitle = "PR_TITLE" + case commitOrPrTitle = "COMMIT_OR_PR_TITLE" + } + /// The default value for a squash merge commit title: + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// + /// - Remark: Generated from `#/components/schemas/repository/squash_merge_commit_title`. + public var squashMergeCommitTitle: Components.Schemas.Repository.SquashMergeCommitTitlePayload? + /// The default value for a squash merge commit message: + /// + /// - `PR_BODY` - default to the pull request's body. + /// - `COMMIT_MESSAGES` - default to the branch's commit messages. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/repository/squash_merge_commit_message`. + @frozen public enum SquashMergeCommitMessagePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prBody = "PR_BODY" + case commitMessages = "COMMIT_MESSAGES" + case blank = "BLANK" + } + /// The default value for a squash merge commit message: + /// + /// - `PR_BODY` - default to the pull request's body. + /// - `COMMIT_MESSAGES` - default to the branch's commit messages. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/repository/squash_merge_commit_message`. + public var squashMergeCommitMessage: Components.Schemas.Repository.SquashMergeCommitMessagePayload? + /// The default value for a merge commit title. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// + /// - Remark: Generated from `#/components/schemas/repository/merge_commit_title`. + @frozen public enum MergeCommitTitlePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prTitle = "PR_TITLE" + case mergeMessage = "MERGE_MESSAGE" + } + /// The default value for a merge commit title. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// + /// - Remark: Generated from `#/components/schemas/repository/merge_commit_title`. + public var mergeCommitTitle: Components.Schemas.Repository.MergeCommitTitlePayload? + /// The default value for a merge commit message. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `PR_BODY` - default to the pull request's body. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/repository/merge_commit_message`. + @frozen public enum MergeCommitMessagePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prBody = "PR_BODY" + case prTitle = "PR_TITLE" + case blank = "BLANK" + } + /// The default value for a merge commit message. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `PR_BODY` - default to the pull request's body. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/repository/merge_commit_message`. + public var mergeCommitMessage: Components.Schemas.Repository.MergeCommitMessagePayload? + /// Whether to allow merge commits for pull requests. + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_merge_commit`. + public var allowMergeCommit: Swift.Bool? + /// Whether to allow forking this repo /// - /// - Remark: Generated from `#/components/schemas/project/body`. - public var body: Swift.String? - /// - Remark: Generated from `#/components/schemas/project/number`. - public var number: Swift.Int - /// State of the project; either 'open' or 'closed' + /// - Remark: Generated from `#/components/schemas/repository/allow_forking`. + public var allowForking: Swift.Bool? + /// Whether to require contributors to sign off on web-based commits /// - /// - Remark: Generated from `#/components/schemas/project/state`. - public var state: Swift.String - /// - Remark: Generated from `#/components/schemas/project/creator`. - public var creator: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/project/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/project/updated_at`. - public var updatedAt: Foundation.Date - /// The baseline permission that all organization members have on this project. Only present if owner is an organization. + /// - Remark: Generated from `#/components/schemas/repository/web_commit_signoff_required`. + public var webCommitSignoffRequired: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/open_issues`. + public var openIssues: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository/watchers`. + public var watchers: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository/master_branch`. + public var masterBranch: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/starred_at`. + public var starredAt: Swift.String? + /// Whether anonymous git access is enabled for this repository /// - /// - Remark: Generated from `#/components/schemas/project/organization_permission`. - @frozen public enum OrganizationPermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case read = "read" - case write = "write" - case admin = "admin" - case none = "none" - } - /// The baseline permission that all organization members have on this project. Only present if owner is an organization. + /// - Remark: Generated from `#/components/schemas/repository/anonymous_access_enabled`. + public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository /// - /// - Remark: Generated from `#/components/schemas/project/organization_permission`. - public var organizationPermission: Components.Schemas.Project.OrganizationPermissionPayload? - /// Whether or not this project can be seen by everyone. Only present if owner is an organization. + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository /// - /// - Remark: Generated from `#/components/schemas/project/private`. - public var _private: Swift.Bool? - /// Creates a new `Project`. + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? + /// Creates a new `Repository`. /// /// - Parameters: - /// - ownerUrl: - /// - url: - /// - htmlUrl: - /// - columnsUrl: - /// - id: + /// - id: Unique identifier of the repository /// - nodeId: - /// - name: Name of the project - /// - body: Body of the project - /// - number: - /// - state: State of the project; either 'open' or 'closed' - /// - creator: + /// - name: The name of the repository. + /// - fullName: + /// - license: + /// - forks: + /// - permissions: + /// - owner: + /// - _private: Whether the repository is private or public. + /// - htmlUrl: + /// - description: + /// - fork: + /// - url: + /// - archiveUrl: + /// - assigneesUrl: + /// - blobsUrl: + /// - branchesUrl: + /// - collaboratorsUrl: + /// - commentsUrl: + /// - commitsUrl: + /// - compareUrl: + /// - contentsUrl: + /// - contributorsUrl: + /// - deploymentsUrl: + /// - downloadsUrl: + /// - eventsUrl: + /// - forksUrl: + /// - gitCommitsUrl: + /// - gitRefsUrl: + /// - gitTagsUrl: + /// - gitUrl: + /// - issueCommentUrl: + /// - issueEventsUrl: + /// - issuesUrl: + /// - keysUrl: + /// - labelsUrl: + /// - languagesUrl: + /// - mergesUrl: + /// - milestonesUrl: + /// - notificationsUrl: + /// - pullsUrl: + /// - releasesUrl: + /// - sshUrl: + /// - stargazersUrl: + /// - statusesUrl: + /// - subscribersUrl: + /// - subscriptionUrl: + /// - tagsUrl: + /// - teamsUrl: + /// - treesUrl: + /// - cloneUrl: + /// - mirrorUrl: + /// - hooksUrl: + /// - svnUrl: + /// - homepage: + /// - language: + /// - forksCount: + /// - stargazersCount: + /// - watchersCount: + /// - size: The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + /// - defaultBranch: The default branch of the repository. + /// - openIssuesCount: + /// - isTemplate: Whether this repository acts as a template that can be used to generate new repositories. + /// - topics: + /// - hasIssues: Whether issues are enabled. + /// - hasProjects: Whether projects are enabled. + /// - hasWiki: Whether the wiki is enabled. + /// - hasPages: + /// - hasDownloads: Whether downloads are enabled. + /// - hasDiscussions: Whether discussions are enabled. + /// - archived: Whether the repository is archived. + /// - disabled: Returns whether or not this repository disabled. + /// - visibility: The repository visibility: public, private, or internal. + /// - pushedAt: /// - createdAt: /// - updatedAt: - /// - organizationPermission: The baseline permission that all organization members have on this project. Only present if owner is an organization. - /// - _private: Whether or not this project can be seen by everyone. Only present if owner is an organization. + /// - allowRebaseMerge: Whether to allow rebase merges for pull requests. + /// - tempCloneToken: + /// - allowSquashMerge: Whether to allow squash merges for pull requests. + /// - allowAutoMerge: Whether to allow Auto-merge to be used on pull requests. + /// - deleteBranchOnMerge: Whether to delete head branches when pull requests are merged + /// - allowUpdateBranch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. + /// - useSquashPrTitleAsDefault: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. + /// - squashMergeCommitTitle: The default value for a squash merge commit title: + /// - squashMergeCommitMessage: The default value for a squash merge commit message: + /// - mergeCommitTitle: The default value for a merge commit title. + /// - mergeCommitMessage: The default value for a merge commit message. + /// - allowMergeCommit: Whether to allow merge commits for pull requests. + /// - allowForking: Whether to allow forking this repo + /// - webCommitSignoffRequired: Whether to require contributors to sign off on web-based commits + /// - openIssues: + /// - watchers: + /// - masterBranch: + /// - starredAt: + /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository public init( - ownerUrl: Swift.String, - url: Swift.String, - htmlUrl: Swift.String, - columnsUrl: Swift.String, - id: Swift.Int, + id: Swift.Int64, nodeId: Swift.String, name: Swift.String, - body: Swift.String? = nil, - number: Swift.Int, - state: Swift.String, - creator: Components.Schemas.NullableSimpleUser? = nil, - createdAt: Foundation.Date, - updatedAt: Foundation.Date, - organizationPermission: Components.Schemas.Project.OrganizationPermissionPayload? = nil, - _private: Swift.Bool? = nil + fullName: Swift.String, + license: Components.Schemas.NullableLicenseSimple? = nil, + forks: Swift.Int, + permissions: Components.Schemas.Repository.PermissionsPayload? = nil, + owner: Components.Schemas.SimpleUser, + _private: Swift.Bool, + htmlUrl: Swift.String, + description: Swift.String? = nil, + fork: Swift.Bool, + url: Swift.String, + archiveUrl: Swift.String, + assigneesUrl: Swift.String, + blobsUrl: Swift.String, + branchesUrl: Swift.String, + collaboratorsUrl: Swift.String, + commentsUrl: Swift.String, + commitsUrl: Swift.String, + compareUrl: Swift.String, + contentsUrl: Swift.String, + contributorsUrl: Swift.String, + deploymentsUrl: Swift.String, + downloadsUrl: Swift.String, + eventsUrl: Swift.String, + forksUrl: Swift.String, + gitCommitsUrl: Swift.String, + gitRefsUrl: Swift.String, + gitTagsUrl: Swift.String, + gitUrl: Swift.String, + issueCommentUrl: Swift.String, + issueEventsUrl: Swift.String, + issuesUrl: Swift.String, + keysUrl: Swift.String, + labelsUrl: Swift.String, + languagesUrl: Swift.String, + mergesUrl: Swift.String, + milestonesUrl: Swift.String, + notificationsUrl: Swift.String, + pullsUrl: Swift.String, + releasesUrl: Swift.String, + sshUrl: Swift.String, + stargazersUrl: Swift.String, + statusesUrl: Swift.String, + subscribersUrl: Swift.String, + subscriptionUrl: Swift.String, + tagsUrl: Swift.String, + teamsUrl: Swift.String, + treesUrl: Swift.String, + cloneUrl: Swift.String, + mirrorUrl: Swift.String? = nil, + hooksUrl: Swift.String, + svnUrl: Swift.String, + homepage: Swift.String? = nil, + language: Swift.String? = nil, + forksCount: Swift.Int, + stargazersCount: Swift.Int, + watchersCount: Swift.Int, + size: Swift.Int, + defaultBranch: Swift.String, + openIssuesCount: Swift.Int, + isTemplate: Swift.Bool? = nil, + topics: [Swift.String]? = nil, + hasIssues: Swift.Bool, + hasProjects: Swift.Bool, + hasWiki: Swift.Bool, + hasPages: Swift.Bool, + hasDownloads: Swift.Bool, + hasDiscussions: Swift.Bool? = nil, + archived: Swift.Bool, + disabled: Swift.Bool, + visibility: Swift.String? = nil, + pushedAt: Foundation.Date? = nil, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + allowRebaseMerge: Swift.Bool? = nil, + tempCloneToken: Swift.String? = nil, + allowSquashMerge: Swift.Bool? = nil, + allowAutoMerge: Swift.Bool? = nil, + deleteBranchOnMerge: Swift.Bool? = nil, + allowUpdateBranch: Swift.Bool? = nil, + useSquashPrTitleAsDefault: Swift.Bool? = nil, + squashMergeCommitTitle: Components.Schemas.Repository.SquashMergeCommitTitlePayload? = nil, + squashMergeCommitMessage: Components.Schemas.Repository.SquashMergeCommitMessagePayload? = nil, + mergeCommitTitle: Components.Schemas.Repository.MergeCommitTitlePayload? = nil, + mergeCommitMessage: Components.Schemas.Repository.MergeCommitMessagePayload? = nil, + allowMergeCommit: Swift.Bool? = nil, + allowForking: Swift.Bool? = nil, + webCommitSignoffRequired: Swift.Bool? = nil, + openIssues: Swift.Int, + watchers: Swift.Int, + masterBranch: Swift.String? = nil, + starredAt: Swift.String? = nil, + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? = nil ) { - self.ownerUrl = ownerUrl - self.url = url - self.htmlUrl = htmlUrl - self.columnsUrl = columnsUrl self.id = id self.nodeId = nodeId self.name = name - self.body = body - self.number = number - self.state = state - self.creator = creator + self.fullName = fullName + self.license = license + self.forks = forks + self.permissions = permissions + self.owner = owner + self._private = _private + self.htmlUrl = htmlUrl + self.description = description + self.fork = fork + self.url = url + self.archiveUrl = archiveUrl + self.assigneesUrl = assigneesUrl + self.blobsUrl = blobsUrl + self.branchesUrl = branchesUrl + self.collaboratorsUrl = collaboratorsUrl + self.commentsUrl = commentsUrl + self.commitsUrl = commitsUrl + self.compareUrl = compareUrl + self.contentsUrl = contentsUrl + self.contributorsUrl = contributorsUrl + self.deploymentsUrl = deploymentsUrl + self.downloadsUrl = downloadsUrl + self.eventsUrl = eventsUrl + self.forksUrl = forksUrl + self.gitCommitsUrl = gitCommitsUrl + self.gitRefsUrl = gitRefsUrl + self.gitTagsUrl = gitTagsUrl + self.gitUrl = gitUrl + self.issueCommentUrl = issueCommentUrl + self.issueEventsUrl = issueEventsUrl + self.issuesUrl = issuesUrl + self.keysUrl = keysUrl + self.labelsUrl = labelsUrl + self.languagesUrl = languagesUrl + self.mergesUrl = mergesUrl + self.milestonesUrl = milestonesUrl + self.notificationsUrl = notificationsUrl + self.pullsUrl = pullsUrl + self.releasesUrl = releasesUrl + self.sshUrl = sshUrl + self.stargazersUrl = stargazersUrl + self.statusesUrl = statusesUrl + self.subscribersUrl = subscribersUrl + self.subscriptionUrl = subscriptionUrl + self.tagsUrl = tagsUrl + self.teamsUrl = teamsUrl + self.treesUrl = treesUrl + self.cloneUrl = cloneUrl + self.mirrorUrl = mirrorUrl + self.hooksUrl = hooksUrl + self.svnUrl = svnUrl + self.homepage = homepage + self.language = language + self.forksCount = forksCount + self.stargazersCount = stargazersCount + self.watchersCount = watchersCount + self.size = size + self.defaultBranch = defaultBranch + self.openIssuesCount = openIssuesCount + self.isTemplate = isTemplate + self.topics = topics + self.hasIssues = hasIssues + self.hasProjects = hasProjects + self.hasWiki = hasWiki + self.hasPages = hasPages + self.hasDownloads = hasDownloads + self.hasDiscussions = hasDiscussions + self.archived = archived + self.disabled = disabled + self.visibility = visibility + self.pushedAt = pushedAt self.createdAt = createdAt self.updatedAt = updatedAt - self.organizationPermission = organizationPermission - self._private = _private + self.allowRebaseMerge = allowRebaseMerge + self.tempCloneToken = tempCloneToken + self.allowSquashMerge = allowSquashMerge + self.allowAutoMerge = allowAutoMerge + self.deleteBranchOnMerge = deleteBranchOnMerge + self.allowUpdateBranch = allowUpdateBranch + self.useSquashPrTitleAsDefault = useSquashPrTitleAsDefault + self.squashMergeCommitTitle = squashMergeCommitTitle + self.squashMergeCommitMessage = squashMergeCommitMessage + self.mergeCommitTitle = mergeCommitTitle + self.mergeCommitMessage = mergeCommitMessage + self.allowMergeCommit = allowMergeCommit + self.allowForking = allowForking + self.webCommitSignoffRequired = webCommitSignoffRequired + self.openIssues = openIssues + self.watchers = watchers + self.masterBranch = masterBranch + self.starredAt = starredAt + self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus } public enum CodingKeys: String, CodingKey { - case ownerUrl = "owner_url" - case url - case htmlUrl = "html_url" - case columnsUrl = "columns_url" case id case nodeId = "node_id" case name - case body - case number - case state - case creator + case fullName = "full_name" + case license + case forks + case permissions + case owner + case _private = "private" + case htmlUrl = "html_url" + case description + case fork + case url + case archiveUrl = "archive_url" + case assigneesUrl = "assignees_url" + case blobsUrl = "blobs_url" + case branchesUrl = "branches_url" + case collaboratorsUrl = "collaborators_url" + case commentsUrl = "comments_url" + case commitsUrl = "commits_url" + case compareUrl = "compare_url" + case contentsUrl = "contents_url" + case contributorsUrl = "contributors_url" + case deploymentsUrl = "deployments_url" + case downloadsUrl = "downloads_url" + case eventsUrl = "events_url" + case forksUrl = "forks_url" + case gitCommitsUrl = "git_commits_url" + case gitRefsUrl = "git_refs_url" + case gitTagsUrl = "git_tags_url" + case gitUrl = "git_url" + case issueCommentUrl = "issue_comment_url" + case issueEventsUrl = "issue_events_url" + case issuesUrl = "issues_url" + case keysUrl = "keys_url" + case labelsUrl = "labels_url" + case languagesUrl = "languages_url" + case mergesUrl = "merges_url" + case milestonesUrl = "milestones_url" + case notificationsUrl = "notifications_url" + case pullsUrl = "pulls_url" + case releasesUrl = "releases_url" + case sshUrl = "ssh_url" + case stargazersUrl = "stargazers_url" + case statusesUrl = "statuses_url" + case subscribersUrl = "subscribers_url" + case subscriptionUrl = "subscription_url" + case tagsUrl = "tags_url" + case teamsUrl = "teams_url" + case treesUrl = "trees_url" + case cloneUrl = "clone_url" + case mirrorUrl = "mirror_url" + case hooksUrl = "hooks_url" + case svnUrl = "svn_url" + case homepage + case language + case forksCount = "forks_count" + case stargazersCount = "stargazers_count" + case watchersCount = "watchers_count" + case size + case defaultBranch = "default_branch" + case openIssuesCount = "open_issues_count" + case isTemplate = "is_template" + case topics + case hasIssues = "has_issues" + case hasProjects = "has_projects" + case hasWiki = "has_wiki" + case hasPages = "has_pages" + case hasDownloads = "has_downloads" + case hasDiscussions = "has_discussions" + case archived + case disabled + case visibility + case pushedAt = "pushed_at" case createdAt = "created_at" case updatedAt = "updated_at" - case organizationPermission = "organization_permission" - case _private = "private" + case allowRebaseMerge = "allow_rebase_merge" + case tempCloneToken = "temp_clone_token" + case allowSquashMerge = "allow_squash_merge" + case allowAutoMerge = "allow_auto_merge" + case deleteBranchOnMerge = "delete_branch_on_merge" + case allowUpdateBranch = "allow_update_branch" + case useSquashPrTitleAsDefault = "use_squash_pr_title_as_default" + case squashMergeCommitTitle = "squash_merge_commit_title" + case squashMergeCommitMessage = "squash_merge_commit_message" + case mergeCommitTitle = "merge_commit_title" + case mergeCommitMessage = "merge_commit_message" + case allowMergeCommit = "allow_merge_commit" + case allowForking = "allow_forking" + case webCommitSignoffRequired = "web_commit_signoff_required" + case openIssues = "open_issues" + case watchers + case masterBranch = "master_branch" + case starredAt = "starred_at" + case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" } } - /// Project cards represent a scope of work. + /// A collection of related issues and pull requests. /// - /// - Remark: Generated from `#/components/schemas/project-card`. - public struct ProjectCard: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/project-card/url`. + /// - Remark: Generated from `#/components/schemas/nullable-milestone`. + public struct NullableMilestone: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-milestone/url`. public var url: Swift.String - /// The project card's ID + /// - Remark: Generated from `#/components/schemas/nullable-milestone/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/labels_url`. + public var labelsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/node_id`. + public var nodeId: Swift.String + /// The number of the milestone. /// - /// - Remark: Generated from `#/components/schemas/project-card/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/project-card/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/project-card/note`. - public var note: Swift.String? - /// - Remark: Generated from `#/components/schemas/project-card/creator`. + /// - Remark: Generated from `#/components/schemas/nullable-milestone/number`. + public var number: Swift.Int + /// The state of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + } + /// The state of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. + public var state: Components.Schemas.NullableMilestone.StatePayload + /// The title of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/creator`. public var creator: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/project-card/created_at`. + /// - Remark: Generated from `#/components/schemas/nullable-milestone/open_issues`. + public var openIssues: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_issues`. + public var closedIssues: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/created_at`. public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/project-card/updated_at`. + /// - Remark: Generated from `#/components/schemas/nullable-milestone/updated_at`. public var updatedAt: Foundation.Date - /// Whether or not the card is archived - /// - /// - Remark: Generated from `#/components/schemas/project-card/archived`. - public var archived: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/project-card/column_name`. - public var columnName: Swift.String? - /// - Remark: Generated from `#/components/schemas/project-card/project_id`. - public var projectId: Swift.String? - /// - Remark: Generated from `#/components/schemas/project-card/column_url`. - public var columnUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/project-card/content_url`. - public var contentUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/project-card/project_url`. - public var projectUrl: Swift.String - /// Creates a new `ProjectCard`. + /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_at`. + public var closedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/due_on`. + public var dueOn: Foundation.Date? + /// Creates a new `NullableMilestone`. /// /// - Parameters: /// - url: - /// - id: The project card's ID + /// - htmlUrl: + /// - labelsUrl: + /// - id: /// - nodeId: - /// - note: + /// - number: The number of the milestone. + /// - state: The state of the milestone. + /// - title: The title of the milestone. + /// - description: /// - creator: + /// - openIssues: + /// - closedIssues: /// - createdAt: /// - updatedAt: - /// - archived: Whether or not the card is archived - /// - columnName: - /// - projectId: - /// - columnUrl: - /// - contentUrl: - /// - projectUrl: + /// - closedAt: + /// - dueOn: public init( url: Swift.String, - id: Swift.Int64, + htmlUrl: Swift.String, + labelsUrl: Swift.String, + id: Swift.Int, nodeId: Swift.String, - note: Swift.String? = nil, + number: Swift.Int, + state: Components.Schemas.NullableMilestone.StatePayload, + title: Swift.String, + description: Swift.String? = nil, creator: Components.Schemas.NullableSimpleUser? = nil, + openIssues: Swift.Int, + closedIssues: Swift.Int, createdAt: Foundation.Date, updatedAt: Foundation.Date, - archived: Swift.Bool? = nil, - columnName: Swift.String? = nil, - projectId: Swift.String? = nil, - columnUrl: Swift.String, - contentUrl: Swift.String? = nil, - projectUrl: Swift.String + closedAt: Foundation.Date? = nil, + dueOn: Foundation.Date? = nil ) { self.url = url + self.htmlUrl = htmlUrl + self.labelsUrl = labelsUrl self.id = id self.nodeId = nodeId - self.note = note + self.number = number + self.state = state + self.title = title + self.description = description self.creator = creator + self.openIssues = openIssues + self.closedIssues = closedIssues self.createdAt = createdAt self.updatedAt = updatedAt - self.archived = archived - self.columnName = columnName - self.projectId = projectId - self.columnUrl = columnUrl - self.contentUrl = contentUrl - self.projectUrl = projectUrl + self.closedAt = closedAt + self.dueOn = dueOn } public enum CodingKeys: String, CodingKey { case url + case htmlUrl = "html_url" + case labelsUrl = "labels_url" case id case nodeId = "node_id" - case note + case number + case state + case title + case description case creator + case openIssues = "open_issues" + case closedIssues = "closed_issues" case createdAt = "created_at" case updatedAt = "updated_at" - case archived - case columnName = "column_name" - case projectId = "project_id" - case columnUrl = "column_url" - case contentUrl = "content_url" - case projectUrl = "project_url" + case closedAt = "closed_at" + case dueOn = "due_on" } } - /// Project columns contain cards of work. + /// The type of issue. /// - /// - Remark: Generated from `#/components/schemas/project-column`. - public struct ProjectColumn: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/project-column/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/project-column/project_url`. - public var projectUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/project-column/cards_url`. - public var cardsUrl: Swift.String - /// The unique identifier of the project column + /// - Remark: Generated from `#/components/schemas/issue-type`. + public struct IssueType: Codable, Hashable, Sendable { + /// The unique identifier of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/id`. + public var id: Swift.Int + /// The node identifier of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/node_id`. + public var nodeId: Swift.String + /// The name of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/name`. + public var name: Swift.String + /// The description of the issue type. /// - /// - Remark: Generated from `#/components/schemas/project-column/id`. + /// - Remark: Generated from `#/components/schemas/issue-type/description`. + public var description: Swift.String? + /// The color of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/color`. + @frozen public enum ColorPayload: String, Codable, Hashable, Sendable, CaseIterable { + case gray = "gray" + case blue = "blue" + case green = "green" + case yellow = "yellow" + case orange = "orange" + case red = "red" + case pink = "pink" + case purple = "purple" + } + /// The color of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/color`. + public var color: Components.Schemas.IssueType.ColorPayload? + /// The time the issue type created. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/created_at`. + public var createdAt: Foundation.Date? + /// The time the issue type last updated. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/updated_at`. + public var updatedAt: Foundation.Date? + /// The enabled state of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/is_enabled`. + public var isEnabled: Swift.Bool? + /// Creates a new `IssueType`. + /// + /// - Parameters: + /// - id: The unique identifier of the issue type. + /// - nodeId: The node identifier of the issue type. + /// - name: The name of the issue type. + /// - description: The description of the issue type. + /// - color: The color of the issue type. + /// - createdAt: The time the issue type created. + /// - updatedAt: The time the issue type last updated. + /// - isEnabled: The enabled state of the issue type. + public init( + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + color: Components.Schemas.IssueType.ColorPayload? = nil, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + isEnabled: Swift.Bool? = nil + ) { + self.id = id + self.nodeId = nodeId + self.name = name + self.description = description + self.color = color + self.createdAt = createdAt + self.updatedAt = updatedAt + self.isEnabled = isEnabled + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case name + case description + case color + case createdAt = "created_at" + case updatedAt = "updated_at" + case isEnabled = "is_enabled" + } + } + /// GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration`. + public struct NullableIntegration: Codable, Hashable, Sendable { + /// Unique identifier of the GitHub app + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/id`. public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/project-column/node_id`. + /// The slug name of the GitHub app + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/slug`. + public var slug: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/node_id`. public var nodeId: Swift.String - /// Name of the project column + /// - Remark: Generated from `#/components/schemas/nullable-integration/client_id`. + public var clientId: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. + @frozen public enum OwnerPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case1`. + case SimpleUser(Components.Schemas.SimpleUser) + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner/case2`. + case Enterprise(Components.Schemas.Enterprise) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .SimpleUser(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .Enterprise(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .SimpleUser(value): + try value.encode(to: encoder) + case let .Enterprise(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/nullable-integration/owner`. + public var owner: Components.Schemas.NullableIntegration.OwnerPayload + /// The name of the GitHub app /// - /// - Remark: Generated from `#/components/schemas/project-column/name`. + /// - Remark: Generated from `#/components/schemas/nullable-integration/name`. public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/project-column/created_at`. + /// - Remark: Generated from `#/components/schemas/nullable-integration/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/external_url`. + public var externalUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-integration/created_at`. public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/project-column/updated_at`. + /// - Remark: Generated from `#/components/schemas/nullable-integration/updated_at`. public var updatedAt: Foundation.Date - /// Creates a new `ProjectColumn`. + /// The set of permissions for the GitHub app + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/issues`. + public var issues: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/checks`. + public var checks: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/metadata`. + public var metadata: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/contents`. + public var contents: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions/deployments`. + public var deployments: Swift.String? + /// A container of undocumented properties. + public var additionalProperties: [String: Swift.String] + /// Creates a new `PermissionsPayload`. + /// + /// - Parameters: + /// - issues: + /// - checks: + /// - metadata: + /// - contents: + /// - deployments: + /// - additionalProperties: A container of undocumented properties. + public init( + issues: Swift.String? = nil, + checks: Swift.String? = nil, + metadata: Swift.String? = nil, + contents: Swift.String? = nil, + deployments: Swift.String? = nil, + additionalProperties: [String: Swift.String] = .init() + ) { + self.issues = issues + self.checks = checks + self.metadata = metadata + self.contents = contents + self.deployments = deployments + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case issues + case checks + case metadata + case contents + case deployments + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.issues = try container.decodeIfPresent( + Swift.String.self, + forKey: .issues + ) + self.checks = try container.decodeIfPresent( + Swift.String.self, + forKey: .checks + ) + self.metadata = try container.decodeIfPresent( + Swift.String.self, + forKey: .metadata + ) + self.contents = try container.decodeIfPresent( + Swift.String.self, + forKey: .contents + ) + self.deployments = try container.decodeIfPresent( + Swift.String.self, + forKey: .deployments + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "issues", + "checks", + "metadata", + "contents", + "deployments" + ]) + } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + self.issues, + forKey: .issues + ) + try container.encodeIfPresent( + self.checks, + forKey: .checks + ) + try container.encodeIfPresent( + self.metadata, + forKey: .metadata + ) + try container.encodeIfPresent( + self.contents, + forKey: .contents + ) + try container.encodeIfPresent( + self.deployments, + forKey: .deployments + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The set of permissions for the GitHub app + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. + public var permissions: Components.Schemas.NullableIntegration.PermissionsPayload + /// The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/events`. + public var events: [Swift.String] + /// The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. + /// + /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. + public var installationsCount: Swift.Int? + /// Creates a new `NullableIntegration`. /// /// - Parameters: - /// - url: - /// - projectUrl: - /// - cardsUrl: - /// - id: The unique identifier of the project column + /// - id: Unique identifier of the GitHub app + /// - slug: The slug name of the GitHub app /// - nodeId: - /// - name: Name of the project column + /// - clientId: + /// - owner: + /// - name: The name of the GitHub app + /// - description: + /// - externalUrl: + /// - htmlUrl: /// - createdAt: /// - updatedAt: + /// - permissions: The set of permissions for the GitHub app + /// - events: The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. + /// - installationsCount: The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. public init( - url: Swift.String, - projectUrl: Swift.String, - cardsUrl: Swift.String, id: Swift.Int, + slug: Swift.String? = nil, nodeId: Swift.String, + clientId: Swift.String? = nil, + owner: Components.Schemas.NullableIntegration.OwnerPayload, name: Swift.String, + description: Swift.String? = nil, + externalUrl: Swift.String, + htmlUrl: Swift.String, createdAt: Foundation.Date, - updatedAt: Foundation.Date + updatedAt: Foundation.Date, + permissions: Components.Schemas.NullableIntegration.PermissionsPayload, + events: [Swift.String], + installationsCount: Swift.Int? = nil ) { - self.url = url - self.projectUrl = projectUrl - self.cardsUrl = cardsUrl self.id = id + self.slug = slug self.nodeId = nodeId + self.clientId = clientId + self.owner = owner self.name = name + self.description = description + self.externalUrl = externalUrl + self.htmlUrl = htmlUrl self.createdAt = createdAt self.updatedAt = updatedAt + self.permissions = permissions + self.events = events + self.installationsCount = installationsCount } public enum CodingKeys: String, CodingKey { - case url - case projectUrl = "project_url" - case cardsUrl = "cards_url" case id + case slug case nodeId = "node_id" + case clientId = "client_id" + case owner case name + case description + case externalUrl = "external_url" + case htmlUrl = "html_url" case createdAt = "created_at" case updatedAt = "updated_at" + case permissions + case events + case installationsCount = "installations_count" } } - /// Project Collaborator Permission + /// How the author is associated with the repository. /// - /// - Remark: Generated from `#/components/schemas/project-collaborator-permission`. - public struct ProjectCollaboratorPermission: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/project-collaborator-permission/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/project-collaborator-permission/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// Creates a new `ProjectCollaboratorPermission`. + /// - Remark: Generated from `#/components/schemas/author-association`. + @frozen public enum AuthorAssociation: String, Codable, Hashable, Sendable, CaseIterable { + case collaborator = "COLLABORATOR" + case contributor = "CONTRIBUTOR" + case firstTimer = "FIRST_TIMER" + case firstTimeContributor = "FIRST_TIME_CONTRIBUTOR" + case mannequin = "MANNEQUIN" + case member = "MEMBER" + case none = "NONE" + case owner = "OWNER" + } + /// - Remark: Generated from `#/components/schemas/reaction-rollup`. + public struct ReactionRollup: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/reaction-rollup/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/reaction-rollup/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/+1`. + public var _plus_1: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/-1`. + public var _hyphen_1: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/laugh`. + public var laugh: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/confused`. + public var confused: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/heart`. + public var heart: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/hooray`. + public var hooray: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/eyes`. + public var eyes: Swift.Int + /// - Remark: Generated from `#/components/schemas/reaction-rollup/rocket`. + public var rocket: Swift.Int + /// Creates a new `ReactionRollup`. /// /// - Parameters: - /// - permission: - /// - user: + /// - url: + /// - totalCount: + /// - _plus_1: + /// - _hyphen_1: + /// - laugh: + /// - confused: + /// - heart: + /// - hooray: + /// - eyes: + /// - rocket: public init( - permission: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil + url: Swift.String, + totalCount: Swift.Int, + _plus_1: Swift.Int, + _hyphen_1: Swift.Int, + laugh: Swift.Int, + confused: Swift.Int, + heart: Swift.Int, + hooray: Swift.Int, + eyes: Swift.Int, + rocket: Swift.Int ) { - self.permission = permission - self.user = user + self.url = url + self.totalCount = totalCount + self._plus_1 = _plus_1 + self._hyphen_1 = _hyphen_1 + self.laugh = laugh + self.confused = confused + self.heart = heart + self.hooray = hooray + self.eyes = eyes + self.rocket = rocket } public enum CodingKeys: String, CodingKey { - case permission - case user + case url + case totalCount = "total_count" + case _plus_1 = "+1" + case _hyphen_1 = "-1" + case laugh + case confused + case heart + case hooray + case eyes + case rocket } } - } - /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters { - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/components/parameters/per-page`. - public typealias PerPage = Swift.Int - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/components/parameters/page`. - public typealias Page = Swift.Int - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/owner`. - public typealias Owner = Swift.String - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/repo`. - public typealias Repo = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String - /// The unique identifier of the project. - /// - /// - Remark: Generated from `#/components/parameters/project-id`. - public typealias ProjectId = Swift.Int - /// The unique identifier of the card. - /// - /// - Remark: Generated from `#/components/parameters/card-id`. - public typealias CardId = Swift.Int - /// The unique identifier of the column. - /// - /// - Remark: Generated from `#/components/parameters/column-id`. - public typealias ColumnId = Swift.Int - } - /// 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 { - public struct ValidationFailedSimple: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. - case json(Components.Schemas.ValidationErrorSimple) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ValidationErrorSimple { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Components.Responses.ValidationFailedSimple.Body - /// Creates a new `ValidationFailedSimple`. + /// - Remark: Generated from `#/components/schemas/sub-issues-summary`. + public struct SubIssuesSummary: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/sub-issues-summary/total`. + public var total: Swift.Int + /// - Remark: Generated from `#/components/schemas/sub-issues-summary/completed`. + public var completed: Swift.Int + /// - Remark: Generated from `#/components/schemas/sub-issues-summary/percent_completed`. + public var percentCompleted: Swift.Int + /// Creates a new `SubIssuesSummary`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.ValidationFailedSimple.Body) { - self.body = body + /// - total: + /// - completed: + /// - percentCompleted: + public init( + total: Swift.Int, + completed: Swift.Int, + percentCompleted: Swift.Int + ) { + self.total = total + self.completed = completed + self.percentCompleted = percentCompleted } - } - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/not_found/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } - } + public enum CodingKeys: String, CodingKey { + case total + case completed + case percentCompleted = "percent_completed" } - /// Received HTTP response body - public var body: Components.Responses.NotFound.Body - /// Creates a new `NotFound`. + } + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary`. + public struct IssueDependenciesSummary: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocked_by`. + public var blockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocking`. + public var blocking: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocked_by`. + public var totalBlockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocking`. + public var totalBlocking: Swift.Int + /// Creates a new `IssueDependenciesSummary`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.NotFound.Body) { - self.body = body + /// - blockedBy: + /// - blocking: + /// - totalBlockedBy: + /// - totalBlocking: + public init( + blockedBy: Swift.Int, + blocking: Swift.Int, + totalBlockedBy: Swift.Int, + totalBlocking: Swift.Int + ) { + self.blockedBy = blockedBy + self.blocking = blocking + self.totalBlockedBy = totalBlockedBy + self.totalBlocking = totalBlocking + } + public enum CodingKeys: String, CodingKey { + case blockedBy = "blocked_by" + case blocking + case totalBlockedBy = "total_blocked_by" + case totalBlocking = "total_blocking" } } - public struct ValidationFailed: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed/content/application\/json`. - case json(Components.Schemas.ValidationError) - /// The associated value of the enum case if `self` is `.json`. + /// A value assigned to an issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value`. + public struct IssueFieldValue: Codable, Hashable, Sendable { + /// Unique identifier for the issue field. + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/issue_field_id`. + public var issueFieldId: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/issue-field-value/node_id`. + public var nodeId: Swift.String + /// The data type of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case text = "text" + case singleSelect = "single_select" + case number = "number" + case date = "date" + } + /// The data type of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/data_type`. + public var dataType: Components.Schemas.IssueFieldValue.DataTypePayload + /// The value of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/value`. + public struct ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value1`. + public var value1: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value2`. + public var value2: Swift.Double? + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value3`. + public var value3: Swift.Int? + /// Creates a new `ValuePayload`. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ValidationError { - get throws { - switch self { - case let .json(body): - return body - } - } + /// - Parameters: + /// - value1: + /// - value2: + /// - value3: + public init( + value1: Swift.String? = nil, + value2: Swift.Double? = nil, + value3: Swift.Int? = nil + ) { + self.value1 = value1 + self.value2 = value2 + self.value3 = value3 + } + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self.value1 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + do { + self.value2 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + do { + self.value3 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2, + self.value3 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeFirstNonNilValueToSingleValueContainer([ + self.value1, + self.value2, + self.value3 + ]) + } + } + /// The value of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/value`. + public var value: Components.Schemas.IssueFieldValue.ValuePayload? + /// Details about the selected option (only present for single_select fields) + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option`. + public struct SingleSelectOptionPayload: Codable, Hashable, Sendable { + /// Unique identifier for the option. + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option/id`. + public var id: Swift.Int64 + /// The name of the option + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option/name`. + public var name: Swift.String + /// The color of the option + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option/color`. + public var color: Swift.String + /// Creates a new `SingleSelectOptionPayload`. + /// + /// - Parameters: + /// - id: Unique identifier for the option. + /// - name: The name of the option + /// - color: The color of the option + public init( + id: Swift.Int64, + name: Swift.String, + color: Swift.String + ) { + self.id = id + self.name = name + self.color = color + } + public enum CodingKeys: String, CodingKey { + case id + case name + case color } } - /// Received HTTP response body - public var body: Components.Responses.ValidationFailed.Body - /// Creates a new `ValidationFailed`. + /// Details about the selected option (only present for single_select fields) + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option`. + public var singleSelectOption: Components.Schemas.IssueFieldValue.SingleSelectOptionPayload? + /// Creates a new `IssueFieldValue`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.ValidationFailed.Body) { - self.body = body + /// - issueFieldId: Unique identifier for the issue field. + /// - nodeId: + /// - dataType: The data type of the issue field + /// - value: The value of the issue field + /// - singleSelectOption: Details about the selected option (only present for single_select fields) + public init( + issueFieldId: Swift.Int64, + nodeId: Swift.String, + dataType: Components.Schemas.IssueFieldValue.DataTypePayload, + value: Components.Schemas.IssueFieldValue.ValuePayload? = nil, + singleSelectOption: Components.Schemas.IssueFieldValue.SingleSelectOptionPayload? = nil + ) { + self.issueFieldId = issueFieldId + self.nodeId = nodeId + self.dataType = dataType + self.value = value + self.singleSelectOption = singleSelectOption + } + public enum CodingKeys: String, CodingKey { + case issueFieldId = "issue_field_id" + case nodeId = "node_id" + case dataType = "data_type" + case value + case singleSelectOption = "single_select_option" } } - public struct NotModified: Sendable, Hashable { - /// Creates a new `NotModified`. - public init() {} - } - public struct RequiresAuthentication: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/requires_authentication/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } - } + /// Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. + /// + /// - Remark: Generated from `#/components/schemas/issue`. + public struct Issue: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/issue/node_id`. + public var nodeId: Swift.String + /// URL for the issue + /// + /// - Remark: Generated from `#/components/schemas/issue/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/issue/repository_url`. + public var repositoryUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/issue/labels_url`. + public var labelsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/issue/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/issue/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/issue/html_url`. + public var htmlUrl: Swift.String + /// Number uniquely identifying the issue within its repository + /// + /// - Remark: Generated from `#/components/schemas/issue/number`. + public var number: Swift.Int + /// State of the issue; either 'open' or 'closed' + /// + /// - Remark: Generated from `#/components/schemas/issue/state`. + public var state: Swift.String + /// The reason for the current state + /// + /// - Remark: Generated from `#/components/schemas/issue/state_reason`. + @frozen public enum StateReasonPayload: String, Codable, Hashable, Sendable, CaseIterable { + case completed = "completed" + case reopened = "reopened" + case notPlanned = "not_planned" + case duplicate = "duplicate" } - /// Received HTTP response body - public var body: Components.Responses.RequiresAuthentication.Body - /// Creates a new `RequiresAuthentication`. + /// The reason for the current state /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.RequiresAuthentication.Body) { - self.body = body - } - } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } + /// - Remark: Generated from `#/components/schemas/issue/state_reason`. + public var stateReason: Components.Schemas.Issue.StateReasonPayload? + /// Title of the issue + /// + /// - Remark: Generated from `#/components/schemas/issue/title`. + public var title: Swift.String + /// Contents of the issue + /// + /// - Remark: Generated from `#/components/schemas/issue/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload`. + @frozen public enum LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2/id`. + public var id: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2/node_id`. + public var nodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2/color`. + public var color: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2/default`. + public var _default: Swift.Bool? + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - id: + /// - nodeId: + /// - url: + /// - name: + /// - description: + /// - color: + /// - _default: + public init( + id: Swift.Int64? = nil, + nodeId: Swift.String? = nil, + url: Swift.String? = nil, + name: Swift.String? = nil, + description: Swift.String? = nil, + color: Swift.String? = nil, + _default: Swift.Bool? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.name = name + self.description = description + self.color = color + self._default = _default } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case name + case description + case color + case _default = "default" + } + } + /// - Remark: Generated from `#/components/schemas/issue/LabelsPayload/case2`. + case case2(Components.Schemas.Issue.LabelsPayloadPayload.Case2Payload) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository + /// + /// - Remark: Generated from `#/components/schemas/issue/labels`. + public typealias LabelsPayload = [Components.Schemas.Issue.LabelsPayloadPayload] + /// Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository + /// + /// - Remark: Generated from `#/components/schemas/issue/labels`. + public var labels: Components.Schemas.Issue.LabelsPayload + /// - Remark: Generated from `#/components/schemas/issue/assignee`. + public var assignee: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/issue/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/issue/milestone`. + public var milestone: Components.Schemas.NullableMilestone? + /// - Remark: Generated from `#/components/schemas/issue/locked`. + public var locked: Swift.Bool + /// - Remark: Generated from `#/components/schemas/issue/active_lock_reason`. + public var activeLockReason: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/comments`. + public var comments: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue/pull_request`. + public struct PullRequestPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue/pull_request/merged_at`. + public var mergedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/issue/pull_request/diff_url`. + public var diffUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/pull_request/html_url`. + public var htmlUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/pull_request/patch_url`. + public var patchUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/pull_request/url`. + public var url: Swift.String? + /// Creates a new `PullRequestPayload`. + /// + /// - Parameters: + /// - mergedAt: + /// - diffUrl: + /// - htmlUrl: + /// - patchUrl: + /// - url: + public init( + mergedAt: Foundation.Date? = nil, + diffUrl: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + patchUrl: Swift.String? = nil, + url: Swift.String? = nil + ) { + self.mergedAt = mergedAt + self.diffUrl = diffUrl + self.htmlUrl = htmlUrl + self.patchUrl = patchUrl + self.url = url } - } - /// Received HTTP response body - public var body: Components.Responses.Forbidden.Body - /// Creates a new `Forbidden`. + public enum CodingKeys: String, CodingKey { + case mergedAt = "merged_at" + case diffUrl = "diff_url" + case htmlUrl = "html_url" + case patchUrl = "patch_url" + case url + } + } + /// - Remark: Generated from `#/components/schemas/issue/pull_request`. + public var pullRequest: Components.Schemas.Issue.PullRequestPayload? + /// - Remark: Generated from `#/components/schemas/issue/closed_at`. + public var closedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/issue/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/issue/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/issue/draft`. + public var draft: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/issue/closed_by`. + public var closedBy: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/issue/body_html`. + public var bodyHtml: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/body_text`. + public var bodyText: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/timeline_url`. + public var timelineUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/type`. + public var _type: Components.Schemas.IssueType? + /// - Remark: Generated from `#/components/schemas/issue/repository`. + public var repository: Components.Schemas.Repository? + /// - Remark: Generated from `#/components/schemas/issue/performed_via_github_app`. + public var performedViaGithubApp: Components.Schemas.NullableIntegration? + /// - Remark: Generated from `#/components/schemas/issue/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation? + /// - Remark: Generated from `#/components/schemas/issue/reactions`. + public var reactions: Components.Schemas.ReactionRollup? + /// - Remark: Generated from `#/components/schemas/issue/sub_issues_summary`. + public var subIssuesSummary: Components.Schemas.SubIssuesSummary? + /// URL to get the parent issue of this issue, if it is a sub-issue + /// + /// - Remark: Generated from `#/components/schemas/issue/parent_issue_url`. + public var parentIssueUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue/issue_dependencies_summary`. + public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? + /// - Remark: Generated from `#/components/schemas/issue/issue_field_values`. + public var issueFieldValues: [Components.Schemas.IssueFieldValue]? + /// Creates a new `Issue`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.Forbidden.Body) { + /// - id: + /// - nodeId: + /// - url: URL for the issue + /// - repositoryUrl: + /// - labelsUrl: + /// - commentsUrl: + /// - eventsUrl: + /// - htmlUrl: + /// - number: Number uniquely identifying the issue within its repository + /// - state: State of the issue; either 'open' or 'closed' + /// - stateReason: The reason for the current state + /// - title: Title of the issue + /// - body: Contents of the issue + /// - user: + /// - labels: Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository + /// - assignee: + /// - assignees: + /// - milestone: + /// - locked: + /// - activeLockReason: + /// - comments: + /// - pullRequest: + /// - closedAt: + /// - createdAt: + /// - updatedAt: + /// - draft: + /// - closedBy: + /// - bodyHtml: + /// - bodyText: + /// - timelineUrl: + /// - _type: + /// - repository: + /// - performedViaGithubApp: + /// - authorAssociation: + /// - reactions: + /// - subIssuesSummary: + /// - parentIssueUrl: URL to get the parent issue of this issue, if it is a sub-issue + /// - issueDependenciesSummary: + /// - issueFieldValues: + public init( + id: Swift.Int64, + nodeId: Swift.String, + url: Swift.String, + repositoryUrl: Swift.String, + labelsUrl: Swift.String, + commentsUrl: Swift.String, + eventsUrl: Swift.String, + htmlUrl: Swift.String, + number: Swift.Int, + state: Swift.String, + stateReason: Components.Schemas.Issue.StateReasonPayload? = nil, + title: Swift.String, + body: Swift.String? = nil, + user: Components.Schemas.NullableSimpleUser? = nil, + labels: Components.Schemas.Issue.LabelsPayload, + assignee: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil, + milestone: Components.Schemas.NullableMilestone? = nil, + locked: Swift.Bool, + activeLockReason: Swift.String? = nil, + comments: Swift.Int, + pullRequest: Components.Schemas.Issue.PullRequestPayload? = nil, + closedAt: Foundation.Date? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + draft: Swift.Bool? = nil, + closedBy: Components.Schemas.NullableSimpleUser? = nil, + bodyHtml: Swift.String? = nil, + bodyText: Swift.String? = nil, + timelineUrl: Swift.String? = nil, + _type: Components.Schemas.IssueType? = nil, + repository: Components.Schemas.Repository? = nil, + performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, + authorAssociation: Components.Schemas.AuthorAssociation? = nil, + reactions: Components.Schemas.ReactionRollup? = nil, + subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, + parentIssueUrl: Swift.String? = nil, + issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil, + issueFieldValues: [Components.Schemas.IssueFieldValue]? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.repositoryUrl = repositoryUrl + self.labelsUrl = labelsUrl + self.commentsUrl = commentsUrl + self.eventsUrl = eventsUrl + self.htmlUrl = htmlUrl + self.number = number + self.state = state + self.stateReason = stateReason + self.title = title self.body = body + self.user = user + self.labels = labels + self.assignee = assignee + self.assignees = assignees + self.milestone = milestone + self.locked = locked + self.activeLockReason = activeLockReason + self.comments = comments + self.pullRequest = pullRequest + self.closedAt = closedAt + self.createdAt = createdAt + self.updatedAt = updatedAt + self.draft = draft + self.closedBy = closedBy + self.bodyHtml = bodyHtml + self.bodyText = bodyText + self.timelineUrl = timelineUrl + self._type = _type + self.repository = repository + self.performedViaGithubApp = performedViaGithubApp + self.authorAssociation = authorAssociation + self.reactions = reactions + self.subIssuesSummary = subIssuesSummary + self.parentIssueUrl = parentIssueUrl + self.issueDependenciesSummary = issueDependenciesSummary + self.issueFieldValues = issueFieldValues + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case repositoryUrl = "repository_url" + case labelsUrl = "labels_url" + case commentsUrl = "comments_url" + case eventsUrl = "events_url" + case htmlUrl = "html_url" + case number + case state + case stateReason = "state_reason" + case title + case body + case user + case labels + case assignee + case assignees + case milestone + case locked + case activeLockReason = "active_lock_reason" + case comments + case pullRequest = "pull_request" + case closedAt = "closed_at" + case createdAt = "created_at" + case updatedAt = "updated_at" + case draft + case closedBy = "closed_by" + case bodyHtml = "body_html" + case bodyText = "body_text" + case timelineUrl = "timeline_url" + case _type = "type" + case repository + case performedViaGithubApp = "performed_via_github_app" + case authorAssociation = "author_association" + case reactions + case subIssuesSummary = "sub_issues_summary" + case parentIssueUrl = "parent_issue_url" + case issueDependenciesSummary = "issue_dependencies_summary" + case issueFieldValues = "issue_field_values" } } - public struct Gone: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/gone/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/gone/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } - } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct NullableTeamSimple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var nodeId: Swift.String + /// URL for the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var membersUrl: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notificationSetting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositoriesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" } - /// Received HTTP response body - public var body: Components.Responses.Gone.Body - /// Creates a new `Gone`. + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? + /// Creates a new `NullableTeamSimple`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.Gone.Body) { - self.body = body + /// - id: Unique identifier of the team + /// - nodeId: + /// - url: URL for the team + /// - membersUrl: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notificationSetting: The notification setting the team has set + /// - htmlUrl: + /// - repositoriesUrl: + /// - slug: + /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs + public init( + id: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + membersUrl: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notificationSetting: Swift.String? = nil, + htmlUrl: Swift.String, + repositoriesUrl: Swift.String, + slug: Swift.String, + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.membersUrl = membersUrl + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notificationSetting = notificationSetting + self.htmlUrl = htmlUrl + self.repositoriesUrl = repositoriesUrl + self.slug = slug + self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } - } - } - /// Types generated from the `#/components/headers` section of the OpenAPI document. - public enum Headers { - /// - Remark: Generated from `#/components/headers/link`. - public typealias Link = Swift.String - } -} - -/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations { - /// List organization projects - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /orgs/{org}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)`. - public enum ProjectsListForOrg { - public static let id: Swift.String = "projects/list-for-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/path/org`. - public var org: Components.Parameters.Org - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case membersUrl = "members_url" + case name + case description + case permission + case privacy + case notificationSetting = "notification_setting" + case htmlUrl = "html_url" + case repositoriesUrl = "repositories_url" + case slug + case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } - public var path: Operations.ProjectsListForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case closed = "closed" - case all = "all" - } - /// Indicates the state of the projects to return. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query/state`. - public var state: Operations.ProjectsListForOrg.Input.Query.StatePayload? - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/team`. + public struct Team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notificationSetting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `PermissionsPayload`. /// /// - Parameters: - /// - state: Indicates the state of the projects to return. - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: public init( - state: Operations.ProjectsListForOrg.Input.Query.StatePayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool ) { - self.state = state - self.perPage = perPage - self.page = page + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin } - } - public var query: Operations.ProjectsListForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + public enum CodingKeys: String, CodingKey { + case pull + case triage + case push + case maintain + case admin } } - public var headers: Operations.ProjectsListForOrg.Input.Headers - /// Creates a new `Input`. + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.Team.PermissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var membersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.NullableTeamSimple? + /// Creates a new `Team`. /// /// - Parameters: - /// - path: - /// - query: - /// - headers: + /// - id: + /// - nodeId: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notificationSetting: + /// - permission: + /// - permissions: + /// - url: + /// - htmlUrl: + /// - membersUrl: + /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs + /// - parent: public init( - path: Operations.ProjectsListForOrg.Input.Path, - query: Operations.ProjectsListForOrg.Input.Query = .init(), - headers: Operations.ProjectsListForOrg.Input.Headers = .init() + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notificationSetting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.Team.PermissionsPayload? = nil, + url: Swift.String, + htmlUrl: Swift.String, + membersUrl: Swift.String, + repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, + parent: Components.Schemas.NullableTeamSimple? = nil ) { - self.path = path - self.query = query - self.headers = headers + self.id = id + self.nodeId = nodeId + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notificationSetting = notificationSetting + self.permission = permission + self.permissions = permissions + self.url = url + self.htmlUrl = htmlUrl + self.membersUrl = membersUrl + self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId + self.parent = parent + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case name + case slug + case description + case privacy + case notificationSetting = "notification_setting" + case permission + case permissions + case url + case htmlUrl = "html_url" + case membersUrl = "members_url" + case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" + case parent } } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ProjectsListForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Project]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Project] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsListForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListForOrg.Output.Ok.Headers = .init(), - body: Operations.ProjectsListForOrg.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListForOrg.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsListForOrg.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projects/get(projects/list-for-org)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Create an organization project - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `POST /orgs/{org}/projects`. - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)`. - public enum ProjectsCreateForOrg { - public static let id: Swift.String = "projects/create-for-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/path/org`. - public var org: Components.Parameters.Org - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org - } - } - public var path: Operations.ProjectsCreateForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ProjectsCreateForOrg.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The name of the project. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/json/name`. - public var name: Swift.String - /// The description of the project. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/json/body`. - public var body: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: The name of the project. - /// - body: The description of the project. - public init( - name: Swift.String, - body: Swift.String? = nil - ) { - self.name = name - self.body = body - } - public enum CodingKeys: String, CodingKey { - case name - case body - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsCreateForOrg.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsCreateForOrg.Input.Body - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ProjectsCreateForOrg.Input.Path, - headers: Operations.ProjectsCreateForOrg.Input.Headers = .init(), - body: Operations.ProjectsCreateForOrg.Input.Body - ) { - self.path = path - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/projects/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Project) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.Project { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsCreateForOrg.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsCreateForOrg.Output.Created.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsCreateForOrg.Output.Created) - /// The associated value of the enum case if `self` is `.created`. - /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ProjectsCreateForOrg.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. - /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Gone - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)/responses/410`. - /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. - /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { - get throws { - switch self { - case let .gone(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "gone", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/projects/post(projects/create-for-org)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Get a project card - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /projects/columns/cards/{card_id}`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)`. - public enum ProjectsGetCard { - public static let id: Swift.String = "projects/get-card" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the card. - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/path/card_id`. - public var cardId: Components.Parameters.CardId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - cardId: The unique identifier of the card. - public init(cardId: Components.Parameters.CardId) { - self.cardId = cardId - } - } - public var path: Operations.ProjectsGetCard.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ProjectsGetCard.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ProjectsGetCard.Input.Path, - headers: Operations.ProjectsGetCard.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectCard) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ProjectCard { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsGetCard.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsGetCard.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetCard.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsGetCard.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// The associated value of the enum case if `self` is `.notModified`. - /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. - /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/get(projects/get-card)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Update an existing project card - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `PATCH /projects/columns/cards/{card_id}`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)`. - public enum ProjectsUpdateCard { - public static let id: Swift.String = "projects/update-card" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the card. - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/path/card_id`. - public var cardId: Components.Parameters.CardId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - cardId: The unique identifier of the card. - public init(cardId: Components.Parameters.CardId) { - self.cardId = cardId - } - } - public var path: Operations.ProjectsUpdateCard.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ProjectsUpdateCard.Input.Headers - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The project card's note - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody/json/note`. - public var note: Swift.String? - /// Whether or not the card is archived - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody/json/archived`. - public var archived: Swift.Bool? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - note: The project card's note - /// - archived: Whether or not the card is archived - public init( - note: Swift.String? = nil, - archived: Swift.Bool? = nil - ) { - self.note = note - self.archived = archived - } - public enum CodingKeys: String, CodingKey { - case note - case archived - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.ProjectsUpdateCard.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsUpdateCard.Input.Body? - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.ProjectsUpdateCard.Input.Path, - headers: Operations.ProjectsUpdateCard.Input.Headers = .init(), - body: Operations.ProjectsUpdateCard.Input.Body? = nil - ) { - self.path = path - self.headers = headers - self.body = body - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectCard) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ProjectCard { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsUpdateCard.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsUpdateCard.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsUpdateCard.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsUpdateCard.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// The associated value of the enum case if `self` is `.notModified`. - /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. - /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/patch(projects/update-card)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete a project card - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `DELETE /projects/columns/cards/{card_id}`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)`. - public enum ProjectsDeleteCard { - public static let id: Swift.String = "projects/delete-card" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the card. - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/path/card_id`. - public var cardId: Components.Parameters.CardId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - cardId: The unique identifier of the card. - public init(cardId: Components.Parameters.CardId) { - self.cardId = cardId - } - } - public var path: Operations.ProjectsDeleteCard.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ProjectsDeleteCard.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ProjectsDeleteCard.Input.Path, - headers: Operations.ProjectsDeleteCard.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ProjectsDeleteCard.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ProjectsDeleteCard.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// The associated value of the enum case if `self` is `.notModified`. - /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content/json/errors`. - public var errors: [Swift.String]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - message: - /// - documentationUrl: - /// - errors: - public init( - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil, - errors: [Swift.String]? = nil - ) { - self.message = message - self.documentationUrl = documentationUrl - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - case errors - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/DELETE/responses/403/content/application\/json`. - case json(Operations.ProjectsDeleteCard.Output.Forbidden.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.ProjectsDeleteCard.Output.Forbidden.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsDeleteCard.Output.Forbidden.Body - /// Creates a new `Forbidden`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsDeleteCard.Output.Forbidden.Body) { - self.body = body - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.ProjectsDeleteCard.Output.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Operations.ProjectsDeleteCard.Output.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)/responses/401`. + /// An status update belonging to a project + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update`. + public struct NullableProjectsV2StatusUpdate: Codable, Hashable, Sendable { + /// The unique identifier of the status update. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/id`. + public var id: Swift.Double + /// The node ID of the status update. /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - /// Resource not found + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/node_id`. + public var nodeId: Swift.String + /// The node ID of the project that this status update belongs to. /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/delete(projects/delete-card)/responses/404`. + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/project_node_id`. + public var projectNodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/creator`. + public var creator: Components.Schemas.SimpleUser? + /// The time when the status update was created. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/created_at`. + public var createdAt: Foundation.Date + /// The time when the status update was last updated. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Undocumented response. + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/updated_at`. + public var updatedAt: Foundation.Date + /// The current status. /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Move a project card - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `POST /projects/columns/cards/{card_id}/moves`. - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)`. - public enum ProjectsMoveCard { - public static let id: Swift.String = "projects/move-card" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the card. - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/path/card_id`. - public var cardId: Components.Parameters.CardId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - cardId: The unique identifier of the card. - public init(cardId: Components.Parameters.CardId) { - self.cardId = cardId - } - } - public var path: Operations.ProjectsMoveCard.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.ProjectsMoveCard.Input.Headers - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The position of the card in a column. Can be one of: `top`, `bottom`, or `after:` to place after the specified card. - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/requestBody/json/position`. - public var position: Swift.String - /// The unique identifier of the column the card should be moved to - /// - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/requestBody/json/column_id`. - public var columnId: Swift.Int? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - position: The position of the card in a column. Can be one of: `top`, `bottom`, or `after:` to place after the specified card. - /// - columnId: The unique identifier of the column the card should be moved to - public init( - position: Swift.String, - columnId: Swift.Int? = nil - ) { - self.position = position - self.columnId = columnId - } - public enum CodingKeys: String, CodingKey { - case position - case columnId = "column_id" - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsMoveCard.Input.Body.JsonPayload) + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case inactive = "INACTIVE" + case onTrack = "ON_TRACK" + case atRisk = "AT_RISK" + case offTrack = "OFF_TRACK" + case complete = "COMPLETE" } - public var body: Operations.ProjectsMoveCard.Input.Body - /// Creates a new `Input`. + /// The current status. + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/status`. + public var status: Components.Schemas.NullableProjectsV2StatusUpdate.StatusPayload? + /// The start date of the period covered by the update. + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/start_date`. + public var startDate: Swift.String? + /// The target date associated with the update. + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/target_date`. + public var targetDate: Swift.String? + /// Body of the status update + /// + /// - Remark: Generated from `#/components/schemas/nullable-projects-v2-status-update/body`. + public var body: Swift.String? + /// Creates a new `NullableProjectsV2StatusUpdate`. /// /// - Parameters: - /// - path: - /// - headers: - /// - body: + /// - id: The unique identifier of the status update. + /// - nodeId: The node ID of the status update. + /// - projectNodeId: The node ID of the project that this status update belongs to. + /// - creator: + /// - createdAt: The time when the status update was created. + /// - updatedAt: The time when the status update was last updated. + /// - status: The current status. + /// - startDate: The start date of the period covered by the update. + /// - targetDate: The target date associated with the update. + /// - body: Body of the status update public init( - path: Operations.ProjectsMoveCard.Input.Path, - headers: Operations.ProjectsMoveCard.Input.Headers = .init(), - body: Operations.ProjectsMoveCard.Input.Body + id: Swift.Double, + nodeId: Swift.String, + projectNodeId: Swift.String? = nil, + creator: Components.Schemas.SimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + status: Components.Schemas.NullableProjectsV2StatusUpdate.StatusPayload? = nil, + startDate: Swift.String? = nil, + targetDate: Swift.String? = nil, + body: Swift.String? = nil ) { - self.path = path - self.headers = headers + self.id = id + self.nodeId = nodeId + self.projectNodeId = projectNodeId + self.creator = creator + self.createdAt = createdAt + self.updatedAt = updatedAt + self.status = status + self.startDate = startDate + self.targetDate = targetDate self.body = body } - } - @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/201/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Creates a new `JsonPayload`. - public init() {} - public init(from decoder: any Decoder) throws { - try decoder.ensureNoAdditionalProperties(knownKeys: []) - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/201/content/application\/json`. - case json(Operations.ProjectsMoveCard.Output.Created.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.ProjectsMoveCard.Output.Created.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsMoveCard.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsMoveCard.Output.Created.Body) { - self.body = body - } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case projectNodeId = "project_node_id" + case creator + case createdAt = "created_at" + case updatedAt = "updated_at" + case status + case startDate = "start_date" + case targetDate = "target_date" + case body } - /// Response + } + /// A projects v2 project + /// + /// - Remark: Generated from `#/components/schemas/projects-v2`. + public struct ProjectsV2: Codable, Hashable, Sendable { + /// The unique identifier of the project. /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)/responses/201`. + /// - Remark: Generated from `#/components/schemas/projects-v2/id`. + public var id: Swift.Double + /// The node ID of the project. /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsMoveCard.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// - Remark: Generated from `#/components/schemas/projects-v2/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/projects-v2/owner`. + public var owner: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/projects-v2/creator`. + public var creator: Components.Schemas.SimpleUser + /// The project title. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ProjectsMoveCard.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Not modified + /// - Remark: Generated from `#/components/schemas/projects-v2/title`. + public var title: Swift.String + /// A short description of the project. /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)/responses/304`. + /// - Remark: Generated from `#/components/schemas/projects-v2/description`. + public var description: Swift.String? + /// Whether the project is visible to anyone with access to the owner. /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified + /// - Remark: Generated from `#/components/schemas/projects-v2/public`. + public var _public: Swift.Bool + /// The time when the project was closed. /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)/responses/304`. + /// - Remark: Generated from `#/components/schemas/projects-v2/closed_at`. + public var closedAt: Foundation.Date? + /// The time when the project was created. /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) + /// - Remark: Generated from `#/components/schemas/projects-v2/created_at`. + public var createdAt: Foundation.Date + /// The time when the project was last updated. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/updated_at`. + public var updatedAt: Foundation.Date + /// The project number. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/number`. + public var number: Swift.Int + /// A concise summary of the project. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/short_description`. + public var shortDescription: Swift.String? + /// The time when the project was deleted. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/deleted_at`. + public var deletedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/projects-v2/deleted_by`. + public var deletedBy: Components.Schemas.NullableSimpleUser? + /// The current state of the project. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" } - /// The associated value of the enum case if `self` is `.notModified`. + /// The current state of the project. /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } + /// - Remark: Generated from `#/components/schemas/projects-v2/state`. + public var state: Components.Schemas.ProjectsV2.StatePayload? + /// - Remark: Generated from `#/components/schemas/projects-v2/latest_status_update`. + public var latestStatusUpdate: Components.Schemas.NullableProjectsV2StatusUpdate? + /// Whether this project is a template + /// + /// - Remark: Generated from `#/components/schemas/projects-v2/is_template`. + public var isTemplate: Swift.Bool? + /// Creates a new `ProjectsV2`. + /// + /// - Parameters: + /// - id: The unique identifier of the project. + /// - nodeId: The node ID of the project. + /// - owner: + /// - creator: + /// - title: The project title. + /// - description: A short description of the project. + /// - _public: Whether the project is visible to anyone with access to the owner. + /// - closedAt: The time when the project was closed. + /// - createdAt: The time when the project was created. + /// - updatedAt: The time when the project was last updated. + /// - number: The project number. + /// - shortDescription: A concise summary of the project. + /// - deletedAt: The time when the project was deleted. + /// - deletedBy: + /// - state: The current state of the project. + /// - latestStatusUpdate: + /// - isTemplate: Whether this project is a template + public init( + id: Swift.Double, + nodeId: Swift.String, + owner: Components.Schemas.SimpleUser, + creator: Components.Schemas.SimpleUser, + title: Swift.String, + description: Swift.String? = nil, + _public: Swift.Bool, + closedAt: Foundation.Date? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + number: Swift.Int, + shortDescription: Swift.String? = nil, + deletedAt: Foundation.Date? = nil, + deletedBy: Components.Schemas.NullableSimpleUser? = nil, + state: Components.Schemas.ProjectsV2.StatePayload? = nil, + latestStatusUpdate: Components.Schemas.NullableProjectsV2StatusUpdate? = nil, + isTemplate: Swift.Bool? = nil + ) { + self.id = id + self.nodeId = nodeId + self.owner = owner + self.creator = creator + self.title = title + self.description = description + self._public = _public + self.closedAt = closedAt + self.createdAt = createdAt + self.updatedAt = updatedAt + self.number = number + self.shortDescription = shortDescription + self.deletedAt = deletedAt + self.deletedBy = deletedBy + self.state = state + self.latestStatusUpdate = latestStatusUpdate + self.isTemplate = isTemplate } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/ErrorsPayload`. - public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/ErrorsPayload/code`. - public var code: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/ErrorsPayload/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/ErrorsPayload/resource`. - public var resource: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/ErrorsPayload/field`. - public var field: Swift.String? - /// Creates a new `ErrorsPayloadPayload`. - /// - /// - Parameters: - /// - code: - /// - message: - /// - resource: - /// - field: - public init( - code: Swift.String? = nil, - message: Swift.String? = nil, - resource: Swift.String? = nil, - field: Swift.String? = nil - ) { - self.code = code - self.message = message - self.resource = resource - self.field = field - } - public enum CodingKeys: String, CodingKey { - case code - case message - case resource - case field - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/errors`. - public typealias ErrorsPayload = [Operations.ProjectsMoveCard.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload] - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/json/errors`. - public var errors: Operations.ProjectsMoveCard.Output.Forbidden.Body.JsonPayload.ErrorsPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - message: - /// - documentationUrl: - /// - errors: - public init( - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil, - errors: Operations.ProjectsMoveCard.Output.Forbidden.Body.JsonPayload.ErrorsPayload? = nil - ) { - self.message = message - self.documentationUrl = documentationUrl - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - case errors - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/403/content/application\/json`. - case json(Operations.ProjectsMoveCard.Output.Forbidden.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.ProjectsMoveCard.Output.Forbidden.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case owner + case creator + case title + case description + case _public = "public" + case closedAt = "closed_at" + case createdAt = "created_at" + case updatedAt = "updated_at" + case number + case shortDescription = "short_description" + case deletedAt = "deleted_at" + case deletedBy = "deleted_by" + case state + case latestStatusUpdate = "latest_status_update" + case isTemplate = "is_template" + } + } + /// An option for a single select field + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options`. + public struct ProjectsV2SingleSelectOptions: Codable, Hashable, Sendable { + /// The unique identifier of the option. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/id`. + public var id: Swift.String + /// The display name of the option, in raw text and HTML formats. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name`. + public struct NamePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name/raw`. + public var raw: Swift.String + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name/html`. + public var html: Swift.String + /// Creates a new `NamePayload`. + /// + /// - Parameters: + /// - raw: + /// - html: + public init( + raw: Swift.String, + html: Swift.String + ) { + self.raw = raw + self.html = html } - /// Received HTTP response body - public var body: Operations.ProjectsMoveCard.Output.Forbidden.Body - /// Creates a new `Forbidden`. + public enum CodingKeys: String, CodingKey { + case raw + case html + } + } + /// The display name of the option, in raw text and HTML formats. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/name`. + public var name: Components.Schemas.ProjectsV2SingleSelectOptions.NamePayload + /// The description of the option, in raw text and HTML formats. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description`. + public struct DescriptionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description/raw`. + public var raw: Swift.String + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description/html`. + public var html: Swift.String + /// Creates a new `DescriptionPayload`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsMoveCard.Output.Forbidden.Body) { - self.body = body + /// - raw: + /// - html: + public init( + raw: Swift.String, + html: Swift.String + ) { + self.raw = raw + self.html = html + } + public enum CodingKeys: String, CodingKey { + case raw + case html } } - /// Forbidden + /// The description of the option, in raw text and HTML formats. /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)/responses/403`. + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/description`. + public var description: Components.Schemas.ProjectsV2SingleSelectOptions.DescriptionPayload + /// The color associated with the option. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.ProjectsMoveCard.Output.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// - Remark: Generated from `#/components/schemas/projects-v2-single-select-options/color`. + public var color: Swift.String + /// Creates a new `ProjectsV2SingleSelectOptions`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Operations.ProjectsMoveCard.Output.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } + /// - Parameters: + /// - id: The unique identifier of the option. + /// - name: The display name of the option, in raw text and HTML formats. + /// - description: The description of the option, in raw text and HTML formats. + /// - color: The color associated with the option. + public init( + id: Swift.String, + name: Components.Schemas.ProjectsV2SingleSelectOptions.NamePayload, + description: Components.Schemas.ProjectsV2SingleSelectOptions.DescriptionPayload, + color: Swift.String + ) { + self.id = id + self.name = name + self.description = description + self.color = color + } + public enum CodingKeys: String, CodingKey { + case id + case name + case description + case color + } + } + /// An iteration setting for an iteration field + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings`. + public struct ProjectsV2IterationSettings: Codable, Hashable, Sendable { + /// The unique identifier of the iteration setting. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/id`. + public var id: Swift.String + /// The start date of the iteration. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/start_date`. + public var startDate: Swift.String + /// The duration of the iteration in days. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/duration`. + public var duration: Swift.Int + /// The iteration title, in raw text and HTML formats. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title`. + public struct TitlePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title/raw`. + public var raw: Swift.String + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title/html`. + public var html: Swift.String + /// Creates a new `TitlePayload`. + /// + /// - Parameters: + /// - raw: + /// - html: + public init( + raw: Swift.String, + html: Swift.String + ) { + self.raw = raw + self.html = html + } + public enum CodingKeys: String, CodingKey { + case raw + case html } } - /// Requires authentication + /// The iteration title, in raw text and HTML formats. /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)/responses/401`. + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/title`. + public var title: Components.Schemas.ProjectsV2IterationSettings.TitlePayload + /// Whether the iteration has been completed. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// - Remark: Generated from `#/components/schemas/projects-v2-iteration-settings/completed`. + public var completed: Swift.Bool + /// Creates a new `ProjectsV2IterationSettings`. /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } + /// - Parameters: + /// - id: The unique identifier of the iteration setting. + /// - startDate: The start date of the iteration. + /// - duration: The duration of the iteration in days. + /// - title: The iteration title, in raw text and HTML formats. + /// - completed: Whether the iteration has been completed. + public init( + id: Swift.String, + startDate: Swift.String, + duration: Swift.Int, + title: Components.Schemas.ProjectsV2IterationSettings.TitlePayload, + completed: Swift.Bool + ) { + self.id = id + self.startDate = startDate + self.duration = duration + self.title = title + self.completed = completed } - public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/code`. - public var code: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/ErrorsPayload`. - public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/ErrorsPayload/code`. - public var code: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/ErrorsPayload/message`. - public var message: Swift.String? - /// Creates a new `ErrorsPayloadPayload`. - /// - /// - Parameters: - /// - code: - /// - message: - public init( - code: Swift.String? = nil, - message: Swift.String? = nil - ) { - self.code = code - self.message = message - } - public enum CodingKeys: String, CodingKey { - case code - case message - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/errors`. - public typealias ErrorsPayload = [Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayloadPayload] - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/json/errors`. - public var errors: Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - code: - /// - message: - /// - documentationUrl: - /// - errors: - public init( - code: Swift.String? = nil, - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil, - errors: Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayload? = nil - ) { - self.code = code - self.message = message - self.documentationUrl = documentationUrl - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case code - case message - case documentationUrl = "documentation_url" - case errors - } - } - /// - Remark: Generated from `#/paths/projects/columns/cards/{card_id}/moves/POST/responses/503/content/application\/json`. - case json(Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body - /// Creates a new `ServiceUnavailable`. + public enum CodingKeys: String, CodingKey { + case id + case startDate = "start_date" + case duration + case title + case completed + } + } + /// A field inside a projects v2 project + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field`. + public struct ProjectsV2Field: Codable, Hashable, Sendable { + /// The unique identifier of the field. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/id`. + public var id: Swift.Int + /// The node ID of the field. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/node_id`. + public var nodeId: Swift.String? + /// The API URL of the project that contains the field. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/project_url`. + public var projectUrl: Swift.String + /// The name of the field. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/name`. + public var name: Swift.String + /// The field's data type. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case assignees = "assignees" + case linkedPullRequests = "linked_pull_requests" + case reviewers = "reviewers" + case labels = "labels" + case milestone = "milestone" + case repository = "repository" + case title = "title" + case text = "text" + case singleSelect = "single_select" + case number = "number" + case date = "date" + case iteration = "iteration" + case issueType = "issue_type" + case parentIssue = "parent_issue" + case subIssuesProgress = "sub_issues_progress" + } + /// The field's data type. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/data_type`. + public var dataType: Components.Schemas.ProjectsV2Field.DataTypePayload + /// The options available for single select fields. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/options`. + public var options: [Components.Schemas.ProjectsV2SingleSelectOptions]? + /// Configuration for iteration fields. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration`. + public struct ConfigurationPayload: Codable, Hashable, Sendable { + /// The day of the week when the iteration starts. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration/start_day`. + public var startDay: Swift.Int? + /// The duration of the iteration in days. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration/duration`. + public var duration: Swift.Int? + /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration/iterations`. + public var iterations: [Components.Schemas.ProjectsV2IterationSettings]? + /// Creates a new `ConfigurationPayload`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsMoveCard.Output.ServiceUnavailable.Body) { - self.body = body + /// - startDay: The day of the week when the iteration starts. + /// - duration: The duration of the iteration in days. + /// - iterations: + public init( + startDay: Swift.Int? = nil, + duration: Swift.Int? = nil, + iterations: [Components.Schemas.ProjectsV2IterationSettings]? = nil + ) { + self.startDay = startDay + self.duration = duration + self.iterations = iterations + } + public enum CodingKeys: String, CodingKey { + case startDay = "start_day" + case duration + case iterations } } - /// Response + /// Configuration for iteration fields. /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)/responses/503`. + /// - Remark: Generated from `#/components/schemas/projects-v2-field/configuration`. + public var configuration: Components.Schemas.ProjectsV2Field.ConfigurationPayload? + /// The time when the field was created. /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ProjectsMoveCard.Output.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// - Remark: Generated from `#/components/schemas/projects-v2-field/created_at`. + public var createdAt: Foundation.Date + /// The time when the field was last updated. /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ProjectsMoveCard.Output.ServiceUnavailable { - get throws { - switch self { - case let .serviceUnavailable(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", - response: self - ) - } + /// - Remark: Generated from `#/components/schemas/projects-v2-field/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `ProjectsV2Field`. + /// + /// - Parameters: + /// - id: The unique identifier of the field. + /// - nodeId: The node ID of the field. + /// - projectUrl: The API URL of the project that contains the field. + /// - name: The name of the field. + /// - dataType: The field's data type. + /// - options: The options available for single select fields. + /// - configuration: Configuration for iteration fields. + /// - createdAt: The time when the field was created. + /// - updatedAt: The time when the field was last updated. + public init( + id: Swift.Int, + nodeId: Swift.String? = nil, + projectUrl: Swift.String, + name: Swift.String, + dataType: Components.Schemas.ProjectsV2Field.DataTypePayload, + options: [Components.Schemas.ProjectsV2SingleSelectOptions]? = nil, + configuration: Components.Schemas.ProjectsV2Field.ConfigurationPayload? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.id = id + self.nodeId = nodeId + self.projectUrl = projectUrl + self.name = name + self.dataType = dataType + self.options = options + self.configuration = configuration + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case projectUrl = "project_url" + case name + case dataType = "data_type" + case options + case configuration + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + /// The type of content tracked in a project item + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-content-type`. + @frozen public enum ProjectsV2ItemContentType: String, Codable, Hashable, Sendable, CaseIterable { + case issue = "Issue" + case pullRequest = "PullRequest" + case draftIssue = "DraftIssue" + } + /// An item belonging to a project + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content`. + public struct ProjectsV2ItemWithContent: Codable, Hashable, Sendable { + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/id`. + public var id: Swift.Double + /// The node ID of the project item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/node_id`. + public var nodeId: Swift.String? + /// The API URL of the project that contains this item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/project_url`. + public var projectUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/content_type`. + public var contentType: Components.Schemas.ProjectsV2ItemContentType + /// The content of the item, which varies by content type. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/content`. + public struct ContentPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `ContentPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) } } - /// Validation failed, or the endpoint has been spammed. + /// The content of the item, which varies by content type. /// - /// - Remark: Generated from `#/paths//projects/columns/cards/{card_id}/moves/post(projects/move-card)/responses/422`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/content`. + public var content: Components.Schemas.ProjectsV2ItemWithContent.ContentPayload? + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/creator`. + public var creator: Components.Schemas.SimpleUser? + /// The time when the item was created. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/created_at`. + public var createdAt: Foundation.Date + /// The time when the item was last updated. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/updated_at`. + public var updatedAt: Foundation.Date + /// The time when the item was archived. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/archived_at`. + public var archivedAt: Foundation.Date? + /// The API URL of this item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/item_url`. + public var itemUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/FieldsPayload`. + public struct FieldsPayloadPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `FieldsPayloadPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) } } - /// Undocumented response. + /// The fields and values associated with this item. /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/fields`. + public typealias FieldsPayload = [Components.Schemas.ProjectsV2ItemWithContent.FieldsPayloadPayload] + /// The fields and values associated with this item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-with-content/fields`. + public var fields: Components.Schemas.ProjectsV2ItemWithContent.FieldsPayload? + /// Creates a new `ProjectsV2ItemWithContent`. + /// + /// - Parameters: + /// - id: The unique identifier of the project item. + /// - nodeId: The node ID of the project item. + /// - projectUrl: The API URL of the project that contains this item. + /// - contentType: + /// - content: The content of the item, which varies by content type. + /// - creator: + /// - createdAt: The time when the item was created. + /// - updatedAt: The time when the item was last updated. + /// - archivedAt: The time when the item was archived. + /// - itemUrl: The API URL of this item. + /// - fields: The fields and values associated with this item. + public init( + id: Swift.Double, + nodeId: Swift.String? = nil, + projectUrl: Swift.String? = nil, + contentType: Components.Schemas.ProjectsV2ItemContentType, + content: Components.Schemas.ProjectsV2ItemWithContent.ContentPayload? = nil, + creator: Components.Schemas.SimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + archivedAt: Foundation.Date? = nil, + itemUrl: Swift.String? = nil, + fields: Components.Schemas.ProjectsV2ItemWithContent.FieldsPayload? = nil + ) { + self.id = id + self.nodeId = nodeId + self.projectUrl = projectUrl + self.contentType = contentType + self.content = content + self.creator = creator + self.createdAt = createdAt + self.updatedAt = updatedAt + self.archivedAt = archivedAt + self.itemUrl = itemUrl + self.fields = fields + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case projectUrl = "project_url" + case contentType = "content_type" + case content + case creator + case createdAt = "created_at" + case updatedAt = "updated_at" + case archivedAt = "archived_at" + case itemUrl = "item_url" + case fields + } } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } + /// Hypermedia Link + /// + /// - Remark: Generated from `#/components/schemas/link`. + public struct Link: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/link/href`. + public var href: Swift.String + /// Creates a new `Link`. + /// + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } + public enum CodingKeys: String, CodingKey { + case href } - public static var allCases: [Self] { - [ - .json - ] + } + /// The status of auto merging a pull request. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge`. + public struct AutoMerge: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/auto-merge/enabled_by`. + public var enabledBy: Components.Schemas.SimpleUser + /// The merge method to use. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + @frozen public enum MergeMethodPayload: String, Codable, Hashable, Sendable, CaseIterable { + case merge = "merge" + case squash = "squash" + case rebase = "rebase" + } + /// The merge method to use. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + public var mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload + /// Title for the merge commit message. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_title`. + public var commitTitle: Swift.String + /// Commit message for the merge commit. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_message`. + public var commitMessage: Swift.String + /// Creates a new `AutoMerge`. + /// + /// - Parameters: + /// - enabledBy: + /// - mergeMethod: The merge method to use. + /// - commitTitle: Title for the merge commit message. + /// - commitMessage: Commit message for the merge commit. + public init( + enabledBy: Components.Schemas.SimpleUser, + mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload, + commitTitle: Swift.String, + commitMessage: Swift.String + ) { + self.enabledBy = enabledBy + self.mergeMethod = mergeMethod + self.commitTitle = commitTitle + self.commitMessage = commitMessage + } + public enum CodingKeys: String, CodingKey { + case enabledBy = "enabled_by" + case mergeMethod = "merge_method" + case commitTitle = "commit_title" + case commitMessage = "commit_message" } } - } - /// Get a project column - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `GET /projects/columns/{column_id}`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)`. - public enum ProjectsGetColumn { - public static let id: Swift.String = "projects/get-column" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the column. + /// Pull Request Simple + /// + /// - Remark: Generated from `#/components/schemas/pull-request-simple`. + public struct PullRequestSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-simple/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/diff_url`. + public var diffUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/patch_url`. + public var patchUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/issue_url`. + public var issueUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/commits_url`. + public var commitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comments_url`. + public var reviewCommentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comment_url`. + public var reviewCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-simple/state`. + public var state: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/locked`. + public var locked: Swift.Bool + /// - Remark: Generated from `#/components/schemas/pull-request-simple/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload`. + public struct LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/description`. + public var description: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/color`. + public var color: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/default`. + public var _default: Swift.Bool + /// Creates a new `LabelsPayloadPayload`. /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/path/column_id`. - public var columnId: Components.Parameters.ColumnId - /// Creates a new `Path`. + /// - Parameters: + /// - id: + /// - nodeId: + /// - url: + /// - name: + /// - description: + /// - color: + /// - _default: + public init( + id: Swift.Int64, + nodeId: Swift.String, + url: Swift.String, + name: Swift.String, + description: Swift.String, + color: Swift.String, + _default: Swift.Bool + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.name = name + self.description = description + self.color = color + self._default = _default + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case name + case description + case color + case _default = "default" + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public typealias LabelsPayload = [Components.Schemas.PullRequestSimple.LabelsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public var labels: Components.Schemas.PullRequestSimple.LabelsPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/milestone`. + public var milestone: Components.Schemas.NullableMilestone? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/active_lock_reason`. + public var activeLockReason: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/closed_at`. + public var closedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merged_at`. + public var mergedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merge_commit_sha`. + public var mergeCommitSha: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignee`. + public var assignee: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_reviewers`. + public var requestedReviewers: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_teams`. + public var requestedTeams: [Components.Schemas.Team]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public struct HeadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `HeadPayload`. /// /// - Parameters: - /// - columnId: The unique identifier of the column. - public init(columnId: Components.Parameters.ColumnId) { - self.columnId = columnId + /// - label: + /// - ref: + /// - repo: + /// - sha: + /// - user: + public init( + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, + sha: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil + ) { + self.label = label + self.ref = ref + self.repo = repo + self.sha = sha + self.user = user } - } - public var path: Operations.ProjectsGetColumn.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. + public enum CodingKeys: String, CodingKey { + case label + case ref + case repo + case sha + case user + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public var head: Components.Schemas.PullRequestSimple.HeadPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `BasePayload`. /// /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + /// - label: + /// - ref: + /// - repo: + /// - sha: + /// - user: + public init( + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, + sha: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil + ) { + self.label = label + self.ref = ref + self.repo = repo + self.sha = sha + self.user = user + } + public enum CodingKeys: String, CodingKey { + case label + case ref + case repo + case sha + case user + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public var base: Components.Schemas.PullRequestSimple.BasePayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public struct _LinksPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/comments`. + public var comments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/commits`. + public var commits: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/statuses`. + public var statuses: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/html`. + public var html: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/issue`. + public var issue: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comments`. + public var reviewComments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comment`. + public var reviewComment: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/self`. + public var _self: Components.Schemas.Link + /// Creates a new `_LinksPayload`. + /// + /// - Parameters: + /// - comments: + /// - commits: + /// - statuses: + /// - html: + /// - issue: + /// - reviewComments: + /// - reviewComment: + /// - _self: + public init( + comments: Components.Schemas.Link, + commits: Components.Schemas.Link, + statuses: Components.Schemas.Link, + html: Components.Schemas.Link, + issue: Components.Schemas.Link, + reviewComments: Components.Schemas.Link, + reviewComment: Components.Schemas.Link, + _self: Components.Schemas.Link + ) { + self.comments = comments + self.commits = commits + self.statuses = statuses + self.html = html + self.issue = issue + self.reviewComments = reviewComments + self.reviewComment = reviewComment + self._self = _self } + public enum CodingKeys: String, CodingKey { + case comments + case commits + case statuses + case html + case issue + case reviewComments = "review_comments" + case reviewComment = "review_comment" + case _self = "self" + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public var _links: Components.Schemas.PullRequestSimple._LinksPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation + /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. + public var autoMerge: Components.Schemas.AutoMerge? + /// Indicates whether or not the pull request is a draft. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. + public var draft: Swift.Bool? + /// Creates a new `PullRequestSimple`. + /// + /// - Parameters: + /// - url: + /// - id: + /// - nodeId: + /// - htmlUrl: + /// - diffUrl: + /// - patchUrl: + /// - issueUrl: + /// - commitsUrl: + /// - reviewCommentsUrl: + /// - reviewCommentUrl: + /// - commentsUrl: + /// - statusesUrl: + /// - number: + /// - state: + /// - locked: + /// - title: + /// - user: + /// - body: + /// - labels: + /// - milestone: + /// - activeLockReason: + /// - createdAt: + /// - updatedAt: + /// - closedAt: + /// - mergedAt: + /// - mergeCommitSha: + /// - assignee: + /// - assignees: + /// - requestedReviewers: + /// - requestedTeams: + /// - head: + /// - base: + /// - _links: + /// - authorAssociation: + /// - autoMerge: + /// - draft: Indicates whether or not the pull request is a draft. + public init( + url: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + htmlUrl: Swift.String, + diffUrl: Swift.String, + patchUrl: Swift.String, + issueUrl: Swift.String, + commitsUrl: Swift.String, + reviewCommentsUrl: Swift.String, + reviewCommentUrl: Swift.String, + commentsUrl: Swift.String, + statusesUrl: Swift.String, + number: Swift.Int, + state: Swift.String, + locked: Swift.Bool, + title: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil, + body: Swift.String? = nil, + labels: Components.Schemas.PullRequestSimple.LabelsPayload, + milestone: Components.Schemas.NullableMilestone? = nil, + activeLockReason: Swift.String? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + closedAt: Foundation.Date? = nil, + mergedAt: Foundation.Date? = nil, + mergeCommitSha: Swift.String? = nil, + assignee: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil, + requestedReviewers: [Components.Schemas.SimpleUser]? = nil, + requestedTeams: [Components.Schemas.Team]? = nil, + head: Components.Schemas.PullRequestSimple.HeadPayload, + base: Components.Schemas.PullRequestSimple.BasePayload, + _links: Components.Schemas.PullRequestSimple._LinksPayload, + authorAssociation: Components.Schemas.AuthorAssociation, + autoMerge: Components.Schemas.AutoMerge? = nil, + draft: Swift.Bool? = nil + ) { + self.url = url + self.id = id + self.nodeId = nodeId + self.htmlUrl = htmlUrl + self.diffUrl = diffUrl + self.patchUrl = patchUrl + self.issueUrl = issueUrl + self.commitsUrl = commitsUrl + self.reviewCommentsUrl = reviewCommentsUrl + self.reviewCommentUrl = reviewCommentUrl + self.commentsUrl = commentsUrl + self.statusesUrl = statusesUrl + self.number = number + self.state = state + self.locked = locked + self.title = title + self.user = user + self.body = body + self.labels = labels + self.milestone = milestone + self.activeLockReason = activeLockReason + self.createdAt = createdAt + self.updatedAt = updatedAt + self.closedAt = closedAt + self.mergedAt = mergedAt + self.mergeCommitSha = mergeCommitSha + self.assignee = assignee + self.assignees = assignees + self.requestedReviewers = requestedReviewers + self.requestedTeams = requestedTeams + self.head = head + self.base = base + self._links = _links + self.authorAssociation = authorAssociation + self.autoMerge = autoMerge + self.draft = draft } - public var headers: Operations.ProjectsGetColumn.Input.Headers - /// Creates a new `Input`. + public enum CodingKeys: String, CodingKey { + case url + case id + case nodeId = "node_id" + case htmlUrl = "html_url" + case diffUrl = "diff_url" + case patchUrl = "patch_url" + case issueUrl = "issue_url" + case commitsUrl = "commits_url" + case reviewCommentsUrl = "review_comments_url" + case reviewCommentUrl = "review_comment_url" + case commentsUrl = "comments_url" + case statusesUrl = "statuses_url" + case number + case state + case locked + case title + case user + case body + case labels + case milestone + case activeLockReason = "active_lock_reason" + case createdAt = "created_at" + case updatedAt = "updated_at" + case closedAt = "closed_at" + case mergedAt = "merged_at" + case mergeCommitSha = "merge_commit_sha" + case assignee + case assignees + case requestedReviewers = "requested_reviewers" + case requestedTeams = "requested_teams" + case head + case base + case _links + case authorAssociation = "author_association" + case autoMerge = "auto_merge" + case draft + } + } + /// A draft issue in a project + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue`. + public struct ProjectsV2DraftIssue: Codable, Hashable, Sendable { + /// The ID of the draft issue + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/id`. + public var id: Swift.Double + /// The node ID of the draft issue + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/node_id`. + public var nodeId: Swift.String + /// The title of the draft issue + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/title`. + public var title: Swift.String + /// The body content of the draft issue + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// The time the draft issue was created + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/created_at`. + public var createdAt: Foundation.Date + /// The time the draft issue was last updated + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-draft-issue/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `ProjectsV2DraftIssue`. /// /// - Parameters: - /// - path: - /// - headers: + /// - id: The ID of the draft issue + /// - nodeId: The node ID of the draft issue + /// - title: The title of the draft issue + /// - body: The body content of the draft issue + /// - user: + /// - createdAt: The time the draft issue was created + /// - updatedAt: The time the draft issue was last updated public init( - path: Operations.ProjectsGetColumn.Input.Path, - headers: Operations.ProjectsGetColumn.Input.Headers = .init() + id: Swift.Double, + nodeId: Swift.String, + title: Swift.String, + body: Swift.String? = nil, + user: Components.Schemas.NullableSimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date ) { - self.path = path - self.headers = headers + self.id = id + self.nodeId = nodeId + self.title = title + self.body = body + self.user = user + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case title + case body + case user + case createdAt = "created_at" + case updatedAt = "updated_at" } } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectColumn) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ProjectColumn { - get throws { - switch self { - case let .json(body): - return body - } - } + /// An item belonging to a project + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple`. + public struct ProjectsV2ItemSimple: Codable, Hashable, Sendable { + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/id`. + public var id: Swift.Double + /// The node ID of the project item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/node_id`. + public var nodeId: Swift.String? + /// The content represented by the item. + /// + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content`. + @frozen public enum ContentPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content/case1`. + case Issue(Components.Schemas.Issue) + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content/case2`. + case PullRequestSimple(Components.Schemas.PullRequestSimple) + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content/case3`. + case ProjectsV2DraftIssue(Components.Schemas.ProjectsV2DraftIssue) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .Issue(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .PullRequestSimple(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .ProjectsV2DraftIssue(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .Issue(value): + try value.encode(to: encoder) + case let .PullRequestSimple(value): + try value.encode(to: encoder) + case let .ProjectsV2DraftIssue(value): + try value.encode(to: encoder) } } - /// Received HTTP response body - public var body: Operations.ProjectsGetColumn.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsGetColumn.Output.Ok.Body) { - self.body = body - } } - /// Response + /// The content represented by the item. /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)/responses/200`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content`. + public var content: Components.Schemas.ProjectsV2ItemSimple.ContentPayload? + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/content_type`. + public var contentType: Components.Schemas.ProjectsV2ItemContentType + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/creator`. + public var creator: Components.Schemas.SimpleUser? + /// The time when the item was created. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetColumn.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/created_at`. + public var createdAt: Foundation.Date + /// The time when the item was last updated. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsGetColumn.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Not modified + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/updated_at`. + public var updatedAt: Foundation.Date + /// The time when the item was archived. /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)/responses/304`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/archived_at`. + public var archivedAt: Foundation.Date? + /// The URL of the project this item belongs to. /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/project_url`. + public var projectUrl: Swift.String? + /// The URL of the item in the project. /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)/responses/304`. + /// - Remark: Generated from `#/components/schemas/projects-v2-item-simple/item_url`. + public var itemUrl: Swift.String? + /// Creates a new `ProjectsV2ItemSimple`. /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) + /// - Parameters: + /// - id: The unique identifier of the project item. + /// - nodeId: The node ID of the project item. + /// - content: The content represented by the item. + /// - contentType: + /// - creator: + /// - createdAt: The time when the item was created. + /// - updatedAt: The time when the item was last updated. + /// - archivedAt: The time when the item was archived. + /// - projectUrl: The URL of the project this item belongs to. + /// - itemUrl: The URL of the item in the project. + public init( + id: Swift.Double, + nodeId: Swift.String? = nil, + content: Components.Schemas.ProjectsV2ItemSimple.ContentPayload? = nil, + contentType: Components.Schemas.ProjectsV2ItemContentType, + creator: Components.Schemas.SimpleUser? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + archivedAt: Foundation.Date? = nil, + projectUrl: Swift.String? = nil, + itemUrl: Swift.String? = nil + ) { + self.id = id + self.nodeId = nodeId + self.content = content + self.contentType = contentType + self.creator = creator + self.createdAt = createdAt + self.updatedAt = updatedAt + self.archivedAt = archivedAt + self.projectUrl = projectUrl + self.itemUrl = itemUrl } - /// The associated value of the enum case if `self` is `.notModified`. - /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case content + case contentType = "content_type" + case creator + case createdAt = "created_at" + case updatedAt = "updated_at" + case archivedAt = "archived_at" + case projectUrl = "project_url" + case itemUrl = "item_url" + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// 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)." + /// + /// - Remark: Generated from `#/components/parameters/pagination-before`. + public typealias PaginationBefore = Swift.String + /// 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)." + /// + /// - Remark: Generated from `#/components/parameters/pagination-after`. + public typealias PaginationAfter = Swift.String + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/components/parameters/per-page`. + public typealias PerPage = Swift.Int + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String + /// The project's number. + /// + /// - Remark: Generated from `#/components/parameters/project-number`. + public typealias ProjectNumber = Swift.Int + /// The unique identifier of the field. + /// + /// - Remark: Generated from `#/components/parameters/field-id`. + public typealias FieldId = Swift.Int + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/components/parameters/item-id`. + public typealias ItemId = Swift.Int + } + /// 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 { + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } } } } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// Received HTTP response body + public var body: Components.Responses.NotFound.Body + /// Creates a new `NotFound`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.NotFound.Body) { + self.body = body + } + } + public struct ValidationFailed: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content/application\/json`. + case json(Components.Schemas.ValidationError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationError { + get throws { + switch self { + case let .json(body): + return body + } } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// Received HTTP response body + public var body: Components.Responses.ValidationFailed.Body + /// Creates a new `ValidationFailed`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailed.Body) { + self.body = body + } + } + public struct NotModified: Sendable, Hashable { + /// Creates a new `NotModified`. + public init() {} + } + public struct RequiresAuthentication: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } } } } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/get(projects/get-column)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// Received HTTP response body + public var body: Components.Responses.RequiresAuthentication.Body + /// Creates a new `RequiresAuthentication`. /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.RequiresAuthentication.Body) { + self.body = body + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } } } } - /// Undocumented response. + /// Received HTTP response body + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Forbidden.Body) { + self.body = body } } } - /// Update an existing project column + /// Types generated from the `#/components/headers` section of the OpenAPI document. + public enum Headers { + /// - Remark: Generated from `#/components/headers/link`. + public typealias Link = Swift.String + } +} + +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations { + /// List projects for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all projects owned by a specific organization accessible by the authenticated user. /// - /// - Remark: HTTP `PATCH /projects/columns/{column_id}`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)`. - public enum ProjectsUpdateColumn { - public static let id: Swift.String = "projects/update-column" + /// - Remark: HTTP `GET /orgs/{org}/projectsV2`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)`. + public enum ProjectsListForOrg { + public static let id: Swift.String = "projects/list-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the column. + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/path/column_id`. - public var columnId: Components.Parameters.ColumnId + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/path/org`. + public var org: Components.Parameters.Org /// Creates a new `Path`. /// /// - Parameters: - /// - columnId: The unique identifier of the column. - public init(columnId: Components.Parameters.ColumnId) { - self.columnId = columnId + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.ProjectsListForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query`. + public struct Query: Sendable, Hashable { + /// Limit results to projects of the specified type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query/q`. + public var q: Swift.String? + /// 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - q: Limit results to projects of the specified type. + /// - 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)." + /// - 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)." + /// - perPage: The number of results per page (max 100). 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)." + public init( + q: Swift.String? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.q = q + self.before = before + self.after = after + self.perPage = perPage } } - public var path: Operations.ProjectsUpdateColumn.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/header`. + public var query: Operations.ProjectsListForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsUpdateColumn.Input.Headers - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Name of the project column - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody/json/name`. - public var name: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: Name of the project column - public init(name: Swift.String) { - self.name = name - } - public enum CodingKeys: String, CodingKey { - case name - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.ProjectsUpdateColumn.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsUpdateColumn.Input.Body + public var headers: Operations.ProjectsListForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.ProjectsUpdateColumn.Input.Path, - headers: Operations.ProjectsUpdateColumn.Input.Headers = .init(), - body: Operations.ProjectsUpdateColumn.Input.Body + path: Operations.ProjectsListForOrg.Input.Path, + query: Operations.ProjectsListForOrg.Input.Query = .init(), + headers: Operations.ProjectsListForOrg.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsListForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectColumn) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ProjectColumn { + public var json: [Components.Schemas.ProjectsV2] { get throws { switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsUpdateColumn.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsUpdateColumn.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsUpdateColumn.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsUpdateColumn.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// The associated value of the enum case if `self` is `.notModified`. - /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/patch(projects/update-column)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. - /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Delete a project column - /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. - /// - /// - Remark: HTTP `DELETE /projects/columns/{column_id}`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)`. - public enum ProjectsDeleteColumn { - public static let id: Swift.String = "projects/delete-column" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The unique identifier of the column. - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/DELETE/path/column_id`. - public var columnId: Components.Parameters.ColumnId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - columnId: The unique identifier of the column. - public init(columnId: Components.Parameters.ColumnId) { - self.columnId = columnId + case let .json(body): + return body + } + } + } } - } - public var path: Operations.ProjectsDeleteColumn.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/DELETE/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. + /// Received HTTP response body + public var body: Operations.ProjectsListForOrg.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsListForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsListForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body } } - public var headers: Operations.ProjectsDeleteColumn.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.ProjectsDeleteColumn.Input.Path, - headers: Operations.ProjectsDeleteColumn.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ProjectsDeleteColumn.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ProjectsDeleteColumn.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsListForOrg.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } @@ -4134,13 +5029,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -4165,7 +5060,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -4188,7 +5083,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/delete(projects/delete-column)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/get(projects/list-for-org)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -4240,102 +5135,69 @@ public enum Operations { } } } - /// List project cards + /// Get project for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific organization-owned project. /// - /// - Remark: HTTP `GET /projects/columns/{column_id}/cards`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)`. - public enum ProjectsListCards { - public static let id: Swift.String = "projects/list-cards" + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)`. + public enum ProjectsGetForOrg { + public static let id: Swift.String = "projects/get-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the column. - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/path/column_id`. - public var columnId: Components.Parameters.ColumnId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - columnId: The unique identifier of the column. - public init(columnId: Components.Parameters.ColumnId) { - self.columnId = columnId - } - } - public var path: Operations.ProjectsListCards.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/query/archived_state`. - @frozen public enum ArchivedStatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case archived = "archived" - case notArchived = "not_archived" - } - /// Filters the project cards that are returned by the card's state. - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/query/archived_state`. - public var archivedState: Operations.ProjectsListCards.Input.Query.ArchivedStatePayload? - /// The number of results per page (max 100). 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)." + /// The project's number. /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. /// /// - Parameters: - /// - archivedState: Filters the project cards that are returned by the card's state. - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. public init( - archivedState: Operations.ProjectsListCards.Input.Query.ArchivedStatePayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org ) { - self.archivedState = archivedState - self.perPage = perPage - self.page = page + self.projectNumber = projectNumber + self.org = org } } - public var query: Operations.ProjectsListCards.Input.Query - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/header`. + public var path: Operations.ProjectsGetForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsListCards.Input.Headers + public var headers: Operations.ProjectsGetForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ProjectsListCards.Input.Path, - query: Operations.ProjectsListCards.Input.Query = .init(), - headers: Operations.ProjectsListCards.Input.Headers = .init() + path: Operations.ProjectsGetForOrg.Input.Path, + headers: Operations.ProjectsGetForOrg.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -4346,16 +5208,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ProjectsListCards.Output.Ok.Headers - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/responses/200/content`. + public var headers: Operations.ProjectsGetForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ProjectCard]) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.ProjectCard] { + public var json: Components.Schemas.ProjectsV2 { get throws { switch self { case let .json(body): @@ -4365,15 +5227,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsListCards.Output.Ok.Body + public var body: Operations.ProjectsGetForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ProjectsListCards.Output.Ok.Headers = .init(), - body: Operations.ProjectsListCards.Output.Ok.Body + headers: Operations.ProjectsGetForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetForOrg.Output.Ok.Body ) { self.headers = headers self.body = body @@ -4381,15 +5243,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListCards.Output.Ok) + case ok(Operations.ProjectsGetForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsListCards.Output.Ok { + public var ok: Operations.ProjectsGetForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -4404,13 +5266,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -4435,7 +5297,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -4458,7 +5320,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/get(projects/list-cards)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/get(projects/get-for-org)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -4510,156 +5372,123 @@ public enum Operations { } } } - /// Create a project card + /// List project fields for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all fields for a specific organization-owned project. /// - /// - Remark: HTTP `POST /projects/columns/{column_id}/cards`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)`. - public enum ProjectsCreateCard { - public static let id: Swift.String = "projects/create-card" + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)`. + public enum ProjectsListFieldsForOrg { + public static let id: Swift.String = "projects/list-fields-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the column. + /// The project's number. /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/path/column_id`. - public var columnId: Components.Parameters.ColumnId + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/path/org`. + public var org: Components.Parameters.Org /// Creates a new `Path`. /// /// - Parameters: - /// - columnId: The unique identifier of the column. - public init(columnId: Components.Parameters.ColumnId) { - self.columnId = columnId + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + public init( + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org + ) { + self.projectNumber = projectNumber + self.org = org + } + } + public var path: Operations.ProjectsListFieldsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - 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)." + /// - 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil + ) { + self.perPage = perPage + self.before = before + self.after = after } } - public var path: Operations.ProjectsCreateCard.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/header`. + public var query: Operations.ProjectsListFieldsForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsCreateCard.Input.Headers - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json`. - @frozen public enum JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// The project card's note - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case1/note`. - public var note: Swift.String? - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - note: The project card's note - public init(note: Swift.String? = nil) { - self.note = note - } - public enum CodingKeys: String, CodingKey { - case note - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case1`. - case case1(Operations.ProjectsCreateCard.Input.Body.JsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case2`. - public struct Case2Payload: Codable, Hashable, Sendable { - /// The unique identifier of the content associated with the card - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case2/content_id`. - public var contentId: Swift.Int - /// The piece of content associated with the card - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case2/content_type`. - public var contentType: Swift.String - /// Creates a new `Case2Payload`. - /// - /// - Parameters: - /// - contentId: The unique identifier of the content associated with the card - /// - contentType: The piece of content associated with the card - public init( - contentId: Swift.Int, - contentType: Swift.String - ) { - self.contentId = contentId - self.contentType = contentType - } - public enum CodingKeys: String, CodingKey { - case contentId = "content_id" - case contentType = "content_type" - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/json/case2`. - case case2(Operations.ProjectsCreateCard.Input.Body.JsonPayload.Case2Payload) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .case1(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case2(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .case1(value): - try value.encode(to: encoder) - case let .case2(value): - try value.encode(to: encoder) - } - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsCreateCard.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsCreateCard.Input.Body + public var headers: Operations.ProjectsListFieldsForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.ProjectsCreateCard.Input.Path, - headers: Operations.ProjectsCreateCard.Input.Headers = .init(), - body: Operations.ProjectsCreateCard.Input.Body + path: Operations.ProjectsListFieldsForOrg.Input.Path, + query: Operations.ProjectsListFieldsForOrg.Input.Query = .init(), + headers: Operations.ProjectsListFieldsForOrg.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsListFieldsForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/201/content/application\/json`. - case json(Components.Schemas.ProjectCard) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2Field]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ProjectCard { + public var json: [Components.Schemas.ProjectsV2Field] { get throws { switch self { case let .json(body): @@ -4669,33 +5498,38 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsCreateCard.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.ProjectsListFieldsForOrg.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ProjectsCreateCard.Output.Created.Body) { + public init( + headers: Operations.ProjectsListFieldsForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsListFieldsForOrg.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsCreateCard.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListFieldsForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ProjectsCreateCard.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsListFieldsForOrg.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } @@ -4703,13 +5537,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -4727,249 +5561,52 @@ public enum Operations { default: try throwUnexpectedResponseStatus( expectedStatus: "notModified", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. - /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - public struct UnprocessableContent: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/422/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/422/content/json`. - @frozen public enum JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/422/content/json/case1`. - case ValidationError(Components.Schemas.ValidationError) - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/422/content/json/case2`. - case ValidationErrorSimple(Components.Schemas.ValidationErrorSimple) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .ValidationError(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .ValidationErrorSimple(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .ValidationError(value): - try value.encode(to: encoder) - case let .ValidationErrorSimple(value): - try value.encode(to: encoder) - } - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/422/content/application\/json`. - case json(Operations.ProjectsCreateCard.Output.UnprocessableContent.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.ProjectsCreateCard.Output.UnprocessableContent.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsCreateCard.Output.UnprocessableContent.Body - /// Creates a new `UnprocessableContent`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsCreateCard.Output.UnprocessableContent.Body) { - self.body = body + response: self + ) + } } } - /// Validation failed + /// Forbidden /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/403`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.ProjectsCreateCard.Output.UnprocessableContent) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.ProjectsCreateCard.Output.UnprocessableContent { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .unprocessableContent(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "forbidden", response: self ) } } } - public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/code`. - public var code: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/ErrorsPayload`. - public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/ErrorsPayload/code`. - public var code: Swift.String? - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/ErrorsPayload/message`. - public var message: Swift.String? - /// Creates a new `ErrorsPayloadPayload`. - /// - /// - Parameters: - /// - code: - /// - message: - public init( - code: Swift.String? = nil, - message: Swift.String? = nil - ) { - self.code = code - self.message = message - } - public enum CodingKeys: String, CodingKey { - case code - case message - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/errors`. - public typealias ErrorsPayload = [Operations.ProjectsCreateCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayloadPayload] - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/json/errors`. - public var errors: Operations.ProjectsCreateCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - code: - /// - message: - /// - documentationUrl: - /// - errors: - public init( - code: Swift.String? = nil, - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil, - errors: Operations.ProjectsCreateCard.Output.ServiceUnavailable.Body.JsonPayload.ErrorsPayload? = nil - ) { - self.code = code - self.message = message - self.documentationUrl = documentationUrl - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case code - case message - case documentationUrl = "documentation_url" - case errors - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/cards/POST/responses/503/content/application\/json`. - case json(Operations.ProjectsCreateCard.Output.ServiceUnavailable.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.ProjectsCreateCard.Output.ServiceUnavailable.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsCreateCard.Output.ServiceUnavailable.Body - /// Creates a new `ServiceUnavailable`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsCreateCard.Output.ServiceUnavailable.Body) { - self.body = body - } - } - /// Response + /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/cards/post(projects/create-card)/responses/503`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/get(projects/list-fields-for-org)/responses/401`. /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ProjectsCreateCard.Output.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ProjectsCreateCard.Output.ServiceUnavailable { + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { get throws { switch self { - case let .serviceUnavailable(response): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", + expectedStatus: "unauthorized", response: self ) } @@ -5006,102 +5643,96 @@ public enum Operations { } } } - /// Move a project column + /// Get project field for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific field for an organization-owned project. /// - /// - Remark: HTTP `POST /projects/columns/{column_id}/moves`. - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)`. - public enum ProjectsMoveColumn { - public static let id: Swift.String = "projects/move-column" + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)`. + public enum ProjectsGetFieldForOrg { + public static let id: Swift.String = "projects/get-field-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the column. + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The unique identifier of the field. /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/path/column_id`. - public var columnId: Components.Parameters.ColumnId + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path/field_id`. + public var fieldId: Components.Parameters.FieldId + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/path/org`. + public var org: Components.Parameters.Org /// Creates a new `Path`. /// /// - Parameters: - /// - columnId: The unique identifier of the column. - public init(columnId: Components.Parameters.ColumnId) { - self.columnId = columnId + /// - projectNumber: The project's number. + /// - fieldId: The unique identifier of the field. + /// - org: The organization name. The name is not case sensitive. + public init( + projectNumber: Components.Parameters.ProjectNumber, + fieldId: Components.Parameters.FieldId, + org: Components.Parameters.Org + ) { + self.projectNumber = projectNumber + self.fieldId = fieldId + self.org = org } } - public var path: Operations.ProjectsMoveColumn.Input.Path - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/header`. + public var path: Operations.ProjectsGetFieldForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsMoveColumn.Input.Headers - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column. - /// - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody/json/position`. - public var position: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - position: The position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column. - public init(position: Swift.String) { - self.position = position - } - public enum CodingKeys: String, CodingKey { - case position - } - } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsMoveColumn.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsMoveColumn.Input.Body + public var headers: Operations.ProjectsGetFieldForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.ProjectsMoveColumn.Input.Path, - headers: Operations.ProjectsMoveColumn.Input.Headers = .init(), - body: Operations.ProjectsMoveColumn.Input.Body + path: Operations.ProjectsGetFieldForOrg.Input.Path, + headers: Operations.ProjectsGetFieldForOrg.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/responses/201/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Creates a new `JsonPayload`. - public init() {} - public init(from decoder: any Decoder) throws { - try decoder.ensureNoAdditionalProperties(knownKeys: []) - } + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link } - /// - Remark: Generated from `#/paths/projects/columns/{column_id}/moves/POST/responses/201/content/application\/json`. - case json(Operations.ProjectsMoveColumn.Output.Created.Body.JsonPayload) + } + /// Received HTTP response headers + public var headers: Operations.ProjectsGetFieldForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2Field) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ProjectsMoveColumn.Output.Created.Body.JsonPayload { + public var json: Components.Schemas.ProjectsV2Field { get throws { switch self { case let .json(body): @@ -5111,33 +5742,38 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsMoveColumn.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.ProjectsGetFieldForOrg.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ProjectsMoveColumn.Output.Created.Body) { + public init( + headers: Operations.ProjectsGetFieldForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetFieldForOrg.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsMoveColumn.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsGetFieldForOrg.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ProjectsMoveColumn.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsGetFieldForOrg.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } @@ -5145,13 +5781,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -5176,7 +5812,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -5197,32 +5833,9 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/columns/{column_id}/moves/post(projects/move-column)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-org)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -5274,68 +5887,174 @@ public enum Operations { } } } - /// Get a project + /// List items for an organization owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all items for a specific organization-owned project accessible by the authenticated user. /// - /// - Remark: HTTP `GET /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)`. - public enum ProjectsGet { - public static let id: Swift.String = "projects/get" + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)`. + public enum ProjectsListItemsForOrg { + public static let id: Swift.String = "projects/list-items-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the project. + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/GET/path/project_id`. - public var projectId: Components.Parameters.ProjectId + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/path/org`. + public var org: Components.Parameters.Org /// Creates a new `Path`. /// /// - Parameters: - /// - projectId: The unique identifier of the project. - public init(projectId: Components.Parameters.ProjectId) { - self.projectId = projectId + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + public init( + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org + ) { + self.projectNumber = projectNumber + self.org = org + } + } + public var path: Operations.ProjectsListItemsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query`. + public struct Query: Sendable, Hashable { + /// Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/q`. + public var q: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/fields`. + @frozen public enum FieldsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/fields/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/fields/case2`. + case case2([Swift.String]) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// + /// Example: `fields[]=123&fields[]=456&fields[]=789` or `fields=123,456,789` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/fields`. + public var fields: Operations.ProjectsListItemsForOrg.Input.Query.FieldsPayload? + /// 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - q: Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// - 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)." + /// - 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)." + /// - perPage: The number of results per page (max 100). 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)." + public init( + q: Swift.String? = nil, + fields: Operations.ProjectsListItemsForOrg.Input.Query.FieldsPayload? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.q = q + self.fields = fields + self.before = before + self.after = after + self.perPage = perPage } } - public var path: Operations.ProjectsGet.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_id}/GET/header`. + public var query: Operations.ProjectsListItemsForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsGet.Input.Headers + public var headers: Operations.ProjectsListItemsForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ProjectsGet.Input.Path, - headers: Operations.ProjectsGet.Input.Headers = .init() + path: Operations.ProjectsListItemsForOrg.Input.Path, + query: Operations.ProjectsListItemsForOrg.Input.Query = .init(), + headers: Operations.ProjectsListItemsForOrg.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsListItemsForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Project) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2ItemWithContent]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Project { + public var json: [Components.Schemas.ProjectsV2ItemWithContent] { get throws { switch self { case let .json(body): @@ -5345,26 +6064,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsGet.Output.Ok.Body + public var body: Operations.ProjectsListItemsForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ProjectsGet.Output.Ok.Body) { + public init( + headers: Operations.ProjectsListItemsForOrg.Output.Ok.Headers = .init(), + body: Operations.ProjectsListItemsForOrg.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGet.Output.Ok) + case ok(Operations.ProjectsListItemsForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsGet.Output.Ok { + public var ok: Operations.ProjectsListItemsForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -5379,13 +6103,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -5410,7 +6134,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -5433,7 +6157,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/{project_id}/get(projects/get)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/get(projects/list-items-for-org)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -5485,110 +6209,91 @@ public enum Operations { } } } - /// Update a project + /// Add item to organization owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Add an issue or pull request item to the specified organization owned project. /// - /// - Remark: HTTP `PATCH /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)`. - public enum ProjectsUpdate { - public static let id: Swift.String = "projects/update" + /// - Remark: HTTP `POST /orgs/{org}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)`. + public enum ProjectsAddItemForOrg { + public static let id: Swift.String = "projects/add-item-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the project. + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/path/project_id`. - public var projectId: Components.Parameters.ProjectId + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/path/org`. + public var org: Components.Parameters.Org + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber /// Creates a new `Path`. /// /// - Parameters: - /// - projectId: The unique identifier of the project. - public init(projectId: Components.Parameters.ProjectId) { - self.projectId = projectId + /// - org: The organization name. The name is not case sensitive. + /// - projectNumber: The project's number. + public init( + org: Components.Parameters.Org, + projectNumber: Components.Parameters.ProjectNumber + ) { + self.org = org + self.projectNumber = projectNumber } } - public var path: Operations.ProjectsUpdate.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/header`. + public var path: Operations.ProjectsAddItemForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsUpdate.Input.Headers - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody`. + public var headers: Operations.ProjectsAddItemForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// Name of the project - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/name`. - public var name: Swift.String? - /// Body of the project + /// The type of item to add to the project. Must be either Issue or PullRequest. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/body`. - public var body: Swift.String? - /// State of the project; either 'open' or 'closed' - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/state`. - public var state: Swift.String? - /// The baseline permission that all organization members have on this project - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/organization_permission`. - @frozen public enum OrganizationPermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case read = "read" - case write = "write" - case admin = "admin" - case none = "none" - } - /// The baseline permission that all organization members have on this project + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case issue = "Issue" + case pullRequest = "PullRequest" + } + /// The type of item to add to the project. Must be either Issue or PullRequest. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/organization_permission`. - public var organizationPermission: Operations.ProjectsUpdate.Input.Body.JsonPayload.OrganizationPermissionPayload? - /// Whether or not this project can be seen by everyone. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json/type`. + public var _type: Operations.ProjectsAddItemForOrg.Input.Body.JsonPayload._TypePayload + /// The numeric ID of the issue or pull request to add to the project. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/json/private`. - public var _private: Swift.Bool? + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/json/id`. + public var id: Swift.Int /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - name: Name of the project - /// - body: Body of the project - /// - state: State of the project; either 'open' or 'closed' - /// - organizationPermission: The baseline permission that all organization members have on this project - /// - _private: Whether or not this project can be seen by everyone. + /// - _type: The type of item to add to the project. Must be either Issue or PullRequest. + /// - id: The numeric ID of the issue or pull request to add to the project. public init( - name: Swift.String? = nil, - body: Swift.String? = nil, - state: Swift.String? = nil, - organizationPermission: Operations.ProjectsUpdate.Input.Body.JsonPayload.OrganizationPermissionPayload? = nil, - _private: Swift.Bool? = nil + _type: Operations.ProjectsAddItemForOrg.Input.Body.JsonPayload._TypePayload, + id: Swift.Int ) { - self.name = name - self.body = body - self.state = state - self.organizationPermission = organizationPermission - self._private = _private + self._type = _type + self.id = id } public enum CodingKeys: String, CodingKey { - case name - case body - case state - case organizationPermission = "organization_permission" - case _private = "private" + case _type = "type" + case id } } - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.ProjectsUpdate.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsAddItemForOrg.Input.Body.JsonPayload) } - public var body: Operations.ProjectsUpdate.Input.Body? + public var body: Operations.ProjectsAddItemForOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -5596,9 +6301,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ProjectsUpdate.Input.Path, - headers: Operations.ProjectsUpdate.Input.Headers = .init(), - body: Operations.ProjectsUpdate.Input.Body? = nil + path: Operations.ProjectsAddItemForOrg.Input.Path, + headers: Operations.ProjectsAddItemForOrg.Input.Headers = .init(), + body: Operations.ProjectsAddItemForOrg.Input.Body ) { self.path = path self.headers = headers @@ -5606,87 +6311,52 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.Project) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemSimple) /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.Project { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsUpdate.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsUpdate.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsUpdate.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsUpdate.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectsV2ItemSimple { + get throws { + switch self { + case let .json(body): + return body + } + } } } + /// Received HTTP response body + public var body: Operations.ProjectsAddItemForOrg.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ProjectsAddItemForOrg.Output.Created.Body) { + self.body = body + } } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. - public init() {} - } - /// Not Found if the authenticated user does not have access to the project - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.ProjectsUpdate.Output.NotFound) - /// Not Found if the authenticated user does not have access to the project + /// Response /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/201`. /// - /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) - } - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `201 created`. + case created(Operations.ProjectsAddItemForOrg.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Operations.ProjectsUpdate.Output.NotFound { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsAddItemForOrg.Output.Created { get throws { switch self { - case let .notFound(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "created", response: self ) } @@ -5694,13 +6364,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -5723,74 +6393,17 @@ public enum Operations { } } } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/json/errors`. - public var errors: [Swift.String]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - message: - /// - documentationUrl: - /// - errors: - public init( - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil, - errors: [Swift.String]? = nil - ) { - self.message = message - self.documentationUrl = documentationUrl - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - case errors - } - } - /// - Remark: Generated from `#/paths/projects/{project_id}/PATCH/responses/403/content/application\/json`. - case json(Operations.ProjectsUpdate.Output.Forbidden.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.ProjectsUpdate.Output.Forbidden.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ProjectsUpdate.Output.Forbidden.Body - /// Creates a new `Forbidden`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ProjectsUpdate.Output.Forbidden.Body) { - self.body = body - } - } /// Forbidden /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/403`. /// /// HTTP response code: `403 forbidden`. - case forbidden(Operations.ProjectsUpdate.Output.Forbidden) + case forbidden(Components.Responses.Forbidden) /// The associated value of the enum case if `self` is `.forbidden`. /// /// - Throws: An error if `self` is not `.forbidden`. /// - SeeAlso: `.forbidden`. - public var forbidden: Operations.ProjectsUpdate.Output.Forbidden { + public var forbidden: Components.Responses.Forbidden { get throws { switch self { case let .forbidden(response): @@ -5805,7 +6418,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/post(projects/add-item-for-org)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -5826,52 +6439,6 @@ public enum Operations { } } } - /// Gone - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/410`. - /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. - /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { - get throws { - switch self { - case let .gone(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "gone", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/patch(projects/update)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -5903,163 +6470,151 @@ public enum Operations { } } } - /// Delete a project + /// Get an item for an organization owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific item from an organization-owned project. /// - /// - Remark: HTTP `DELETE /projects/{project_id}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)`. - public enum ProjectsDelete { - public static let id: Swift.String = "projects/delete" + /// - Remark: HTTP `GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)`. + public enum ProjectsGetOrgItem { + public static let id: Swift.String = "projects/get-org-item" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the project. + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/path/project_id`. - public var projectId: Components.Parameters.ProjectId + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path/org`. + public var org: Components.Parameters.Org + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/path/item_id`. + public var itemId: Components.Parameters.ItemId /// Creates a new `Path`. /// /// - Parameters: - /// - projectId: The unique identifier of the project. - public init(projectId: Components.Parameters.ProjectId) { - self.projectId = projectId + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + /// - itemId: The unique identifier of the project item. + public init( + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org, + itemId: Components.Parameters.ItemId + ) { + self.projectNumber = projectNumber + self.org = org + self.itemId = itemId + } + } + public var path: Operations.ProjectsGetOrgItem.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query/fields`. + @frozen public enum FieldsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query/fields/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query/fields/case2`. + case case2([Swift.String]) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// + /// Example: fields[]=123&fields[]=456&fields[]=789 or fields=123,456,789 + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/query/fields`. + public var fields: Operations.ProjectsGetOrgItem.Input.Query.FieldsPayload? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + public init(fields: Operations.ProjectsGetOrgItem.Input.Query.FieldsPayload? = nil) { + self.fields = fields } } - public var path: Operations.ProjectsDelete.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/header`. + public var query: Operations.ProjectsGetOrgItem.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsDelete.Input.Headers + public var headers: Operations.ProjectsGetOrgItem.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ProjectsDelete.Input.Path, - headers: Operations.ProjectsDelete.Input.Headers = .init() + path: Operations.ProjectsGetOrgItem.Input.Path, + query: Operations.ProjectsGetOrgItem.Input.Query = .init(), + headers: Operations.ProjectsGetOrgItem.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Delete Success - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ProjectsDelete.Output.NoContent) - /// Delete Success - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ProjectsDelete.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// The associated value of the enum case if `self` is `.notModified`. - /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link } } - } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content`. + /// Received HTTP response headers + public var headers: Operations.ProjectsGetOrgItem.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/json/errors`. - public var errors: [Swift.String]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - message: - /// - documentationUrl: - /// - errors: - public init( - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil, - errors: [Swift.String]? = nil - ) { - self.message = message - self.documentationUrl = documentationUrl - self.errors = errors - } - public enum CodingKeys: String, CodingKey { - case message - case documentationUrl = "documentation_url" - case errors - } - } - /// - Remark: Generated from `#/paths/projects/{project_id}/DELETE/responses/403/content/application\/json`. - case json(Operations.ProjectsDelete.Output.Forbidden.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemWithContent) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ProjectsDelete.Output.Forbidden.Body.JsonPayload { + public var json: Components.Schemas.ProjectsV2ItemWithContent { get throws { switch self { case let .json(body): @@ -6069,102 +6624,115 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsDelete.Output.Forbidden.Body - /// Creates a new `Forbidden`. + public var body: Operations.ProjectsGetOrgItem.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ProjectsDelete.Output.Forbidden.Body) { + public init( + headers: Operations.ProjectsGetOrgItem.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetOrgItem.Output.Ok.Body + ) { + self.headers = headers self.body = body } } - /// Forbidden + /// Response /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/200`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.ProjectsDelete.Output.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsGetOrgItem.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Operations.ProjectsDelete.Output.Forbidden { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsGetOrgItem.Output.Ok { get throws { switch self { - case let .forbidden(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "ok", response: self ) } } } - /// Requires authentication + /// Not modified /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/304`. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { get throws { switch self { - case let .unauthorized(response): + case let .notModified(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "notModified", response: self ) } } } - /// Gone + /// Forbidden /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/410`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/403`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .gone(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "forbidden", response: self ) } } } - /// Resource not found + /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/{project_id}/delete(projects/delete)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/get(projects/get-org-item)/responses/401`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { get throws { switch self { - case let .notFound(response): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unauthorized", response: self ) } @@ -6201,122 +6769,182 @@ public enum Operations { } } } - /// List project collaborators + /// Update project item for organization /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Update a specific item in an organization-owned project. /// - /// - Remark: HTTP `GET /projects/{project_id}/collaborators`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)`. - public enum ProjectsListCollaborators { - public static let id: Swift.String = "projects/list-collaborators" + /// - Remark: HTTP `PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)`. + public enum ProjectsUpdateItemForOrg { + public static let id: Swift.String = "projects/update-item-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the project. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/path/project_id`. - public var projectId: Components.Parameters.ProjectId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - projectId: The unique identifier of the project. - public init(projectId: Components.Parameters.ProjectId) { - self.projectId = projectId - } - } - public var path: Operations.ProjectsListCollaborators.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query/affiliation`. - @frozen public enum AffiliationPayload: String, Codable, Hashable, Sendable, CaseIterable { - case outside = "outside" - case direct = "direct" - case all = "all" - } - /// Filters the collaborators by their affiliation. `outside` means outside collaborators of a project that are not a member of the project's organization. `direct` means collaborators with permissions to a project, regardless of organization membership status. `all` means all collaborators the authenticated user can see. + /// The project's number. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query/affiliation`. - public var affiliation: Operations.ProjectsListCollaborators.Input.Query.AffiliationPayload? - /// The number of results per page (max 100). 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)." + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path/org`. + public var org: Components.Parameters.Org + /// The unique identifier of the project item. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/path/item_id`. + public var itemId: Components.Parameters.ItemId + /// Creates a new `Path`. /// /// - Parameters: - /// - affiliation: Filters the collaborators by their affiliation. `outside` means outside collaborators of a project that are not a member of the project's organization. `direct` means collaborators with permissions to a project, regardless of organization membership status. `all` means all collaborators the authenticated user can see. - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + /// - itemId: The unique identifier of the project item. public init( - affiliation: Operations.ProjectsListCollaborators.Input.Query.AffiliationPayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org, + itemId: Components.Parameters.ItemId ) { - self.affiliation = affiliation - self.perPage = perPage - self.page = page + self.projectNumber = projectNumber + self.org = org + self.itemId = itemId } } - public var query: Operations.ProjectsListCollaborators.Input.Query - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/header`. + public var path: Operations.ProjectsUpdateItemForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsListCollaborators.Input.Headers + public var headers: Operations.ProjectsUpdateItemForOrg.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload`. + public struct FieldsPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the project field to update. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/id`. + public var id: Swift.Int + /// The new value for the field: + /// - For text, number, and date fields, provide the new value directly. + /// - For single select and iteration fields, provide the ID of the option or iteration. + /// - To clear the field, set this to null. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case2`. + case case2(Swift.Double) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The new value for the field: + /// - For text, number, and date fields, provide the new value directly. + /// - For single select and iteration fields, provide the ID of the option or iteration. + /// - To clear the field, set this to null. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. + public var value: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? + /// Creates a new `FieldsPayloadPayload`. + /// + /// - Parameters: + /// - id: The ID of the project field to update. + /// - value: The new value for the field: + public init( + id: Swift.Int, + value: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? = nil + ) { + self.id = id + self.value = value + } + public enum CodingKeys: String, CodingKey { + case id + case value + } + } + /// A list of field updates to apply. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. + public typealias FieldsPayload = [Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayloadPayload] + /// A list of field updates to apply. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. + public var fields: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - fields: A list of field updates to apply. + public init(fields: Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload.FieldsPayload) { + self.fields = fields + } + public enum CodingKeys: String, CodingKey { + case fields + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ProjectsUpdateItemForOrg.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsUpdateItemForOrg.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ProjectsListCollaborators.Input.Path, - query: Operations.ProjectsListCollaborators.Input.Query = .init(), - headers: Operations.ProjectsListCollaborators.Input.Headers = .init() + path: Operations.ProjectsUpdateItemForOrg.Input.Path, + headers: Operations.ProjectsUpdateItemForOrg.Input.Headers = .init(), + body: Operations.ProjectsUpdateItemForOrg.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ProjectsListCollaborators.Output.Ok.Headers - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/GET/responses/200/content/application\/json`. - case json([Components.Schemas.SimpleUser]) + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemWithContent) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.SimpleUser] { + public var json: Components.Schemas.ProjectsV2ItemWithContent { get throws { switch self { case let .json(body): @@ -6326,31 +6954,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsListCollaborators.Output.Ok.Body + public var body: Operations.ProjectsUpdateItemForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListCollaborators.Output.Ok.Headers = .init(), - body: Operations.ProjectsListCollaborators.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ProjectsUpdateItemForOrg.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListCollaborators.Output.Ok) + case ok(Operations.ProjectsUpdateItemForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsListCollaborators.Output.Ok { + public var ok: Operations.ProjectsUpdateItemForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -6363,9 +6986,55 @@ public enum Operations { } } } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } /// Resource not found /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -6388,7 +7057,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-org)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -6409,32 +7078,133 @@ public enum Operations { } } } - /// Not modified + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete project item for organization + /// + /// Delete a specific item from an organization-owned project. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)`. + public enum ProjectsDeleteItemForOrg { + public static let id: Swift.String = "projects/delete-item-for-org" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/path/item_id`. + public var itemId: Components.Parameters.ItemId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - org: The organization name. The name is not case sensitive. + /// - itemId: The unique identifier of the project item. + public init( + projectNumber: Components.Parameters.ProjectNumber, + org: Components.Parameters.Org, + itemId: Components.Parameters.ItemId + ) { + self.projectNumber = projectNumber + self.org = org + self.itemId = itemId + } + } + public var path: Operations.ProjectsDeleteItemForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/projectsV2/{project_number}/items/{item_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ProjectsDeleteItemForOrg.Input.Headers + /// Creates a new `Input`. /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)/responses/304`. + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ProjectsDeleteItemForOrg.Input.Path, + headers: Operations.ProjectsDeleteItemForOrg.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/204`. /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)/responses/304`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsDeleteItemForOrg.Output.NoContent) + /// Response /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) } - /// The associated value of the enum case if `self` is `.notModified`. + /// The associated value of the enum case if `self` is `.noContent`. /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsDeleteItemForOrg.Output.NoContent { get throws { switch self { - case let .notModified(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notModified", + expectedStatus: "noContent", response: self ) } @@ -6442,7 +7212,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -6465,7 +7235,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/get(projects/list-collaborators)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-org)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -6517,177 +7287,162 @@ public enum Operations { } } } - /// Add project collaborator + /// List projects for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all projects owned by a specific user accessible by the authenticated user. /// - /// - Remark: HTTP `PUT /projects/{project_id}/collaborators/{username}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)`. - public enum ProjectsAddCollaborator { - public static let id: Swift.String = "projects/add-collaborator" + /// - Remark: HTTP `GET /users/{username}/projectsV2`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)`. + public enum ProjectsListForUser { + public static let id: Swift.String = "projects/list-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the project. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/path/project_id`. - public var projectId: Components.Parameters.ProjectId /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/path/username`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/path/username`. public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: - /// - projectId: The unique identifier of the project. - /// - username: The handle for the GitHub user account. + /// - username: The handle for the GitHub user account. + public init(username: Components.Parameters.Username) { + self.username = username + } + } + public var path: Operations.ProjectsListForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query`. + public struct Query: Sendable, Hashable { + /// Limit results to projects of the specified type. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/q`. + public var q: Swift.String? + /// 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)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// 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)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - q: Limit results to projects of the specified type. + /// - 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)." + /// - 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)." + /// - perPage: The number of results per page (max 100). 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)." public init( - projectId: Components.Parameters.ProjectId, - username: Components.Parameters.Username + q: Swift.String? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil ) { - self.projectId = projectId - self.username = username + self.q = q + self.before = before + self.after = after + self.perPage = perPage } } - public var path: Operations.ProjectsAddCollaborator.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/header`. + public var query: Operations.ProjectsListForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsAddCollaborator.Input.Headers - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The permission to grant the collaborator. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/json/permission`. - @frozen public enum PermissionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case read = "read" - case write = "write" - case admin = "admin" - } - /// The permission to grant the collaborator. - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/json/permission`. - public var permission: Operations.ProjectsAddCollaborator.Input.Body.JsonPayload.PermissionPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - permission: The permission to grant the collaborator. - public init(permission: Operations.ProjectsAddCollaborator.Input.Body.JsonPayload.PermissionPayload? = nil) { - self.permission = permission - } - public enum CodingKeys: String, CodingKey { - case permission - } - } - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/PUT/requestBody/content/application\/json`. - case json(Operations.ProjectsAddCollaborator.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsAddCollaborator.Input.Body? + public var headers: Operations.ProjectsListForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.ProjectsAddCollaborator.Input.Path, - headers: Operations.ProjectsAddCollaborator.Input.Headers = .init(), - body: Operations.ProjectsAddCollaborator.Input.Body? = nil + path: Operations.ProjectsListForUser.Input.Path, + query: Operations.ProjectsListForUser.Input.Query = .init(), + headers: Operations.ProjectsListForUser.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ProjectsAddCollaborator.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ProjectsAddCollaborator.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link } } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) + /// Received HTTP response headers + public var headers: Operations.ProjectsListForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.ProjectsV2] { + get throws { + switch self { + case let .json(body): + return body + } + } } } + /// Received HTTP response body + public var body: Operations.ProjectsListForUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsListForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsListForUser.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } } - /// Validation failed, or the endpoint has been spammed. + /// Response /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/responses/422`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/200`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListForUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsListForUser.Output.Ok { get throws { switch self { - case let .unprocessableContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "ok", response: self ) } @@ -6695,13 +7450,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -6726,7 +7481,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -6749,7 +7504,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/put(projects/add-collaborator)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/get(projects/list-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -6801,97 +7556,130 @@ public enum Operations { } } } - /// Remove user as a collaborator + /// Get project for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific user-owned project. /// - /// - Remark: HTTP `DELETE /projects/{project_id}/collaborators/{username}`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)`. - public enum ProjectsRemoveCollaborator { - public static let id: Swift.String = "projects/remove-collaborator" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)`. + public enum ProjectsGetForUser { + public static let id: Swift.String = "projects/get-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/DELETE/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the project. + /// The project's number. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/DELETE/path/project_id`. - public var projectId: Components.Parameters.ProjectId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/DELETE/path/username`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/path/username`. public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: - /// - projectId: The unique identifier of the project. + /// - projectNumber: The project's number. /// - username: The handle for the GitHub user account. public init( - projectId: Components.Parameters.ProjectId, + projectNumber: Components.Parameters.ProjectNumber, username: Components.Parameters.Username ) { - self.projectId = projectId + self.projectNumber = projectNumber self.username = username } } - public var path: Operations.ProjectsRemoveCollaborator.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/DELETE/header`. + public var path: Operations.ProjectsGetForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsRemoveCollaborator.Input.Headers + public var headers: Operations.ProjectsGetForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ProjectsRemoveCollaborator.Input.Path, - headers: Operations.ProjectsRemoveCollaborator.Input.Headers = .init() + path: Operations.ProjectsGetForUser.Input.Path, + headers: Operations.ProjectsGetForUser.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsGetForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ProjectsV2 { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ProjectsGetForUser.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ProjectsGetForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetForUser.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.ProjectsRemoveCollaborator.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/responses/204`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsGetForUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.ProjectsRemoveCollaborator.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsGetForUser.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } @@ -6899,13 +7687,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -6928,32 +7716,9 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } /// Forbidden /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -6974,32 +7739,9 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/delete(projects/remove-collaborator)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/get(projects/get-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7051,77 +7793,123 @@ public enum Operations { } } } - /// Get project permission for a user + /// List project fields for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all fields for a specific user-owned project. /// - /// - Remark: HTTP `GET /projects/{project_id}/collaborators/{username}/permission`. - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)`. - public enum ProjectsGetPermissionForUser { - public static let id: Swift.String = "projects/get-permission-for-user" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)`. + public enum ProjectsListFieldsForUser { + public static let id: Swift.String = "projects/list-fields-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the project. + /// The project's number. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/path/project_id`. - public var projectId: Components.Parameters.ProjectId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/path/username`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/path/username`. public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: - /// - projectId: The unique identifier of the project. + /// - projectNumber: The project's number. /// - username: The handle for the GitHub user account. public init( - projectId: Components.Parameters.ProjectId, + projectNumber: Components.Parameters.ProjectNumber, username: Components.Parameters.Username ) { - self.projectId = projectId + self.projectNumber = projectNumber self.username = username } } - public var path: Operations.ProjectsGetPermissionForUser.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/header`. + public var path: Operations.ProjectsListFieldsForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// 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)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - 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)." + /// - 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil + ) { + self.perPage = perPage + self.before = before + self.after = after + } + } + public var query: Operations.ProjectsListFieldsForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsGetPermissionForUser.Input.Headers + public var headers: Operations.ProjectsListFieldsForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ProjectsGetPermissionForUser.Input.Path, - headers: Operations.ProjectsGetPermissionForUser.Input.Headers = .init() + path: Operations.ProjectsListFieldsForUser.Input.Path, + query: Operations.ProjectsListFieldsForUser.Input.Query = .init(), + headers: Operations.ProjectsListFieldsForUser.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/collaborators/{username}/permission/GET/responses/200/content/application\/json`. - case json(Components.Schemas.ProjectCollaboratorPermission) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2Field]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ProjectCollaboratorPermission { + public var json: [Components.Schemas.ProjectsV2Field] { get throws { switch self { case let .json(body): @@ -7131,26 +7919,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsGetPermissionForUser.Output.Ok.Body + public var body: Operations.ProjectsListFieldsForUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ProjectsGetPermissionForUser.Output.Ok.Body) { + public init( + headers: Operations.ProjectsListFieldsForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsListFieldsForUser.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsGetPermissionForUser.Output.Ok) + case ok(Operations.ProjectsListFieldsForUser.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsGetPermissionForUser.Output.Ok { + public var ok: Operations.ProjectsListFieldsForUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -7163,61 +7956,15 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Not modified /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -7242,7 +7989,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7265,7 +8012,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/{project_id}/collaborators/{username}/permission/get(projects/get-permission-for-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/get(projects/list-fields-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7317,89 +8064,76 @@ public enum Operations { } } } - /// List project columns + /// Get project field for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific field for a user-owned project. /// - /// - Remark: HTTP `GET /projects/{project_id}/columns`. - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)`. - public enum ProjectsListColumns { - public static let id: Swift.String = "projects/list-columns" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/fields/{field_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)`. + public enum ProjectsGetFieldForUser { + public static let id: Swift.String = "projects/get-field-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the project. + /// The project's number. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/path/project_id`. - public var projectId: Components.Parameters.ProjectId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - projectId: The unique identifier of the project. - public init(projectId: Components.Parameters.ProjectId) { - self.projectId = projectId - } - } - public var path: Operations.ProjectsListColumns.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). 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)." + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The unique identifier of the field. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/path/field_id`. + public var fieldId: Components.Parameters.FieldId + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. /// /// - Parameters: - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." + /// - projectNumber: The project's number. + /// - fieldId: The unique identifier of the field. + /// - username: The handle for the GitHub user account. public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + projectNumber: Components.Parameters.ProjectNumber, + fieldId: Components.Parameters.FieldId, + username: Components.Parameters.Username ) { - self.perPage = perPage - self.page = page + self.projectNumber = projectNumber + self.fieldId = fieldId + self.username = username } } - public var query: Operations.ProjectsListColumns.Input.Query - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/header`. + public var path: Operations.ProjectsGetFieldForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsListColumns.Input.Headers + public var headers: Operations.ProjectsGetFieldForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ProjectsListColumns.Input.Path, - query: Operations.ProjectsListColumns.Input.Query = .init(), - headers: Operations.ProjectsListColumns.Input.Headers = .init() + path: Operations.ProjectsGetFieldForUser.Input.Path, + headers: Operations.ProjectsGetFieldForUser.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -7410,16 +8144,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.ProjectsListColumns.Output.Ok.Headers - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/responses/200/content`. + public var headers: Operations.ProjectsGetFieldForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ProjectColumn]) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/fields/{field_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2Field) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.ProjectColumn] { + public var json: Components.Schemas.ProjectsV2Field { get throws { switch self { case let .json(body): @@ -7429,15 +8163,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsListColumns.Output.Ok.Body + public var body: Operations.ProjectsGetFieldForUser.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.ProjectsListColumns.Output.Ok.Headers = .init(), - body: Operations.ProjectsListColumns.Output.Ok.Body + headers: Operations.ProjectsGetFieldForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetFieldForUser.Output.Ok.Body ) { self.headers = headers self.body = body @@ -7445,15 +8179,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListColumns.Output.Ok) + case ok(Operations.ProjectsGetFieldForUser.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsListColumns.Output.Ok { + public var ok: Operations.ProjectsGetFieldForUser.Output.Ok { get throws { switch self { case let .ok(response): @@ -7468,13 +8202,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -7499,7 +8233,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7522,7 +8256,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/get(projects/list-columns)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/fields/{field_id}/get(projects/get-field-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7574,94 +8308,174 @@ public enum Operations { } } } - /// Create a project column + /// List items for a user owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// List all items for a specific user-owned project accessible by the authenticated user. /// - /// - Remark: HTTP `POST /projects/{project_id}/columns`. - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)`. - public enum ProjectsCreateColumn { - public static let id: Swift.String = "projects/create-column" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)`. + public enum ProjectsListItemsForUser { + public static let id: Swift.String = "projects/list-items-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/path`. public struct Path: Sendable, Hashable { - /// The unique identifier of the project. + /// The project's number. /// - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/path/project_id`. - public var projectId: Components.Parameters.ProjectId + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/path/username`. + public var username: Components.Parameters.Username /// Creates a new `Path`. /// /// - Parameters: - /// - projectId: The unique identifier of the project. - public init(projectId: Components.Parameters.ProjectId) { - self.projectId = projectId + /// - projectNumber: The project's number. + /// - username: The handle for the GitHub user account. + public init( + projectNumber: Components.Parameters.ProjectNumber, + username: Components.Parameters.Username + ) { + self.projectNumber = projectNumber + self.username = username + } + } + public var path: Operations.ProjectsListItemsForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query`. + public struct Query: Sendable, Hashable { + /// 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)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// 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)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/q`. + public var q: Swift.String? + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/fields`. + @frozen public enum FieldsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/fields/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/fields/case2`. + case case2([Swift.String]) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// + /// Example: `fields[]=123&fields[]=456&fields[]=789` or `fields=123,456,789` + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/query/fields`. + public var fields: Operations.ProjectsListItemsForUser.Input.Query.FieldsPayload? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - 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)." + /// - 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)." + /// - perPage: The number of results per page (max 100). 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)." + /// - q: Search query to filter items, see [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information. + /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + public init( + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil, + perPage: Components.Parameters.PerPage? = nil, + q: Swift.String? = nil, + fields: Operations.ProjectsListItemsForUser.Input.Query.FieldsPayload? = nil + ) { + self.before = before + self.after = after + self.perPage = perPage + self.q = q + self.fields = fields } } - public var path: Operations.ProjectsCreateColumn.Input.Path - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/header`. + public var query: Operations.ProjectsListItemsForUser.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsCreateColumn.Input.Headers - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Name of the project column - /// - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody/json/name`. - public var name: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: Name of the project column - public init(name: Swift.String) { - self.name = name - } - public enum CodingKeys: String, CodingKey { - case name - } - } - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsCreateColumn.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsCreateColumn.Input.Body + public var headers: Operations.ProjectsListItemsForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.ProjectsCreateColumn.Input.Path, - headers: Operations.ProjectsCreateColumn.Input.Headers = .init(), - body: Operations.ProjectsCreateColumn.Input.Body + path: Operations.ProjectsListItemsForUser.Input.Path, + query: Operations.ProjectsListItemsForUser.Input.Query = .init(), + headers: Operations.ProjectsListItemsForUser.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsListItemsForUser.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/projects/{project_id}/columns/POST/responses/201/content/application\/json`. - case json(Components.Schemas.ProjectColumn) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ProjectsV2ItemWithContent]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.ProjectColumn { + public var json: [Components.Schemas.ProjectsV2ItemWithContent] { get throws { switch self { case let .json(body): @@ -7671,33 +8485,38 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsCreateColumn.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.ProjectsListItemsForUser.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ProjectsCreateColumn.Output.Created.Body) { + public init( + headers: Operations.ProjectsListItemsForUser.Output.Ok.Headers = .init(), + body: Operations.ProjectsListItemsForUser.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)/responses/201`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsCreateColumn.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsListItemsForUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ProjectsCreateColumn.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsListItemsForUser.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } @@ -7705,13 +8524,13 @@ public enum Operations { } /// Not modified /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. case notModified(Components.Responses.NotModified) /// Not modified /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/304`. /// /// HTTP response code: `304 notModified`. public static var notModified: Self { @@ -7736,7 +8555,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7757,32 +8576,9 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Requires authentication /// - /// - Remark: Generated from `#/paths//projects/{project_id}/columns/post(projects/create-column)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/get(projects/list-items-for-user)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7834,131 +8630,118 @@ public enum Operations { } } } - /// List repository projects + /// Add item to user owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Add an issue or pull request item to the specified user owned project. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)`. - public enum ProjectsListForRepo { - public static let id: Swift.String = "projects/list-for-repo" + /// - Remark: HTTP `POST /users/{username}/projectsV2/{project_number}/items`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)`. + public enum ProjectsAddItemForUser { + public static let id: Swift.String = "projects/add-item-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/path`. public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/path/username`. + public var username: Components.Parameters.Username + /// The project's number. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/path/repo`. - public var repo: Components.Parameters.Repo + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber /// Creates a new `Path`. /// /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo - ) { - self.owner = owner - self.repo = repo - } - } - public var path: Operations.ProjectsListForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case closed = "closed" - case all = "all" - } - /// Indicates the state of the projects to return. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query/state`. - public var state: Operations.ProjectsListForRepo.Input.Query.StatePayload? - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - state: Indicates the state of the projects to return. - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." + /// - username: The handle for the GitHub user account. + /// - projectNumber: The project's number. public init( - state: Operations.ProjectsListForRepo.Input.Query.StatePayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + username: Components.Parameters.Username, + projectNumber: Components.Parameters.ProjectNumber ) { - self.state = state - self.perPage = perPage - self.page = page + self.username = username + self.projectNumber = projectNumber } } - public var query: Operations.ProjectsListForRepo.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/header`. + public var path: Operations.ProjectsAddItemForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsListForRepo.Input.Headers + public var headers: Operations.ProjectsAddItemForUser.Input.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The type of item to add to the project. Must be either Issue or PullRequest. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case issue = "Issue" + case pullRequest = "PullRequest" + } + /// The type of item to add to the project. Must be either Issue or PullRequest. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/type`. + public var _type: Operations.ProjectsAddItemForUser.Input.Body.JsonPayload._TypePayload + /// The numeric ID of the issue or pull request to add to the project. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/json/id`. + public var id: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - _type: The type of item to add to the project. Must be either Issue or PullRequest. + /// - id: The numeric ID of the issue or pull request to add to the project. + public init( + _type: Operations.ProjectsAddItemForUser.Input.Body.JsonPayload._TypePayload, + id: Swift.Int + ) { + self._type = _type + self.id = id + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case id + } + } + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/requestBody/content/application\/json`. + case json(Operations.ProjectsAddItemForUser.Input.Body.JsonPayload) + } + public var body: Operations.ProjectsAddItemForUser.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.ProjectsListForRepo.Input.Path, - query: Operations.ProjectsListForRepo.Input.Query = .init(), - headers: Operations.ProjectsListForRepo.Input.Headers = .init() + path: Operations.ProjectsAddItemForUser.Input.Path, + headers: Operations.ProjectsAddItemForUser.Input.Headers = .init(), + body: Operations.ProjectsAddItemForUser.Input.Body ) { self.path = path - self.query = query - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ProjectsListForRepo.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/responses/200/content`. + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Project]) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/POST/responses/201/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemSimple) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Project] { + public var json: Components.Schemas.ProjectsV2ItemSimple { get throws { switch self { case let .json(body): @@ -7968,61 +8751,64 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsListForRepo.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.ProjectsAddItemForUser.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListForRepo.Output.Ok.Headers = .init(), - body: Operations.ProjectsListForRepo.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.ProjectsAddItemForUser.Output.Created.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListForRepo.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.ProjectsAddItemForUser.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsListForRepo.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.ProjectsAddItemForUser.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } } } - /// Requires authentication + /// Not modified /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/304`. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { get throws { switch self { - case let .unauthorized(response): + case let .notModified(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "notModified", response: self ) } @@ -8030,7 +8816,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -8051,70 +8837,24 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Gone - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)/responses/410`. - /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. - /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { - get throws { - switch self { - case let .gone(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "gone", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. + /// Requires authentication /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/get(projects/list-for-repo)/responses/422`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/post(projects/add-item-for-user)/responses/401`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { get throws { switch self { - case let .unprocessableContent(response): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "unauthorized", response: self ) } @@ -8151,113 +8891,151 @@ public enum Operations { } } } - /// Create a repository project + /// Get an item for a user owned project /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Get a specific item from a user-owned project. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/projects`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)`. - public enum ProjectsCreateForRepo { - public static let id: Swift.String = "projects/create-for-repo" + /// - Remark: HTTP `GET /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)`. + public enum ProjectsGetUserItem { + public static let id: Swift.String = "projects/get-user-item" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/path`. public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. + /// The project's number. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/path/username`. + public var username: Components.Parameters.Username + /// The unique identifier of the project item. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/path/repo`. - public var repo: Components.Parameters.Repo + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/path/item_id`. + public var itemId: Components.Parameters.ItemId /// Creates a new `Path`. /// /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - projectNumber: The project's number. + /// - username: The handle for the GitHub user account. + /// - itemId: The unique identifier of the project item. public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo + projectNumber: Components.Parameters.ProjectNumber, + username: Components.Parameters.Username, + itemId: Components.Parameters.ItemId ) { - self.owner = owner - self.repo = repo + self.projectNumber = projectNumber + self.username = username + self.itemId = itemId + } + } + public var path: Operations.ProjectsGetUserItem.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/query/fields`. + @frozen public enum FieldsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/query/fields/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/query/fields/case2`. + case case2([Swift.String]) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + /// + /// Example: fields[]=123&fields[]=456&fields[]=789 or fields=123,456,789 + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/query/fields`. + public var fields: Operations.ProjectsGetUserItem.Input.Query.FieldsPayload? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - fields: Limit results to specific fields, by their IDs. If not specified, the title field will be returned. + public init(fields: Operations.ProjectsGetUserItem.Input.Query.FieldsPayload? = nil) { + self.fields = fields } } - public var path: Operations.ProjectsCreateForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/header`. + public var query: Operations.ProjectsGetUserItem.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsCreateForRepo.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The name of the project. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/json/name`. - public var name: Swift.String - /// The description of the project. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/json/body`. - public var body: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: The name of the project. - /// - body: The description of the project. - public init( - name: Swift.String, - body: Swift.String? = nil - ) { - self.name = name - self.body = body - } - public enum CodingKeys: String, CodingKey { - case name - case body - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsCreateForRepo.Input.Body.JsonPayload) - } - public var body: Operations.ProjectsCreateForRepo.Input.Body + public var headers: Operations.ProjectsGetUserItem.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.ProjectsCreateForRepo.Input.Path, - headers: Operations.ProjectsCreateForRepo.Input.Headers = .init(), - body: Operations.ProjectsCreateForRepo.Input.Body + path: Operations.ProjectsGetUserItem.Input.Path, + query: Operations.ProjectsGetUserItem.Input.Query = .init(), + headers: Operations.ProjectsGetUserItem.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.ProjectsGetUserItem.Output.Ok.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/projects/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Project) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemWithContent) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Project { + public var json: Components.Schemas.ProjectsV2ItemWithContent { get throws { switch self { case let .json(body): @@ -8267,148 +9045,115 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsCreateForRepo.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.ProjectsGetUserItem.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.ProjectsCreateForRepo.Output.Created.Body) { + public init( + headers: Operations.ProjectsGetUserItem.Output.Ok.Headers = .init(), + body: Operations.ProjectsGetUserItem.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)/responses/201`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsCreateForRepo.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsGetUserItem.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ProjectsCreateForRepo.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsGetUserItem.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } } } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// Not modified /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } - /// Forbidden + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/304`. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)/responses/403`. + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/304`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// The associated value of the enum case if `self` is `.notModified`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { get throws { switch self { - case let .notFound(response): + case let .notModified(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "notModified", response: self ) } } } - /// Gone + /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)/responses/410`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/403`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .gone(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "forbidden", response: self ) } } } - /// Validation failed, or the endpoint has been spammed. + /// Requires authentication /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/projects/post(projects/create-for-repo)/responses/422`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/get(projects/get-user-item)/responses/401`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { get throws { switch self { - case let .unprocessableContent(response): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "unauthorized", response: self ) } @@ -8445,86 +9190,182 @@ public enum Operations { } } } - /// Create a user project + /// Update project item for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Update a specific item in a user-owned project. /// - /// - Remark: HTTP `POST /user/projects`. - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)`. - public enum ProjectsCreateForAuthenticatedUser { - public static let id: Swift.String = "projects/create-for-authenticated-user" + /// - Remark: HTTP `PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)`. + public enum ProjectsUpdateItemForUser { + public static let id: Swift.String = "projects/update-item-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/user/projects/POST/header`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/path/username`. + public var username: Components.Parameters.Username + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/path/item_id`. + public var itemId: Components.Parameters.ItemId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - projectNumber: The project's number. + /// - username: The handle for the GitHub user account. + /// - itemId: The unique identifier of the project item. + public init( + projectNumber: Components.Parameters.ProjectNumber, + username: Components.Parameters.Username, + itemId: Components.Parameters.ItemId + ) { + self.projectNumber = projectNumber + self.username = username + self.itemId = itemId + } + } + public var path: Operations.ProjectsUpdateItemForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsCreateForAuthenticatedUser.Input.Headers - /// - Remark: Generated from `#/paths/user/projects/POST/requestBody`. + public var headers: Operations.ProjectsUpdateItemForUser.Input.Headers + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// Name of the project + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload`. + public struct FieldsPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the project field to update. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/id`. + public var id: Swift.Int + /// The new value for the field: + /// - For text, number, and date fields, provide the new value directly. + /// - For single select and iteration fields, provide the ID of the option or iteration. + /// - To clear the field, set this to null. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value/case2`. + case case2(Swift.Double) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The new value for the field: + /// - For text, number, and date fields, provide the new value directly. + /// - For single select and iteration fields, provide the ID of the option or iteration. + /// - To clear the field, set this to null. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/FieldsPayload/value`. + public var value: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? + /// Creates a new `FieldsPayloadPayload`. + /// + /// - Parameters: + /// - id: The ID of the project field to update. + /// - value: The new value for the field: + public init( + id: Swift.Int, + value: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload.ValuePayload? = nil + ) { + self.id = id + self.value = value + } + public enum CodingKeys: String, CodingKey { + case id + case value + } + } + /// A list of field updates to apply. /// - /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/json/name`. - public var name: Swift.String - /// Body of the project + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. + public typealias FieldsPayload = [Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayloadPayload] + /// A list of field updates to apply. /// - /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/json/body`. - public var body: Swift.String? + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/json/fields`. + public var fields: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayload /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - name: Name of the project - /// - body: Body of the project - public init( - name: Swift.String, - body: Swift.String? = nil - ) { - self.name = name - self.body = body + /// - fields: A list of field updates to apply. + public init(fields: Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload.FieldsPayload) { + self.fields = fields } public enum CodingKeys: String, CodingKey { - case name - case body + case fields } } - /// - Remark: Generated from `#/paths/user/projects/POST/requestBody/content/application\/json`. - case json(Operations.ProjectsCreateForAuthenticatedUser.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.ProjectsUpdateItemForUser.Input.Body.JsonPayload) } - public var body: Operations.ProjectsCreateForAuthenticatedUser.Input.Body + public var body: Operations.ProjectsUpdateItemForUser.Input.Body /// Creates a new `Input`. /// /// - Parameters: + /// - path: /// - headers: /// - body: public init( - headers: Operations.ProjectsCreateForAuthenticatedUser.Input.Headers = .init(), - body: Operations.ProjectsCreateForAuthenticatedUser.Input.Body + path: Operations.ProjectsUpdateItemForUser.Input.Path, + headers: Operations.ProjectsUpdateItemForUser.Input.Headers = .init(), + body: Operations.ProjectsUpdateItemForUser.Input.Body ) { + self.path = path self.headers = headers self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/user/projects/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/user/projects/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Project) + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.ProjectsV2ItemWithContent) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Project { + public var json: Components.Schemas.ProjectsV2ItemWithContent { get throws { switch self { case let .json(body): @@ -8534,64 +9375,56 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ProjectsCreateForAuthenticatedUser.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.ProjectsUpdateItemForUser.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ProjectsCreateForAuthenticatedUser.Output.Created.Body) { + public init(body: Operations.ProjectsUpdateItemForUser.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)/responses/201`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.ProjectsCreateForAuthenticatedUser.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.ProjectsUpdateItemForUser.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.ProjectsCreateForAuthenticatedUser.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ProjectsUpdateItemForUser.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } } } - /// Not modified - /// - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified + /// Requires authentication /// - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)/responses/304`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/401`. /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// The associated value of the enum case if `self` is `.notModified`. + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { get throws { switch self { - case let .notModified(response): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notModified", + expectedStatus: "unauthorized", response: self ) } @@ -8599,7 +9432,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)/responses/403`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -8620,24 +9453,24 @@ public enum Operations { } } } - /// Requires authentication + /// Resource not found /// - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)/responses/401`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/404`. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unauthorized(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "notFound", response: self ) } @@ -8645,15 +9478,15 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//user/projects/post(projects/create-for-authenticated-user)/responses/422`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/patch(projects/update-item-for-user)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) + case unprocessableContent(Components.Responses.ValidationFailed) /// The associated value of the enum case if `self` is `.unprocessableContent`. /// /// - Throws: An error if `self` is not `.unprocessableContent`. /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { case let .unprocessableContent(response): @@ -8697,186 +9530,148 @@ public enum Operations { } } } - /// List user projects + /// Delete project item for user /// - /// > [!WARNING] - /// > **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience. - /// > See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information. + /// Delete a specific item from a user-owned project. /// - /// - Remark: HTTP `GET /users/{username}/projects`. - /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)`. - public enum ProjectsListForUser { - public static let id: Swift.String = "projects/list-for-user" + /// - Remark: HTTP `DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)`. + public enum ProjectsDeleteItemForUser { + public static let id: Swift.String = "projects/delete-item-for-user" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/path`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path`. public struct Path: Sendable, Hashable { + /// The project's number. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path/project_number`. + public var projectNumber: Components.Parameters.ProjectNumber /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/path/username`. + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path/username`. public var username: Components.Parameters.Username + /// The unique identifier of the project item. + /// + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/path/item_id`. + public var itemId: Components.Parameters.ItemId /// Creates a new `Path`. /// /// - Parameters: + /// - projectNumber: The project's number. /// - username: The handle for the GitHub user account. - public init(username: Components.Parameters.Username) { - self.username = username - } - } - public var path: Operations.ProjectsListForUser.Input.Path - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case closed = "closed" - case all = "all" - } - /// Indicates the state of the projects to return. - /// - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query/state`. - public var state: Operations.ProjectsListForUser.Input.Query.StatePayload? - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - state: Indicates the state of the projects to return. - /// - perPage: The number of results per page (max 100). 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)." - /// - page: The page number of the results to fetch. 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)." + /// - itemId: The unique identifier of the project item. public init( - state: Operations.ProjectsListForUser.Input.Query.StatePayload? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + projectNumber: Components.Parameters.ProjectNumber, + username: Components.Parameters.Username, + itemId: Components.Parameters.ItemId ) { - self.state = state - self.perPage = perPage - self.page = page + self.projectNumber = projectNumber + self.username = username + self.itemId = itemId } } - public var query: Operations.ProjectsListForUser.Input.Query - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/header`. + public var path: Operations.ProjectsDeleteItemForUser.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/projectsV2/{project_number}/items/{item_id}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ProjectsListForUser.Input.Headers + public var headers: Operations.ProjectsDeleteItemForUser.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ProjectsListForUser.Input.Path, - query: Operations.ProjectsListForUser.Input.Query = .init(), - headers: Operations.ProjectsListForUser.Input.Headers = .init() + path: Operations.ProjectsDeleteItemForUser.Input.Path, + headers: Operations.ProjectsDeleteItemForUser.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.ProjectsListForUser.Output.Ok.Headers - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/users/{username}/projects/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Project]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Project] { - get throws { - switch self { - case let .json(body): - return body - } - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.ProjectsDeleteItemForUser.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.ProjectsDeleteItemForUser.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.ProjectsListForUser.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.ProjectsListForUser.Output.Ok.Headers = .init(), - body: Operations.ProjectsListForUser.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } } - /// Response + /// Forbidden /// - /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)/responses/200`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/403`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ProjectsListForUser.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ProjectsListForUser.Output.Ok { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .ok(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "forbidden", response: self ) } } } - /// Validation failed, or the endpoint has been spammed. + /// Requires authentication /// - /// - Remark: Generated from `#/paths//users/{username}/projects/get(projects/list-for-user)/responses/422`. + /// - Remark: Generated from `#/paths//users/{username}/projectsV2/{project_number}/items/{item_id}/delete(projects/delete-item-for-user)/responses/401`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { get throws { switch self { - case let .unprocessableContent(response): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "unauthorized", response: self ) } diff --git a/Sources/pulls/Types.swift b/Sources/pulls/Types.swift index 3f02eee3145..6cdfe0b457d 100644 --- a/Sources/pulls/Types.swift +++ b/Sources/pulls/Types.swift @@ -1949,6 +1949,35 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/anonymous_access_enabled`. public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? /// Creates a new `Repository`. /// /// - Parameters: @@ -2047,6 +2076,7 @@ public enum Components { /// - masterBranch: /// - starredAt: /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository public init( id: Swift.Int64, nodeId: Swift.String, @@ -2142,7 +2172,8 @@ public enum Components { watchers: Swift.Int, masterBranch: Swift.String? = nil, starredAt: Swift.String? = nil, - anonymousAccessEnabled: Swift.Bool? = nil + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -2239,6 +2270,7 @@ public enum Components { self.masterBranch = masterBranch self.starredAt = starredAt self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus } public enum CodingKeys: String, CodingKey { case id @@ -2336,6 +2368,7 @@ public enum Components { case masterBranch = "master_branch" case starredAt = "starred_at" case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" } } /// A collection of related issues and pull requests. @@ -2600,6 +2633,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -2616,6 +2668,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -2629,7 +2684,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -2644,6 +2702,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -2659,6 +2720,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -2732,6 +2796,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -2750,6 +2833,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -2765,6 +2851,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -2780,6 +2869,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -2796,6 +2888,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -2845,6 +2940,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-simple/type`. + public var _type: Components.Schemas.TeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `TeamSimple`. /// /// - Parameters: @@ -2861,6 +2975,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -2874,7 +2991,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.TeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -2889,6 +3009,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -2904,947 +3027,950 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } - /// Metaproperties for Git author/committer information. + /// Hypermedia Link /// - /// - Remark: Generated from `#/components/schemas/nullable-git-user`. - public struct NullableGitUser: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/nullable-git-user/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-git-user/email`. - public var email: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-git-user/date`. - public var date: Swift.String? - /// Creates a new `NullableGitUser`. - /// - /// - Parameters: - /// - name: - /// - email: - /// - date: - public init( - name: Swift.String? = nil, - email: Swift.String? = nil, - date: Swift.String? = nil - ) { - self.name = name - self.email = email - self.date = date - } - public enum CodingKeys: String, CodingKey { - case name - case email - case date - } - } - /// - Remark: Generated from `#/components/schemas/verification`. - public struct Verification: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/verification/verified`. - public var verified: Swift.Bool - /// - Remark: Generated from `#/components/schemas/verification/reason`. - public var reason: Swift.String - /// - Remark: Generated from `#/components/schemas/verification/payload`. - public var payload: Swift.String? - /// - Remark: Generated from `#/components/schemas/verification/signature`. - public var signature: Swift.String? - /// - Remark: Generated from `#/components/schemas/verification/verified_at`. - public var verifiedAt: Swift.String? - /// Creates a new `Verification`. + /// - Remark: Generated from `#/components/schemas/link`. + public struct Link: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/link/href`. + public var href: Swift.String + /// Creates a new `Link`. /// /// - Parameters: - /// - verified: - /// - reason: - /// - payload: - /// - signature: - /// - verifiedAt: - public init( - verified: Swift.Bool, - reason: Swift.String, - payload: Swift.String? = nil, - signature: Swift.String? = nil, - verifiedAt: Swift.String? = nil - ) { - self.verified = verified - self.reason = reason - self.payload = payload - self.signature = signature - self.verifiedAt = verifiedAt + /// - href: + public init(href: Swift.String) { + self.href = href } public enum CodingKeys: String, CodingKey { - case verified - case reason - case payload - case signature - case verifiedAt = "verified_at" + case href } } - /// Diff Entry + /// The status of auto merging a pull request. /// - /// - Remark: Generated from `#/components/schemas/diff-entry`. - public struct DiffEntry: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/diff-entry/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/diff-entry/filename`. - public var filename: Swift.String - /// - Remark: Generated from `#/components/schemas/diff-entry/status`. - @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { - case added = "added" - case removed = "removed" - case modified = "modified" - case renamed = "renamed" - case copied = "copied" - case changed = "changed" - case unchanged = "unchanged" + /// - Remark: Generated from `#/components/schemas/auto-merge`. + public struct AutoMerge: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/auto-merge/enabled_by`. + public var enabledBy: Components.Schemas.SimpleUser + /// The merge method to use. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + @frozen public enum MergeMethodPayload: String, Codable, Hashable, Sendable, CaseIterable { + case merge = "merge" + case squash = "squash" + case rebase = "rebase" } - /// - Remark: Generated from `#/components/schemas/diff-entry/status`. - public var status: Components.Schemas.DiffEntry.StatusPayload - /// - Remark: Generated from `#/components/schemas/diff-entry/additions`. - public var additions: Swift.Int - /// - Remark: Generated from `#/components/schemas/diff-entry/deletions`. - public var deletions: Swift.Int - /// - Remark: Generated from `#/components/schemas/diff-entry/changes`. - public var changes: Swift.Int - /// - Remark: Generated from `#/components/schemas/diff-entry/blob_url`. - public var blobUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/diff-entry/raw_url`. - public var rawUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/diff-entry/contents_url`. - public var contentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/diff-entry/patch`. - public var patch: Swift.String? - /// - Remark: Generated from `#/components/schemas/diff-entry/previous_filename`. - public var previousFilename: Swift.String? - /// Creates a new `DiffEntry`. + /// The merge method to use. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + public var mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload + /// Title for the merge commit message. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_title`. + public var commitTitle: Swift.String + /// Commit message for the merge commit. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_message`. + public var commitMessage: Swift.String + /// Creates a new `AutoMerge`. /// /// - Parameters: - /// - sha: - /// - filename: - /// - status: - /// - additions: - /// - deletions: - /// - changes: - /// - blobUrl: - /// - rawUrl: - /// - contentsUrl: - /// - patch: - /// - previousFilename: + /// - enabledBy: + /// - mergeMethod: The merge method to use. + /// - commitTitle: Title for the merge commit message. + /// - commitMessage: Commit message for the merge commit. public init( - sha: Swift.String, - filename: Swift.String, - status: Components.Schemas.DiffEntry.StatusPayload, - additions: Swift.Int, - deletions: Swift.Int, - changes: Swift.Int, - blobUrl: Swift.String, - rawUrl: Swift.String, - contentsUrl: Swift.String, - patch: Swift.String? = nil, - previousFilename: Swift.String? = nil + enabledBy: Components.Schemas.SimpleUser, + mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload, + commitTitle: Swift.String, + commitMessage: Swift.String ) { - self.sha = sha - self.filename = filename - self.status = status - self.additions = additions - self.deletions = deletions - self.changes = changes - self.blobUrl = blobUrl - self.rawUrl = rawUrl - self.contentsUrl = contentsUrl - self.patch = patch - self.previousFilename = previousFilename + self.enabledBy = enabledBy + self.mergeMethod = mergeMethod + self.commitTitle = commitTitle + self.commitMessage = commitMessage } public enum CodingKeys: String, CodingKey { - case sha - case filename - case status - case additions - case deletions - case changes - case blobUrl = "blob_url" - case rawUrl = "raw_url" - case contentsUrl = "contents_url" - case patch - case previousFilename = "previous_filename" + case enabledBy = "enabled_by" + case mergeMethod = "merge_method" + case commitTitle = "commit_title" + case commitMessage = "commit_message" } } - /// Commit + /// Pull Request Simple /// - /// - Remark: Generated from `#/components/schemas/commit`. - public struct Commit: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/url`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple`. + public struct PullRequestSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/node_id`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-simple/node_id`. public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/html_url`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/html_url`. public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/comments_url`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/diff_url`. + public var diffUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/patch_url`. + public var patchUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/issue_url`. + public var issueUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/commits_url`. + public var commitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comments_url`. + public var reviewCommentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comment_url`. + public var reviewCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/comments_url`. public var commentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/commit`. - public struct CommitPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/commit/url`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-simple/state`. + public var state: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/locked`. + public var locked: Swift.Bool + /// - Remark: Generated from `#/components/schemas/pull-request-simple/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload`. + public struct LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/commit/author`. - public var author: Components.Schemas.NullableGitUser? - /// - Remark: Generated from `#/components/schemas/commit/commit/committer`. - public var committer: Components.Schemas.NullableGitUser? - /// - Remark: Generated from `#/components/schemas/commit/commit/message`. - public var message: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/commit/comment_count`. - public var commentCount: Swift.Int - /// - Remark: Generated from `#/components/schemas/commit/commit/tree`. - public struct TreePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/commit/tree/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/commit/tree/url`. - public var url: Swift.String - /// Creates a new `TreePayload`. - /// - /// - Parameters: - /// - sha: - /// - url: - public init( - sha: Swift.String, - url: Swift.String - ) { - self.sha = sha - self.url = url - } - public enum CodingKeys: String, CodingKey { - case sha - case url - } - } - /// - Remark: Generated from `#/components/schemas/commit/commit/tree`. - public var tree: Components.Schemas.Commit.CommitPayload.TreePayload - /// - Remark: Generated from `#/components/schemas/commit/commit/verification`. - public var verification: Components.Schemas.Verification? - /// Creates a new `CommitPayload`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/description`. + public var description: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/color`. + public var color: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/default`. + public var _default: Swift.Bool + /// Creates a new `LabelsPayloadPayload`. /// /// - Parameters: + /// - id: + /// - nodeId: /// - url: - /// - author: - /// - committer: - /// - message: - /// - commentCount: - /// - tree: - /// - verification: + /// - name: + /// - description: + /// - color: + /// - _default: public init( + id: Swift.Int64, + nodeId: Swift.String, url: Swift.String, - author: Components.Schemas.NullableGitUser? = nil, - committer: Components.Schemas.NullableGitUser? = nil, - message: Swift.String, - commentCount: Swift.Int, - tree: Components.Schemas.Commit.CommitPayload.TreePayload, - verification: Components.Schemas.Verification? = nil + name: Swift.String, + description: Swift.String, + color: Swift.String, + _default: Swift.Bool ) { + self.id = id + self.nodeId = nodeId self.url = url - self.author = author - self.committer = committer - self.message = message - self.commentCount = commentCount - self.tree = tree - self.verification = verification + self.name = name + self.description = description + self.color = color + self._default = _default } public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" case url - case author - case committer - case message - case commentCount = "comment_count" - case tree - case verification - } - } - /// - Remark: Generated from `#/components/schemas/commit/commit`. - public var commit: Components.Schemas.Commit.CommitPayload - /// - Remark: Generated from `#/components/schemas/commit/author`. - @frozen public enum AuthorPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/author/case1`. - case SimpleUser(Components.Schemas.SimpleUser) - /// - Remark: Generated from `#/components/schemas/commit/author/case2`. - case EmptyObject(Components.Schemas.EmptyObject) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .SimpleUser(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .EmptyObject(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .SimpleUser(value): - try value.encode(to: encoder) - case let .EmptyObject(value): - try value.encode(to: encoder) - } - } - } - /// - Remark: Generated from `#/components/schemas/commit/author`. - public var author: Components.Schemas.Commit.AuthorPayload? - /// - Remark: Generated from `#/components/schemas/commit/committer`. - @frozen public enum CommitterPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/committer/case1`. - case SimpleUser(Components.Schemas.SimpleUser) - /// - Remark: Generated from `#/components/schemas/commit/committer/case2`. - case EmptyObject(Components.Schemas.EmptyObject) - public init(from decoder: any Decoder) throws { - var errors: [any Error] = [] - do { - self = .SimpleUser(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .EmptyObject(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Encoder) throws { - switch self { - case let .SimpleUser(value): - try value.encode(to: encoder) - case let .EmptyObject(value): - try value.encode(to: encoder) - } + case name + case description + case color + case _default = "default" } } - /// - Remark: Generated from `#/components/schemas/commit/committer`. - public var committer: Components.Schemas.Commit.CommitterPayload? - /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload`. - public struct ParentsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/sha`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public typealias LabelsPayload = [Components.Schemas.PullRequestSimple.LabelsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public var labels: Components.Schemas.PullRequestSimple.LabelsPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/milestone`. + public var milestone: Components.Schemas.NullableMilestone? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/active_lock_reason`. + public var activeLockReason: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/closed_at`. + public var closedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merged_at`. + public var mergedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merge_commit_sha`. + public var mergeCommitSha: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignee`. + public var assignee: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_reviewers`. + public var requestedReviewers: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_teams`. + public var requestedTeams: [Components.Schemas.Team]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public struct HeadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/sha`. public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/html_url`. - public var htmlUrl: Swift.String? - /// Creates a new `ParentsPayloadPayload`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `HeadPayload`. /// /// - Parameters: + /// - label: + /// - ref: + /// - repo: /// - sha: - /// - url: - /// - htmlUrl: + /// - user: public init( + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, sha: Swift.String, - url: Swift.String, - htmlUrl: Swift.String? = nil + user: Components.Schemas.NullableSimpleUser? = nil ) { + self.label = label + self.ref = ref + self.repo = repo self.sha = sha - self.url = url - self.htmlUrl = htmlUrl + self.user = user } public enum CodingKeys: String, CodingKey { + case label + case ref + case repo case sha - case url - case htmlUrl = "html_url" + case user } } - /// - Remark: Generated from `#/components/schemas/commit/parents`. - public typealias ParentsPayload = [Components.Schemas.Commit.ParentsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/commit/parents`. - public var parents: Components.Schemas.Commit.ParentsPayload - /// - Remark: Generated from `#/components/schemas/commit/stats`. - public struct StatsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit/stats/additions`. - public var additions: Swift.Int? - /// - Remark: Generated from `#/components/schemas/commit/stats/deletions`. - public var deletions: Swift.Int? - /// - Remark: Generated from `#/components/schemas/commit/stats/total`. - public var total: Swift.Int? - /// Creates a new `StatsPayload`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public var head: Components.Schemas.PullRequestSimple.HeadPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `BasePayload`. /// /// - Parameters: - /// - additions: - /// - deletions: - /// - total: + /// - label: + /// - ref: + /// - repo: + /// - sha: + /// - user: public init( - additions: Swift.Int? = nil, - deletions: Swift.Int? = nil, - total: Swift.Int? = nil + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, + sha: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil ) { - self.additions = additions - self.deletions = deletions - self.total = total + self.label = label + self.ref = ref + self.repo = repo + self.sha = sha + self.user = user } public enum CodingKeys: String, CodingKey { - case additions - case deletions - case total + case label + case ref + case repo + case sha + case user } } - /// - Remark: Generated from `#/components/schemas/commit/stats`. - public var stats: Components.Schemas.Commit.StatsPayload? - /// - Remark: Generated from `#/components/schemas/commit/files`. - public var files: [Components.Schemas.DiffEntry]? - /// Creates a new `Commit`. + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public var base: Components.Schemas.PullRequestSimple.BasePayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public struct _LinksPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/comments`. + public var comments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/commits`. + public var commits: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/statuses`. + public var statuses: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/html`. + public var html: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/issue`. + public var issue: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comments`. + public var reviewComments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comment`. + public var reviewComment: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/self`. + public var _self: Components.Schemas.Link + /// Creates a new `_LinksPayload`. + /// + /// - Parameters: + /// - comments: + /// - commits: + /// - statuses: + /// - html: + /// - issue: + /// - reviewComments: + /// - reviewComment: + /// - _self: + public init( + comments: Components.Schemas.Link, + commits: Components.Schemas.Link, + statuses: Components.Schemas.Link, + html: Components.Schemas.Link, + issue: Components.Schemas.Link, + reviewComments: Components.Schemas.Link, + reviewComment: Components.Schemas.Link, + _self: Components.Schemas.Link + ) { + self.comments = comments + self.commits = commits + self.statuses = statuses + self.html = html + self.issue = issue + self.reviewComments = reviewComments + self.reviewComment = reviewComment + self._self = _self + } + public enum CodingKeys: String, CodingKey { + case comments + case commits + case statuses + case html + case issue + case reviewComments = "review_comments" + case reviewComment = "review_comment" + case _self = "self" + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public var _links: Components.Schemas.PullRequestSimple._LinksPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation + /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. + public var autoMerge: Components.Schemas.AutoMerge? + /// Indicates whether or not the pull request is a draft. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. + public var draft: Swift.Bool? + /// Creates a new `PullRequestSimple`. /// /// - Parameters: /// - url: - /// - sha: + /// - id: /// - nodeId: /// - htmlUrl: + /// - diffUrl: + /// - patchUrl: + /// - issueUrl: + /// - commitsUrl: + /// - reviewCommentsUrl: + /// - reviewCommentUrl: /// - commentsUrl: - /// - commit: - /// - author: - /// - committer: - /// - parents: - /// - stats: - /// - files: + /// - statusesUrl: + /// - number: + /// - state: + /// - locked: + /// - title: + /// - user: + /// - body: + /// - labels: + /// - milestone: + /// - activeLockReason: + /// - createdAt: + /// - updatedAt: + /// - closedAt: + /// - mergedAt: + /// - mergeCommitSha: + /// - assignee: + /// - assignees: + /// - requestedReviewers: + /// - requestedTeams: + /// - head: + /// - base: + /// - _links: + /// - authorAssociation: + /// - autoMerge: + /// - draft: Indicates whether or not the pull request is a draft. public init( url: Swift.String, - sha: Swift.String, + id: Swift.Int64, nodeId: Swift.String, htmlUrl: Swift.String, + diffUrl: Swift.String, + patchUrl: Swift.String, + issueUrl: Swift.String, + commitsUrl: Swift.String, + reviewCommentsUrl: Swift.String, + reviewCommentUrl: Swift.String, commentsUrl: Swift.String, - commit: Components.Schemas.Commit.CommitPayload, - author: Components.Schemas.Commit.AuthorPayload? = nil, - committer: Components.Schemas.Commit.CommitterPayload? = nil, - parents: Components.Schemas.Commit.ParentsPayload, - stats: Components.Schemas.Commit.StatsPayload? = nil, - files: [Components.Schemas.DiffEntry]? = nil + statusesUrl: Swift.String, + number: Swift.Int, + state: Swift.String, + locked: Swift.Bool, + title: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil, + body: Swift.String? = nil, + labels: Components.Schemas.PullRequestSimple.LabelsPayload, + milestone: Components.Schemas.NullableMilestone? = nil, + activeLockReason: Swift.String? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + closedAt: Foundation.Date? = nil, + mergedAt: Foundation.Date? = nil, + mergeCommitSha: Swift.String? = nil, + assignee: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil, + requestedReviewers: [Components.Schemas.SimpleUser]? = nil, + requestedTeams: [Components.Schemas.Team]? = nil, + head: Components.Schemas.PullRequestSimple.HeadPayload, + base: Components.Schemas.PullRequestSimple.BasePayload, + _links: Components.Schemas.PullRequestSimple._LinksPayload, + authorAssociation: Components.Schemas.AuthorAssociation, + autoMerge: Components.Schemas.AutoMerge? = nil, + draft: Swift.Bool? = nil ) { self.url = url - self.sha = sha + self.id = id self.nodeId = nodeId self.htmlUrl = htmlUrl + self.diffUrl = diffUrl + self.patchUrl = patchUrl + self.issueUrl = issueUrl + self.commitsUrl = commitsUrl + self.reviewCommentsUrl = reviewCommentsUrl + self.reviewCommentUrl = reviewCommentUrl self.commentsUrl = commentsUrl - self.commit = commit - self.author = author - self.committer = committer - self.parents = parents - self.stats = stats - self.files = files - } - public enum CodingKeys: String, CodingKey { - case url - case sha - case nodeId = "node_id" - case htmlUrl = "html_url" - case commentsUrl = "comments_url" - case commit - case author - case committer - case parents - case stats - case files - } - } - /// Hypermedia Link - /// - /// - Remark: Generated from `#/components/schemas/link`. - public struct Link: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/link/href`. - public var href: Swift.String - /// Creates a new `Link`. - /// - /// - Parameters: - /// - href: - public init(href: Swift.String) { - self.href = href + self.statusesUrl = statusesUrl + self.number = number + self.state = state + self.locked = locked + self.title = title + self.user = user + self.body = body + self.labels = labels + self.milestone = milestone + self.activeLockReason = activeLockReason + self.createdAt = createdAt + self.updatedAt = updatedAt + self.closedAt = closedAt + self.mergedAt = mergedAt + self.mergeCommitSha = mergeCommitSha + self.assignee = assignee + self.assignees = assignees + self.requestedReviewers = requestedReviewers + self.requestedTeams = requestedTeams + self.head = head + self.base = base + self._links = _links + self.authorAssociation = authorAssociation + self.autoMerge = autoMerge + self.draft = draft } public enum CodingKeys: String, CodingKey { - case href + case url + case id + case nodeId = "node_id" + case htmlUrl = "html_url" + case diffUrl = "diff_url" + case patchUrl = "patch_url" + case issueUrl = "issue_url" + case commitsUrl = "commits_url" + case reviewCommentsUrl = "review_comments_url" + case reviewCommentUrl = "review_comment_url" + case commentsUrl = "comments_url" + case statusesUrl = "statuses_url" + case number + case state + case locked + case title + case user + case body + case labels + case milestone + case activeLockReason = "active_lock_reason" + case createdAt = "created_at" + case updatedAt = "updated_at" + case closedAt = "closed_at" + case mergedAt = "merged_at" + case mergeCommitSha = "merge_commit_sha" + case assignee + case assignees + case requestedReviewers = "requested_reviewers" + case requestedTeams = "requested_teams" + case head + case base + case _links + case authorAssociation = "author_association" + case autoMerge = "auto_merge" + case draft } } - /// The status of auto merging a pull request. + /// Metaproperties for Git author/committer information. /// - /// - Remark: Generated from `#/components/schemas/auto-merge`. - public struct AutoMerge: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/auto-merge/enabled_by`. - public var enabledBy: Components.Schemas.SimpleUser - /// The merge method to use. + /// - Remark: Generated from `#/components/schemas/nullable-git-user`. + public struct NullableGitUser: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-git-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-git-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-git-user/date`. + public var date: Swift.String? + /// Creates a new `NullableGitUser`. /// - /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. - @frozen public enum MergeMethodPayload: String, Codable, Hashable, Sendable, CaseIterable { - case merge = "merge" - case squash = "squash" - case rebase = "rebase" + /// - Parameters: + /// - name: + /// - email: + /// - date: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + date: Swift.String? = nil + ) { + self.name = name + self.email = email + self.date = date } - /// The merge method to use. - /// - /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. - public var mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload - /// Title for the merge commit message. - /// - /// - Remark: Generated from `#/components/schemas/auto-merge/commit_title`. - public var commitTitle: Swift.String - /// Commit message for the merge commit. + public enum CodingKeys: String, CodingKey { + case name + case email + case date + } + } + /// - Remark: Generated from `#/components/schemas/verification`. + public struct Verification: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/verification/verified`. + public var verified: Swift.Bool + /// - Remark: Generated from `#/components/schemas/verification/reason`. + public var reason: Swift.String + /// - Remark: Generated from `#/components/schemas/verification/payload`. + public var payload: Swift.String? + /// - Remark: Generated from `#/components/schemas/verification/signature`. + public var signature: Swift.String? + /// - Remark: Generated from `#/components/schemas/verification/verified_at`. + public var verifiedAt: Swift.String? + /// Creates a new `Verification`. /// - /// - Remark: Generated from `#/components/schemas/auto-merge/commit_message`. - public var commitMessage: Swift.String - /// Creates a new `AutoMerge`. + /// - Parameters: + /// - verified: + /// - reason: + /// - payload: + /// - signature: + /// - verifiedAt: + public init( + verified: Swift.Bool, + reason: Swift.String, + payload: Swift.String? = nil, + signature: Swift.String? = nil, + verifiedAt: Swift.String? = nil + ) { + self.verified = verified + self.reason = reason + self.payload = payload + self.signature = signature + self.verifiedAt = verifiedAt + } + public enum CodingKeys: String, CodingKey { + case verified + case reason + case payload + case signature + case verifiedAt = "verified_at" + } + } + /// Diff Entry + /// + /// - Remark: Generated from `#/components/schemas/diff-entry`. + public struct DiffEntry: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/diff-entry/sha`. + public var sha: Swift.String? + /// - Remark: Generated from `#/components/schemas/diff-entry/filename`. + public var filename: Swift.String + /// - Remark: Generated from `#/components/schemas/diff-entry/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case added = "added" + case removed = "removed" + case modified = "modified" + case renamed = "renamed" + case copied = "copied" + case changed = "changed" + case unchanged = "unchanged" + } + /// - Remark: Generated from `#/components/schemas/diff-entry/status`. + public var status: Components.Schemas.DiffEntry.StatusPayload + /// - Remark: Generated from `#/components/schemas/diff-entry/additions`. + public var additions: Swift.Int + /// - Remark: Generated from `#/components/schemas/diff-entry/deletions`. + public var deletions: Swift.Int + /// - Remark: Generated from `#/components/schemas/diff-entry/changes`. + public var changes: Swift.Int + /// - Remark: Generated from `#/components/schemas/diff-entry/blob_url`. + public var blobUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/diff-entry/raw_url`. + public var rawUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/diff-entry/contents_url`. + public var contentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/diff-entry/patch`. + public var patch: Swift.String? + /// - Remark: Generated from `#/components/schemas/diff-entry/previous_filename`. + public var previousFilename: Swift.String? + /// Creates a new `DiffEntry`. /// /// - Parameters: - /// - enabledBy: - /// - mergeMethod: The merge method to use. - /// - commitTitle: Title for the merge commit message. - /// - commitMessage: Commit message for the merge commit. + /// - sha: + /// - filename: + /// - status: + /// - additions: + /// - deletions: + /// - changes: + /// - blobUrl: + /// - rawUrl: + /// - contentsUrl: + /// - patch: + /// - previousFilename: public init( - enabledBy: Components.Schemas.SimpleUser, - mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload, - commitTitle: Swift.String, - commitMessage: Swift.String + sha: Swift.String? = nil, + filename: Swift.String, + status: Components.Schemas.DiffEntry.StatusPayload, + additions: Swift.Int, + deletions: Swift.Int, + changes: Swift.Int, + blobUrl: Swift.String, + rawUrl: Swift.String, + contentsUrl: Swift.String, + patch: Swift.String? = nil, + previousFilename: Swift.String? = nil ) { - self.enabledBy = enabledBy - self.mergeMethod = mergeMethod - self.commitTitle = commitTitle - self.commitMessage = commitMessage + self.sha = sha + self.filename = filename + self.status = status + self.additions = additions + self.deletions = deletions + self.changes = changes + self.blobUrl = blobUrl + self.rawUrl = rawUrl + self.contentsUrl = contentsUrl + self.patch = patch + self.previousFilename = previousFilename } public enum CodingKeys: String, CodingKey { - case enabledBy = "enabled_by" - case mergeMethod = "merge_method" - case commitTitle = "commit_title" - case commitMessage = "commit_message" + case sha + case filename + case status + case additions + case deletions + case changes + case blobUrl = "blob_url" + case rawUrl = "raw_url" + case contentsUrl = "contents_url" + case patch + case previousFilename = "previous_filename" } } - /// Pull Request Simple + /// Commit /// - /// - Remark: Generated from `#/components/schemas/pull-request-simple`. - public struct PullRequestSimple: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/url`. + /// - Remark: Generated from `#/components/schemas/commit`. + public struct Commit: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-simple/node_id`. + /// - Remark: Generated from `#/components/schemas/commit/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/node_id`. public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/html_url`. + /// - Remark: Generated from `#/components/schemas/commit/html_url`. public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/diff_url`. - public var diffUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/patch_url`. - public var patchUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/issue_url`. - public var issueUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/commits_url`. - public var commitsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comments_url`. - public var reviewCommentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comment_url`. - public var reviewCommentUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/comments_url`. + /// - Remark: Generated from `#/components/schemas/commit/comments_url`. public var commentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/statuses_url`. - public var statusesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/number`. - public var number: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request-simple/state`. - public var state: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/locked`. - public var locked: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request-simple/title`. - public var title: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/body`. - public var body: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload`. - public struct LabelsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/url`. + /// - Remark: Generated from `#/components/schemas/commit/commit`. + public struct CommitPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/commit/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/description`. - public var description: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/color`. - public var color: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/default`. - public var _default: Swift.Bool - /// Creates a new `LabelsPayloadPayload`. + /// - Remark: Generated from `#/components/schemas/commit/commit/author`. + public var author: Components.Schemas.NullableGitUser? + /// - Remark: Generated from `#/components/schemas/commit/commit/committer`. + public var committer: Components.Schemas.NullableGitUser? + /// - Remark: Generated from `#/components/schemas/commit/commit/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/commit/comment_count`. + public var commentCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/commit/commit/tree`. + public struct TreePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/commit/tree/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/commit/tree/url`. + public var url: Swift.String + /// Creates a new `TreePayload`. + /// + /// - Parameters: + /// - sha: + /// - url: + public init( + sha: Swift.String, + url: Swift.String + ) { + self.sha = sha + self.url = url + } + public enum CodingKeys: String, CodingKey { + case sha + case url + } + } + /// - Remark: Generated from `#/components/schemas/commit/commit/tree`. + public var tree: Components.Schemas.Commit.CommitPayload.TreePayload + /// - Remark: Generated from `#/components/schemas/commit/commit/verification`. + public var verification: Components.Schemas.Verification? + /// Creates a new `CommitPayload`. /// /// - Parameters: - /// - id: - /// - nodeId: /// - url: - /// - name: - /// - description: - /// - color: - /// - _default: + /// - author: + /// - committer: + /// - message: + /// - commentCount: + /// - tree: + /// - verification: public init( - id: Swift.Int64, - nodeId: Swift.String, url: Swift.String, - name: Swift.String, - description: Swift.String, - color: Swift.String, - _default: Swift.Bool + author: Components.Schemas.NullableGitUser? = nil, + committer: Components.Schemas.NullableGitUser? = nil, + message: Swift.String, + commentCount: Swift.Int, + tree: Components.Schemas.Commit.CommitPayload.TreePayload, + verification: Components.Schemas.Verification? = nil ) { - self.id = id - self.nodeId = nodeId self.url = url - self.name = name - self.description = description - self.color = color - self._default = _default + self.author = author + self.committer = committer + self.message = message + self.commentCount = commentCount + self.tree = tree + self.verification = verification } public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" case url - case name - case description - case color - case _default = "default" + case author + case committer + case message + case commentCount = "comment_count" + case tree + case verification } } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. - public typealias LabelsPayload = [Components.Schemas.PullRequestSimple.LabelsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. - public var labels: Components.Schemas.PullRequestSimple.LabelsPayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/milestone`. - public var milestone: Components.Schemas.NullableMilestone? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/active_lock_reason`. - public var activeLockReason: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request-simple/updated_at`. - public var updatedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request-simple/closed_at`. - public var closedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/merged_at`. - public var mergedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/merge_commit_sha`. - public var mergeCommitSha: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignee`. - public var assignee: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignees`. - public var assignees: [Components.Schemas.SimpleUser]? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_reviewers`. - public var requestedReviewers: [Components.Schemas.SimpleUser]? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_teams`. - public var requestedTeams: [Components.Schemas.Team]? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. - public struct HeadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/label`. - public var label: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/ref`. - public var ref: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/repo`. - public var repo: Components.Schemas.Repository - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// Creates a new `HeadPayload`. - /// - /// - Parameters: - /// - label: - /// - ref: - /// - repo: - /// - sha: - /// - user: - public init( - label: Swift.String, - ref: Swift.String, - repo: Components.Schemas.Repository, - sha: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil - ) { - self.label = label - self.ref = ref - self.repo = repo - self.sha = sha - self.user = user + /// - Remark: Generated from `#/components/schemas/commit/commit`. + public var commit: Components.Schemas.Commit.CommitPayload + /// - Remark: Generated from `#/components/schemas/commit/author`. + @frozen public enum AuthorPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/author/case1`. + case SimpleUser(Components.Schemas.SimpleUser) + /// - Remark: Generated from `#/components/schemas/commit/author/case2`. + case EmptyObject(Components.Schemas.EmptyObject) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .SimpleUser(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .EmptyObject(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) } - public enum CodingKeys: String, CodingKey { - case label - case ref - case repo - case sha - case user + public func encode(to encoder: any Encoder) throws { + switch self { + case let .SimpleUser(value): + try value.encode(to: encoder) + case let .EmptyObject(value): + try value.encode(to: encoder) + } } } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. - public var head: Components.Schemas.PullRequestSimple.HeadPayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. - public struct BasePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/label`. - public var label: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/ref`. - public var ref: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/repo`. - public var repo: Components.Schemas.Repository - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/sha`. + /// - Remark: Generated from `#/components/schemas/commit/author`. + public var author: Components.Schemas.Commit.AuthorPayload? + /// - Remark: Generated from `#/components/schemas/commit/committer`. + @frozen public enum CommitterPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/committer/case1`. + case SimpleUser(Components.Schemas.SimpleUser) + /// - Remark: Generated from `#/components/schemas/commit/committer/case2`. + case EmptyObject(Components.Schemas.EmptyObject) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .SimpleUser(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .EmptyObject(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .SimpleUser(value): + try value.encode(to: encoder) + case let .EmptyObject(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/commit/committer`. + public var committer: Components.Schemas.Commit.CommitterPayload? + /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload`. + public struct ParentsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/sha`. public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// Creates a new `BasePayload`. + /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/commit/ParentsPayload/html_url`. + public var htmlUrl: Swift.String? + /// Creates a new `ParentsPayloadPayload`. /// /// - Parameters: - /// - label: - /// - ref: - /// - repo: /// - sha: - /// - user: - public init( - label: Swift.String, - ref: Swift.String, - repo: Components.Schemas.Repository, - sha: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil - ) { - self.label = label - self.ref = ref - self.repo = repo - self.sha = sha - self.user = user - } - public enum CodingKeys: String, CodingKey { - case label - case ref - case repo - case sha - case user - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. - public var base: Components.Schemas.PullRequestSimple.BasePayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. - public struct _LinksPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/comments`. - public var comments: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/commits`. - public var commits: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/statuses`. - public var statuses: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/html`. - public var html: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/issue`. - public var issue: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comments`. - public var reviewComments: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comment`. - public var reviewComment: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/self`. - public var _self: Components.Schemas.Link - /// Creates a new `_LinksPayload`. + /// - url: + /// - htmlUrl: + public init( + sha: Swift.String, + url: Swift.String, + htmlUrl: Swift.String? = nil + ) { + self.sha = sha + self.url = url + self.htmlUrl = htmlUrl + } + public enum CodingKeys: String, CodingKey { + case sha + case url + case htmlUrl = "html_url" + } + } + /// - Remark: Generated from `#/components/schemas/commit/parents`. + public typealias ParentsPayload = [Components.Schemas.Commit.ParentsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/commit/parents`. + public var parents: Components.Schemas.Commit.ParentsPayload + /// - Remark: Generated from `#/components/schemas/commit/stats`. + public struct StatsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit/stats/additions`. + public var additions: Swift.Int? + /// - Remark: Generated from `#/components/schemas/commit/stats/deletions`. + public var deletions: Swift.Int? + /// - Remark: Generated from `#/components/schemas/commit/stats/total`. + public var total: Swift.Int? + /// Creates a new `StatsPayload`. /// /// - Parameters: - /// - comments: - /// - commits: - /// - statuses: - /// - html: - /// - issue: - /// - reviewComments: - /// - reviewComment: - /// - _self: + /// - additions: + /// - deletions: + /// - total: public init( - comments: Components.Schemas.Link, - commits: Components.Schemas.Link, - statuses: Components.Schemas.Link, - html: Components.Schemas.Link, - issue: Components.Schemas.Link, - reviewComments: Components.Schemas.Link, - reviewComment: Components.Schemas.Link, - _self: Components.Schemas.Link + additions: Swift.Int? = nil, + deletions: Swift.Int? = nil, + total: Swift.Int? = nil ) { - self.comments = comments - self.commits = commits - self.statuses = statuses - self.html = html - self.issue = issue - self.reviewComments = reviewComments - self.reviewComment = reviewComment - self._self = _self + self.additions = additions + self.deletions = deletions + self.total = total } public enum CodingKeys: String, CodingKey { - case comments - case commits - case statuses - case html - case issue - case reviewComments = "review_comments" - case reviewComment = "review_comment" - case _self = "self" + case additions + case deletions + case total } } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. - public var _links: Components.Schemas.PullRequestSimple._LinksPayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation - /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. - public var autoMerge: Components.Schemas.AutoMerge? - /// Indicates whether or not the pull request is a draft. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. - public var draft: Swift.Bool? - /// Creates a new `PullRequestSimple`. + /// - Remark: Generated from `#/components/schemas/commit/stats`. + public var stats: Components.Schemas.Commit.StatsPayload? + /// - Remark: Generated from `#/components/schemas/commit/files`. + public var files: [Components.Schemas.DiffEntry]? + /// Creates a new `Commit`. /// /// - Parameters: /// - url: - /// - id: + /// - sha: /// - nodeId: /// - htmlUrl: - /// - diffUrl: - /// - patchUrl: - /// - issueUrl: - /// - commitsUrl: - /// - reviewCommentsUrl: - /// - reviewCommentUrl: /// - commentsUrl: - /// - statusesUrl: - /// - number: - /// - state: - /// - locked: - /// - title: - /// - user: - /// - body: - /// - labels: - /// - milestone: - /// - activeLockReason: - /// - createdAt: - /// - updatedAt: - /// - closedAt: - /// - mergedAt: - /// - mergeCommitSha: - /// - assignee: - /// - assignees: - /// - requestedReviewers: - /// - requestedTeams: - /// - head: - /// - base: - /// - _links: - /// - authorAssociation: - /// - autoMerge: - /// - draft: Indicates whether or not the pull request is a draft. + /// - commit: + /// - author: + /// - committer: + /// - parents: + /// - stats: + /// - files: public init( url: Swift.String, - id: Swift.Int64, + sha: Swift.String, nodeId: Swift.String, htmlUrl: Swift.String, - diffUrl: Swift.String, - patchUrl: Swift.String, - issueUrl: Swift.String, - commitsUrl: Swift.String, - reviewCommentsUrl: Swift.String, - reviewCommentUrl: Swift.String, commentsUrl: Swift.String, - statusesUrl: Swift.String, - number: Swift.Int, - state: Swift.String, - locked: Swift.Bool, - title: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil, - body: Swift.String? = nil, - labels: Components.Schemas.PullRequestSimple.LabelsPayload, - milestone: Components.Schemas.NullableMilestone? = nil, - activeLockReason: Swift.String? = nil, - createdAt: Foundation.Date, - updatedAt: Foundation.Date, - closedAt: Foundation.Date? = nil, - mergedAt: Foundation.Date? = nil, - mergeCommitSha: Swift.String? = nil, - assignee: Components.Schemas.NullableSimpleUser? = nil, - assignees: [Components.Schemas.SimpleUser]? = nil, - requestedReviewers: [Components.Schemas.SimpleUser]? = nil, - requestedTeams: [Components.Schemas.Team]? = nil, - head: Components.Schemas.PullRequestSimple.HeadPayload, - base: Components.Schemas.PullRequestSimple.BasePayload, - _links: Components.Schemas.PullRequestSimple._LinksPayload, - authorAssociation: Components.Schemas.AuthorAssociation, - autoMerge: Components.Schemas.AutoMerge? = nil, - draft: Swift.Bool? = nil + commit: Components.Schemas.Commit.CommitPayload, + author: Components.Schemas.Commit.AuthorPayload? = nil, + committer: Components.Schemas.Commit.CommitterPayload? = nil, + parents: Components.Schemas.Commit.ParentsPayload, + stats: Components.Schemas.Commit.StatsPayload? = nil, + files: [Components.Schemas.DiffEntry]? = nil ) { self.url = url - self.id = id + self.sha = sha self.nodeId = nodeId self.htmlUrl = htmlUrl - self.diffUrl = diffUrl - self.patchUrl = patchUrl - self.issueUrl = issueUrl - self.commitsUrl = commitsUrl - self.reviewCommentsUrl = reviewCommentsUrl - self.reviewCommentUrl = reviewCommentUrl self.commentsUrl = commentsUrl - self.statusesUrl = statusesUrl - self.number = number - self.state = state - self.locked = locked - self.title = title - self.user = user - self.body = body - self.labels = labels - self.milestone = milestone - self.activeLockReason = activeLockReason - self.createdAt = createdAt - self.updatedAt = updatedAt - self.closedAt = closedAt - self.mergedAt = mergedAt - self.mergeCommitSha = mergeCommitSha - self.assignee = assignee - self.assignees = assignees - self.requestedReviewers = requestedReviewers - self.requestedTeams = requestedTeams - self.head = head - self.base = base - self._links = _links - self.authorAssociation = authorAssociation - self.autoMerge = autoMerge - self.draft = draft + self.commit = commit + self.author = author + self.committer = committer + self.parents = parents + self.stats = stats + self.files = files } public enum CodingKeys: String, CodingKey { case url - case id + case sha case nodeId = "node_id" case htmlUrl = "html_url" - case diffUrl = "diff_url" - case patchUrl = "patch_url" - case issueUrl = "issue_url" - case commitsUrl = "commits_url" - case reviewCommentsUrl = "review_comments_url" - case reviewCommentUrl = "review_comment_url" case commentsUrl = "comments_url" - case statusesUrl = "statuses_url" - case number - case state - case locked - case title - case user - case body - case labels - case milestone - case activeLockReason = "active_lock_reason" - case createdAt = "created_at" - case updatedAt = "updated_at" - case closedAt = "closed_at" - case mergedAt = "merged_at" - case mergeCommitSha = "merge_commit_sha" - case assignee - case assignees - case requestedReviewers = "requested_reviewers" - case requestedTeams = "requested_teams" - case head - case base - case _links - case authorAssociation = "author_association" - case autoMerge = "auto_merge" - case draft + case commit + case author + case committer + case parents + case stats + case files } } /// Pull Request Review Comments are comments on a portion of the Pull Request's diff. @@ -5006,6 +5132,17 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/review-comment/original_start_line`. public var originalStartLine: Swift.Int? + /// The level at which the comment is targeted, can be a diff line or a file. + /// + /// - Remark: Generated from `#/components/schemas/review-comment/subject_type`. + @frozen public enum SubjectTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case line = "line" + case file = "file" + } + /// The level at which the comment is targeted, can be a diff line or a file. + /// + /// - Remark: Generated from `#/components/schemas/review-comment/subject_type`. + public var subjectType: Components.Schemas.ReviewComment.SubjectTypePayload? /// Creates a new `ReviewComment`. /// /// - Parameters: @@ -5037,6 +5174,7 @@ public enum Components { /// - originalLine: The original line of the blob to which the comment applies. The last line of the range for a multi-line comment /// - startLine: The first line of the range for a multi-line comment. /// - originalStartLine: The original first line of the range for a multi-line comment. + /// - subjectType: The level at which the comment is targeted, can be a diff line or a file. public init( url: Swift.String, pullRequestReviewId: Swift.Int64? = nil, @@ -5065,7 +5203,8 @@ public enum Components { line: Swift.Int? = nil, originalLine: Swift.Int? = nil, startLine: Swift.Int? = nil, - originalStartLine: Swift.Int? = nil + originalStartLine: Swift.Int? = nil, + subjectType: Components.Schemas.ReviewComment.SubjectTypePayload? = nil ) { self.url = url self.pullRequestReviewId = pullRequestReviewId @@ -5095,6 +5234,7 @@ public enum Components { self.originalLine = originalLine self.startLine = startLine self.originalStartLine = originalStartLine + self.subjectType = subjectType } public enum CodingKeys: String, CodingKey { case url @@ -5125,6 +5265,7 @@ public enum Components { case originalLine = "original_line" case startLine = "start_line" case originalStartLine = "original_start_line" + case subjectType = "subject_type" } } } diff --git a/Sources/rate-limit/Client.swift b/Sources/rate-limit/Client.swift index c0eb8031643..d6aa4ad18c8 100644 --- a/Sources/rate-limit/Client.swift +++ b/Sources/rate-limit/Client.swift @@ -50,6 +50,7 @@ public struct Client: APIProtocol { /// * The `graphql` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/graphql/overview/resource-limitations#rate-limit)." /// * The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)." /// * The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." + /// * The `dependency_sbom` object provides your rate limit status for requesting SBOMs from the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." /// * The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)." /// * The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)." /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." diff --git a/Sources/rate-limit/Types.swift b/Sources/rate-limit/Types.swift index a4217bf4a7d..d1983645195 100644 --- a/Sources/rate-limit/Types.swift +++ b/Sources/rate-limit/Types.swift @@ -23,6 +23,7 @@ public protocol APIProtocol: Sendable { /// * The `graphql` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/graphql/overview/resource-limitations#rate-limit)." /// * The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)." /// * The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." + /// * The `dependency_sbom` object provides your rate limit status for requesting SBOMs from the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." /// * The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)." /// * The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)." /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." @@ -49,6 +50,7 @@ extension APIProtocol { /// * The `graphql` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/graphql/overview/resource-limitations#rate-limit)." /// * The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)." /// * The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." + /// * The `dependency_sbom` object provides your rate limit status for requesting SBOMs from the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." /// * The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)." /// * The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)." /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." @@ -184,6 +186,8 @@ public enum Components { public var scim: Components.Schemas.RateLimit? /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources/dependency_snapshots`. public var dependencySnapshots: Components.Schemas.RateLimit? + /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources/dependency_sbom`. + public var dependencySbom: Components.Schemas.RateLimit? /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources/code_scanning_autofix`. public var codeScanningAutofix: Components.Schemas.RateLimit? /// Creates a new `ResourcesPayload`. @@ -199,6 +203,7 @@ public enum Components { /// - actionsRunnerRegistration: /// - scim: /// - dependencySnapshots: + /// - dependencySbom: /// - codeScanningAutofix: public init( core: Components.Schemas.RateLimit, @@ -211,6 +216,7 @@ public enum Components { actionsRunnerRegistration: Components.Schemas.RateLimit? = nil, scim: Components.Schemas.RateLimit? = nil, dependencySnapshots: Components.Schemas.RateLimit? = nil, + dependencySbom: Components.Schemas.RateLimit? = nil, codeScanningAutofix: Components.Schemas.RateLimit? = nil ) { self.core = core @@ -223,6 +229,7 @@ public enum Components { self.actionsRunnerRegistration = actionsRunnerRegistration self.scim = scim self.dependencySnapshots = dependencySnapshots + self.dependencySbom = dependencySbom self.codeScanningAutofix = codeScanningAutofix } public enum CodingKeys: String, CodingKey { @@ -236,6 +243,7 @@ public enum Components { case actionsRunnerRegistration = "actions_runner_registration" case scim case dependencySnapshots = "dependency_snapshots" + case dependencySbom = "dependency_sbom" case codeScanningAutofix = "code_scanning_autofix" } } @@ -325,6 +333,7 @@ public enum Operations { /// * The `graphql` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/graphql/overview/resource-limitations#rate-limit)." /// * The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)." /// * The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." + /// * The `dependency_sbom` object provides your rate limit status for requesting SBOMs from the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." /// * The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)." /// * The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)." /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." diff --git a/Sources/reactions/Types.swift b/Sources/reactions/Types.swift index b51f7cc81d0..a63807c4188 100644 --- a/Sources/reactions/Types.swift +++ b/Sources/reactions/Types.swift @@ -1114,6 +1114,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias TeamSlug = Swift.String /// The unique identifier of the comment. /// /// - Remark: Generated from `#/components/parameters/comment-id`. @@ -1126,14 +1134,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repo`. public typealias Repo = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String - /// The slug of the team name. - /// - /// - Remark: Generated from `#/components/parameters/team-slug`. - public typealias TeamSlug = Swift.String /// The number that identifies the discussion. /// /// - Remark: Generated from `#/components/parameters/discussion-number`. diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index ba61188be70..2f93a1be996 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -1115,7 +1115,8 @@ public struct Client: APIProtocol { /// The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network. /// /// > [!NOTE] - /// > In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - To view merge-related settings, you must have the `contents:read` and `contents:write` permissions. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/get(repos/get)`. @@ -1512,6 +1513,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -5875,12 +5898,12 @@ public struct Client: APIProtocol { /// List repository collaborators /// /// For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. - /// Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint. + /// The `permissions` hash returned in the response contains the base role permissions of the collaborator. The `role_name` is the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// Team members will include the members of child teams. /// - /// The authenticated user must have push access to the repository to use this endpoint. - /// + /// The authenticated user must have write, maintain, or admin privileges on the repository to use this endpoint. For organization-owned repositories, the authenticated user needs to be a member of the organization. /// OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators`. @@ -6054,11 +6077,13 @@ public struct Client: APIProtocol { } /// Add a repository collaborator /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// Add a user to a repository with a specified level of access. If the repository is owned by an organization, this API does not add the user to the organization - a user that has repository access without being an organization member is called an "outside collaborator" (if they are not an Enterprise Managed User) or a "repository collaborator" if they are an Enterprise Managed User. These users are exempt from some organization policies - see "[Adding outside collaborators to repositories](https://docs.github.com/organizations/managing-user-access-to-your-organizations-repositories/managing-outside-collaborators/adding-outside-collaborators-to-repositories-in-your-organization)" to learn more about these collaborator types. /// - /// Adding an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). /// - /// For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with: + /// Adding an outside collaborator may be restricted by enterprise and organization administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)" and "[Setting permissions for adding outside collaborators](https://docs.github.com/organizations/managing-organization-settings/setting-permissions-for-adding-outside-collaborators)" for organization settings. + /// + /// For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the role being given must be equal to or higher than the org base permission. Otherwise, the request will fail with: /// /// ``` /// Cannot assign {member} permission of {role name} @@ -6068,6 +6093,8 @@ public struct Client: APIProtocol { /// /// The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [API](https://docs.github.com/rest/collaborators/invitations). /// + /// For Enterprise Managed Users, this endpoint does not send invitations - these users are automatically added to organizations and repositories. Enterprise Managed Users can only be added to organizations and repositories within their enterprise. + /// /// **Updating an existing collaborator's permission level** /// /// The endpoint can also be used to change the permissions of an existing collaborator without first removing and re-adding the collaborator. To change the permissions, use the same endpoint and pass a different `permission` parameter. The response will be a `204`, with no other indication that the permission level changed. @@ -6141,7 +6168,7 @@ public struct Client: APIProtocol { return .noContent(.init()) case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Operations.ReposAddCollaborator.Output.UnprocessableContent.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -6308,13 +6335,15 @@ public struct Client: APIProtocol { } /// Get repository permissions for a user /// - /// Checks the repository permission of a collaborator. The possible repository - /// permissions are `admin`, `write`, `read`, and `none`. + /// Checks the repository permission and role of a collaborator. + /// + /// The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the + /// `maintain` role is mapped to `write` and the `triage` role is mapped to `read`. + /// The `role_name` attribute provides the name of the assigned role, including custom roles. The + /// `permission` can also be used to determine which base level of access the collaborator has to the repository. /// - /// *Note*: The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the - /// `maintain` role is mapped to `write` and the `triage` role is mapped to `read`. To determine the role assigned to the - /// collaborator, see the `role_name` attribute, which will provide the full role name, including custom roles. The - /// `permissions` hash can also be used to determine which base level of access the collaborator has to the repository. + /// The calculated permissions are the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators/{username}/permission`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/collaborators/{username}/permission/get(repos/get-collaborator-permission-level)`. @@ -12216,6 +12245,208 @@ public struct Client: APIProtocol { } ) } + /// Check if immutable releases are enabled for a repository + /// + /// Shows whether immutable releases are enabled or disabled. Also identifies whether immutability is being + /// enforced by the repository owner. The authenticated user must have admin read access to the repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/get(repos/check-immutable-releases)`. + public func reposCheckImmutableReleases(_ input: Operations.ReposCheckImmutableReleases.Input) async throws -> Operations.ReposCheckImmutableReleases.Output { + try await client.send( + input: input, + forOperation: Operations.ReposCheckImmutableReleases.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/immutable-releases", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ReposCheckImmutableReleases.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.CheckImmutableReleases.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + return .notFound(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Enable immutable releases + /// + /// Enables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/put(repos/enable-immutable-releases)`. + public func reposEnableImmutableReleases(_ input: Operations.ReposEnableImmutableReleases.Input) async throws -> Operations.ReposEnableImmutableReleases.Output { + try await client.send( + input: input, + forOperation: Operations.ReposEnableImmutableReleases.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/immutable-releases", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Disable immutable releases + /// + /// Disables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/delete(repos/disable-immutable-releases)`. + public func reposDisableImmutableReleases(_ input: Operations.ReposDisableImmutableReleases.Input) async throws -> Operations.ReposDisableImmutableReleases.Output { + try await client.send( + input: input, + forOperation: Operations.ReposDisableImmutableReleases.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/immutable-releases", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// List repository invitations /// /// When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. @@ -14444,11 +14675,11 @@ public struct Client: APIProtocol { /// Users with read access to the repository can use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)`. - public func reposGetCustomPropertiesValues(_ input: Operations.ReposGetCustomPropertiesValues.Input) async throws -> Operations.ReposGetCustomPropertiesValues.Output { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)`. + public func reposCustomPropertiesForReposGetRepositoryValues(_ input: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input) async throws -> Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output { try await client.send( input: input, - forOperation: Operations.ReposGetCustomPropertiesValues.id, + forOperation: Operations.ReposCustomPropertiesForReposGetRepositoryValues.id, serializer: { input in let path = try converter.renderedPath( template: "/repos/{}/{}/properties/values", @@ -14472,7 +14703,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ReposGetCustomPropertiesValues.Output.Ok.Body + let body: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14556,11 +14787,11 @@ public struct Client: APIProtocol { /// Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)`. - public func reposCreateOrUpdateCustomPropertiesValues(_ input: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input) async throws -> Operations.ReposCreateOrUpdateCustomPropertiesValues.Output { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)`. + public func reposCustomPropertiesForReposCreateOrUpdateRepositoryValues(_ input: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input) async throws -> Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Output { try await client.send( input: input, - forOperation: Operations.ReposCreateOrUpdateCustomPropertiesValues.id, + forOperation: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.id, serializer: { input in let path = try converter.renderedPath( template: "/repos/{}/{}/properties/values", diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index 7b59bef5b06..dc08f8a4010 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -89,7 +89,8 @@ public protocol APIProtocol: Sendable { /// The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network. /// /// > [!NOTE] - /// > In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - To view merge-related settings, you must have the `contents:read` and `contents:write` permissions. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/get(repos/get)`. @@ -544,12 +545,12 @@ public protocol APIProtocol: Sendable { /// List repository collaborators /// /// For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. - /// Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint. + /// The `permissions` hash returned in the response contains the base role permissions of the collaborator. The `role_name` is the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// Team members will include the members of child teams. /// - /// The authenticated user must have push access to the repository to use this endpoint. - /// + /// The authenticated user must have write, maintain, or admin privileges on the repository to use this endpoint. For organization-owned repositories, the authenticated user needs to be a member of the organization. /// OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators`. @@ -570,11 +571,13 @@ public protocol APIProtocol: Sendable { func reposCheckCollaborator(_ input: Operations.ReposCheckCollaborator.Input) async throws -> Operations.ReposCheckCollaborator.Output /// Add a repository collaborator /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// Add a user to a repository with a specified level of access. If the repository is owned by an organization, this API does not add the user to the organization - a user that has repository access without being an organization member is called an "outside collaborator" (if they are not an Enterprise Managed User) or a "repository collaborator" if they are an Enterprise Managed User. These users are exempt from some organization policies - see "[Adding outside collaborators to repositories](https://docs.github.com/organizations/managing-user-access-to-your-organizations-repositories/managing-outside-collaborators/adding-outside-collaborators-to-repositories-in-your-organization)" to learn more about these collaborator types. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). /// - /// Adding an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." + /// Adding an outside collaborator may be restricted by enterprise and organization administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)" and "[Setting permissions for adding outside collaborators](https://docs.github.com/organizations/managing-organization-settings/setting-permissions-for-adding-outside-collaborators)" for organization settings. /// - /// For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with: + /// For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the role being given must be equal to or higher than the org base permission. Otherwise, the request will fail with: /// /// ``` /// Cannot assign {member} permission of {role name} @@ -584,6 +587,8 @@ public protocol APIProtocol: Sendable { /// /// The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [API](https://docs.github.com/rest/collaborators/invitations). /// + /// For Enterprise Managed Users, this endpoint does not send invitations - these users are automatically added to organizations and repositories. Enterprise Managed Users can only be added to organizations and repositories within their enterprise. + /// /// **Updating an existing collaborator's permission level** /// /// The endpoint can also be used to change the permissions of an existing collaborator without first removing and re-adding the collaborator. To change the permissions, use the same endpoint and pass a different `permission` parameter. The response will be a `204`, with no other indication that the permission level changed. @@ -625,13 +630,15 @@ public protocol APIProtocol: Sendable { func reposRemoveCollaborator(_ input: Operations.ReposRemoveCollaborator.Input) async throws -> Operations.ReposRemoveCollaborator.Output /// Get repository permissions for a user /// - /// Checks the repository permission of a collaborator. The possible repository - /// permissions are `admin`, `write`, `read`, and `none`. + /// Checks the repository permission and role of a collaborator. /// - /// *Note*: The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the - /// `maintain` role is mapped to `write` and the `triage` role is mapped to `read`. To determine the role assigned to the - /// collaborator, see the `role_name` attribute, which will provide the full role name, including custom roles. The - /// `permissions` hash can also be used to determine which base level of access the collaborator has to the repository. + /// The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the + /// `maintain` role is mapped to `write` and the `triage` role is mapped to `read`. + /// The `role_name` attribute provides the name of the assigned role, including custom roles. The + /// `permission` can also be used to determine which base level of access the collaborator has to the repository. + /// + /// The calculated permissions are the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators/{username}/permission`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/collaborators/{username}/permission/get(repos/get-collaborator-permission-level)`. @@ -1368,6 +1375,28 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `POST /repos/{owner}/{repo}/hooks/{hook_id}/tests`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/hooks/{hook_id}/tests/post(repos/test-push-webhook)`. func reposTestPushWebhook(_ input: Operations.ReposTestPushWebhook.Input) async throws -> Operations.ReposTestPushWebhook.Output + /// Check if immutable releases are enabled for a repository + /// + /// Shows whether immutable releases are enabled or disabled. Also identifies whether immutability is being + /// enforced by the repository owner. The authenticated user must have admin read access to the repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/get(repos/check-immutable-releases)`. + func reposCheckImmutableReleases(_ input: Operations.ReposCheckImmutableReleases.Input) async throws -> Operations.ReposCheckImmutableReleases.Output + /// Enable immutable releases + /// + /// Enables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/put(repos/enable-immutable-releases)`. + func reposEnableImmutableReleases(_ input: Operations.ReposEnableImmutableReleases.Input) async throws -> Operations.ReposEnableImmutableReleases.Output + /// Disable immutable releases + /// + /// Disables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/delete(repos/disable-immutable-releases)`. + func reposDisableImmutableReleases(_ input: Operations.ReposDisableImmutableReleases.Input) async throws -> Operations.ReposDisableImmutableReleases.Output /// List repository invitations /// /// When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. @@ -1583,8 +1612,8 @@ public protocol APIProtocol: Sendable { /// Users with read access to the repository can use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)`. - func reposGetCustomPropertiesValues(_ input: Operations.ReposGetCustomPropertiesValues.Input) async throws -> Operations.ReposGetCustomPropertiesValues.Output + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)`. + func reposCustomPropertiesForReposGetRepositoryValues(_ input: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input) async throws -> Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output /// Create or update custom property values for a repository /// /// Create new or update existing custom property values for a repository. @@ -1593,8 +1622,8 @@ public protocol APIProtocol: Sendable { /// Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)`. - func reposCreateOrUpdateCustomPropertiesValues(_ input: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input) async throws -> Operations.ReposCreateOrUpdateCustomPropertiesValues.Output + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)`. + func reposCustomPropertiesForReposCreateOrUpdateRepositoryValues(_ input: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input) async throws -> Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Output /// Get a repository README /// /// Gets the preferred README for a repository. @@ -2270,7 +2299,8 @@ extension APIProtocol { /// The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network. /// /// > [!NOTE] - /// > In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - To view merge-related settings, you must have the `contents:read` and `contents:write` permissions. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/get(repos/get)`. @@ -3147,12 +3177,12 @@ extension APIProtocol { /// List repository collaborators /// /// For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. - /// Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint. + /// The `permissions` hash returned in the response contains the base role permissions of the collaborator. The `role_name` is the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// Team members will include the members of child teams. /// - /// The authenticated user must have push access to the repository to use this endpoint. - /// + /// The authenticated user must have write, maintain, or admin privileges on the repository to use this endpoint. For organization-owned repositories, the authenticated user needs to be a member of the organization. /// OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators`. @@ -3185,11 +3215,13 @@ extension APIProtocol { } /// Add a repository collaborator /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// Add a user to a repository with a specified level of access. If the repository is owned by an organization, this API does not add the user to the organization - a user that has repository access without being an organization member is called an "outside collaborator" (if they are not an Enterprise Managed User) or a "repository collaborator" if they are an Enterprise Managed User. These users are exempt from some organization policies - see "[Adding outside collaborators to repositories](https://docs.github.com/organizations/managing-user-access-to-your-organizations-repositories/managing-outside-collaborators/adding-outside-collaborators-to-repositories-in-your-organization)" to learn more about these collaborator types. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). /// - /// Adding an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." + /// Adding an outside collaborator may be restricted by enterprise and organization administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)" and "[Setting permissions for adding outside collaborators](https://docs.github.com/organizations/managing-organization-settings/setting-permissions-for-adding-outside-collaborators)" for organization settings. /// - /// For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with: + /// For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the role being given must be equal to or higher than the org base permission. Otherwise, the request will fail with: /// /// ``` /// Cannot assign {member} permission of {role name} @@ -3199,6 +3231,8 @@ extension APIProtocol { /// /// The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [API](https://docs.github.com/rest/collaborators/invitations). /// + /// For Enterprise Managed Users, this endpoint does not send invitations - these users are automatically added to organizations and repositories. Enterprise Managed Users can only be added to organizations and repositories within their enterprise. + /// /// **Updating an existing collaborator's permission level** /// /// The endpoint can also be used to change the permissions of an existing collaborator without first removing and re-adding the collaborator. To change the permissions, use the same endpoint and pass a different `permission` parameter. The response will be a `204`, with no other indication that the permission level changed. @@ -3258,13 +3292,15 @@ extension APIProtocol { } /// Get repository permissions for a user /// - /// Checks the repository permission of a collaborator. The possible repository - /// permissions are `admin`, `write`, `read`, and `none`. + /// Checks the repository permission and role of a collaborator. /// - /// *Note*: The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the - /// `maintain` role is mapped to `write` and the `triage` role is mapped to `read`. To determine the role assigned to the - /// collaborator, see the `role_name` attribute, which will provide the full role name, including custom roles. The - /// `permissions` hash can also be used to determine which base level of access the collaborator has to the repository. + /// The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the + /// `maintain` role is mapped to `write` and the `triage` role is mapped to `read`. + /// The `role_name` attribute provides the name of the assigned role, including custom roles. The + /// `permission` can also be used to determine which base level of access the collaborator has to the repository. + /// + /// The calculated permissions are the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators/{username}/permission`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/collaborators/{username}/permission/get(repos/get-collaborator-permission-level)`. @@ -4489,6 +4525,52 @@ extension APIProtocol { headers: headers )) } + /// Check if immutable releases are enabled for a repository + /// + /// Shows whether immutable releases are enabled or disabled. Also identifies whether immutability is being + /// enforced by the repository owner. The authenticated user must have admin read access to the repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/get(repos/check-immutable-releases)`. + public func reposCheckImmutableReleases( + path: Operations.ReposCheckImmutableReleases.Input.Path, + headers: Operations.ReposCheckImmutableReleases.Input.Headers = .init() + ) async throws -> Operations.ReposCheckImmutableReleases.Output { + try await reposCheckImmutableReleases(Operations.ReposCheckImmutableReleases.Input( + path: path, + headers: headers + )) + } + /// Enable immutable releases + /// + /// Enables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/put(repos/enable-immutable-releases)`. + public func reposEnableImmutableReleases( + path: Operations.ReposEnableImmutableReleases.Input.Path, + headers: Operations.ReposEnableImmutableReleases.Input.Headers = .init() + ) async throws -> Operations.ReposEnableImmutableReleases.Output { + try await reposEnableImmutableReleases(Operations.ReposEnableImmutableReleases.Input( + path: path, + headers: headers + )) + } + /// Disable immutable releases + /// + /// Disables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/delete(repos/disable-immutable-releases)`. + public func reposDisableImmutableReleases( + path: Operations.ReposDisableImmutableReleases.Input.Path, + headers: Operations.ReposDisableImmutableReleases.Input.Headers = .init() + ) async throws -> Operations.ReposDisableImmutableReleases.Output { + try await reposDisableImmutableReleases(Operations.ReposDisableImmutableReleases.Input( + path: path, + headers: headers + )) + } /// List repository invitations /// /// When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. @@ -4912,12 +4994,12 @@ extension APIProtocol { /// Users with read access to the repository can use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)`. - public func reposGetCustomPropertiesValues( - path: Operations.ReposGetCustomPropertiesValues.Input.Path, - headers: Operations.ReposGetCustomPropertiesValues.Input.Headers = .init() - ) async throws -> Operations.ReposGetCustomPropertiesValues.Output { - try await reposGetCustomPropertiesValues(Operations.ReposGetCustomPropertiesValues.Input( + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)`. + public func reposCustomPropertiesForReposGetRepositoryValues( + path: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Path, + headers: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Headers = .init() + ) async throws -> Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output { + try await reposCustomPropertiesForReposGetRepositoryValues(Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input( path: path, headers: headers )) @@ -4930,13 +5012,13 @@ extension APIProtocol { /// Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)`. - public func reposCreateOrUpdateCustomPropertiesValues( - path: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Path, - headers: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Headers = .init(), - body: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Body - ) async throws -> Operations.ReposCreateOrUpdateCustomPropertiesValues.Output { - try await reposCreateOrUpdateCustomPropertiesValues(Operations.ReposCreateOrUpdateCustomPropertiesValues.Input( + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)`. + public func reposCustomPropertiesForReposCreateOrUpdateRepositoryValues( + path: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Path, + headers: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Headers = .init(), + body: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Body + ) async throws -> Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Output { + try await reposCustomPropertiesForReposCreateOrUpdateRepositoryValues(Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input( path: path, headers: headers, body: body @@ -6407,20 +6489,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/integration/permissions`. public var permissions: Components.Schemas.Integration.PermissionsPayload - /// The list of events for the GitHub app + /// The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. /// /// - Remark: Generated from `#/components/schemas/integration/events`. public var events: [Swift.String] - /// The number of installations associated with the GitHub app + /// The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. /// /// - Remark: Generated from `#/components/schemas/integration/installations_count`. public var installationsCount: Swift.Int? - /// - Remark: Generated from `#/components/schemas/integration/client_secret`. - public var clientSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/integration/webhook_secret`. - public var webhookSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/integration/pem`. - public var pem: Swift.String? /// Creates a new `Integration`. /// /// - Parameters: @@ -6436,11 +6512,8 @@ public enum Components { /// - createdAt: /// - updatedAt: /// - permissions: The set of permissions for the GitHub app - /// - events: The list of events for the GitHub app - /// - installationsCount: The number of installations associated with the GitHub app - /// - clientSecret: - /// - webhookSecret: - /// - pem: + /// - events: The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. + /// - installationsCount: The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. public init( id: Swift.Int, slug: Swift.String? = nil, @@ -6455,10 +6528,7 @@ public enum Components { updatedAt: Foundation.Date, permissions: Components.Schemas.Integration.PermissionsPayload, events: [Swift.String], - installationsCount: Swift.Int? = nil, - clientSecret: Swift.String? = nil, - webhookSecret: Swift.String? = nil, - pem: Swift.String? = nil + installationsCount: Swift.Int? = nil ) { self.id = id self.slug = slug @@ -6474,9 +6544,6 @@ public enum Components { self.permissions = permissions self.events = events self.installationsCount = installationsCount - self.clientSecret = clientSecret - self.webhookSecret = webhookSecret - self.pem = pem } public enum CodingKeys: String, CodingKey { case id @@ -6493,9 +6560,6 @@ public enum Components { case permissions case events case installationsCount = "installations_count" - case clientSecret = "client_secret" - case webhookSecret = "webhook_secret" - case pem } } /// The URL to which the payloads will be delivered. @@ -7655,6 +7719,35 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/anonymous_access_enabled`. public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? /// Creates a new `Repository`. /// /// - Parameters: @@ -7753,6 +7846,7 @@ public enum Components { /// - masterBranch: /// - starredAt: /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository public init( id: Swift.Int64, nodeId: Swift.String, @@ -7848,7 +7942,8 @@ public enum Components { watchers: Swift.Int, masterBranch: Swift.String? = nil, starredAt: Swift.String? = nil, - anonymousAccessEnabled: Swift.Bool? = nil + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -7945,6 +8040,7 @@ public enum Components { self.masterBranch = masterBranch self.starredAt = starredAt self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus } public enum CodingKeys: String, CodingKey { case id @@ -8042,6 +8138,7 @@ public enum Components { case masterBranch = "master_branch" case starredAt = "starred_at" case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" } } /// Code Of Conduct @@ -8382,20 +8479,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. public var permissions: Components.Schemas.NullableIntegration.PermissionsPayload - /// The list of events for the GitHub app + /// The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. /// /// - Remark: Generated from `#/components/schemas/nullable-integration/events`. public var events: [Swift.String] - /// The number of installations associated with the GitHub app + /// The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. /// /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. public var installationsCount: Swift.Int? - /// - Remark: Generated from `#/components/schemas/nullable-integration/client_secret`. - public var clientSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/webhook_secret`. - public var webhookSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/pem`. - public var pem: Swift.String? /// Creates a new `NullableIntegration`. /// /// - Parameters: @@ -8411,11 +8502,8 @@ public enum Components { /// - createdAt: /// - updatedAt: /// - permissions: The set of permissions for the GitHub app - /// - events: The list of events for the GitHub app - /// - installationsCount: The number of installations associated with the GitHub app - /// - clientSecret: - /// - webhookSecret: - /// - pem: + /// - events: The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. + /// - installationsCount: The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. public init( id: Swift.Int, slug: Swift.String? = nil, @@ -8430,10 +8518,7 @@ public enum Components { updatedAt: Foundation.Date, permissions: Components.Schemas.NullableIntegration.PermissionsPayload, events: [Swift.String], - installationsCount: Swift.Int? = nil, - clientSecret: Swift.String? = nil, - webhookSecret: Swift.String? = nil, - pem: Swift.String? = nil + installationsCount: Swift.Int? = nil ) { self.id = id self.slug = slug @@ -8449,9 +8534,6 @@ public enum Components { self.permissions = permissions self.events = events self.installationsCount = installationsCount - self.clientSecret = clientSecret - self.webhookSecret = webhookSecret - self.pem = pem } public enum CodingKeys: String, CodingKey { case id @@ -8468,9 +8550,6 @@ public enum Components { case permissions case events case installationsCount = "installations_count" - case clientSecret = "client_secret" - case webhookSecret = "webhook_secret" - case pem } } /// How the author is associated with the repository. @@ -8559,6 +8638,11 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -8579,6 +8663,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -8724,7 +8813,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: @@ -9020,6 +9109,30 @@ public enum Components { public var webCommitSignoffRequired: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/security_and_analysis`. public var securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public struct CustomPropertiesPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CustomPropertiesPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public var customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? /// Creates a new `MinimalRepository`. /// /// - Parameters: @@ -9110,6 +9223,7 @@ public enum Components { /// - allowForking: /// - webCommitSignoffRequired: /// - securityAndAnalysis: + /// - customProperties: The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. public init( id: Swift.Int64, nodeId: Swift.String, @@ -9197,7 +9311,8 @@ public enum Components { watchers: Swift.Int? = nil, allowForking: Swift.Bool? = nil, webCommitSignoffRequired: Swift.Bool? = nil, - securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil + securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil, + customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -9286,6 +9401,7 @@ public enum Components { self.allowForking = allowForking self.webCommitSignoffRequired = webCommitSignoffRequired self.securityAndAnalysis = securityAndAnalysis + self.customProperties = customProperties } public enum CodingKeys: String, CodingKey { case id @@ -9375,261 +9491,7 @@ public enum Components { case allowForking = "allow_forking" case webCommitSignoffRequired = "web_commit_signoff_required" case securityAndAnalysis = "security_and_analysis" - } - } - /// An object without any properties. - /// - /// - Remark: Generated from `#/components/schemas/empty-object`. - public struct EmptyObject: Codable, Hashable, Sendable { - /// Creates a new `EmptyObject`. - public init() {} - public init(from decoder: any Decoder) throws { - try decoder.ensureNoAdditionalProperties(knownKeys: []) - } - } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. - public struct NullableTeamSimple: Codable, Hashable, Sendable { - /// Unique identifier of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. - public var nodeId: Swift.String - /// URL for the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. - public var membersUrl: Swift.String - /// Name of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. - public var name: Swift.String - /// Description of the team - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. - public var description: Swift.String? - /// Permission that the team will have for its repositories - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. - public var permission: Swift.String - /// The level of privacy this team should have - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. - public var privacy: Swift.String? - /// The notification setting the team has set - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. - public var notificationSetting: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. - public var repositoriesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. - public var slug: Swift.String - /// Distinguished Name (DN) that team maps to within LDAP environment - /// - /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. - public var ldapDn: Swift.String? - /// Creates a new `NullableTeamSimple`. - /// - /// - Parameters: - /// - id: Unique identifier of the team - /// - nodeId: - /// - url: URL for the team - /// - membersUrl: - /// - name: Name of the team - /// - description: Description of the team - /// - permission: Permission that the team will have for its repositories - /// - privacy: The level of privacy this team should have - /// - notificationSetting: The notification setting the team has set - /// - htmlUrl: - /// - repositoriesUrl: - /// - slug: - /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment - public init( - id: Swift.Int, - nodeId: Swift.String, - url: Swift.String, - membersUrl: Swift.String, - name: Swift.String, - description: Swift.String? = nil, - permission: Swift.String, - privacy: Swift.String? = nil, - notificationSetting: Swift.String? = nil, - htmlUrl: Swift.String, - repositoriesUrl: Swift.String, - slug: Swift.String, - ldapDn: Swift.String? = nil - ) { - self.id = id - self.nodeId = nodeId - self.url = url - self.membersUrl = membersUrl - self.name = name - self.description = description - self.permission = permission - self.privacy = privacy - self.notificationSetting = notificationSetting - self.htmlUrl = htmlUrl - self.repositoriesUrl = repositoriesUrl - self.slug = slug - self.ldapDn = ldapDn - } - public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" - case url - case membersUrl = "members_url" - case name - case description - case permission - case privacy - case notificationSetting = "notification_setting" - case htmlUrl = "html_url" - case repositoriesUrl = "repositories_url" - case slug - case ldapDn = "ldap_dn" - } - } - /// Groups of organization members that gives permissions on specified repositories. - /// - /// - Remark: Generated from `#/components/schemas/team`. - public struct Team: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/team/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/team/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/team/slug`. - public var slug: Swift.String - /// - Remark: Generated from `#/components/schemas/team/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/notification_setting`. - public var notificationSetting: Swift.String? - /// - Remark: Generated from `#/components/schemas/team/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public struct PermissionsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. - public var pull: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. - public var triage: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/push`. - public var push: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. - public var maintain: Swift.Bool - /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. - public var admin: Swift.Bool - /// Creates a new `PermissionsPayload`. - /// - /// - Parameters: - /// - pull: - /// - triage: - /// - push: - /// - maintain: - /// - admin: - public init( - pull: Swift.Bool, - triage: Swift.Bool, - push: Swift.Bool, - maintain: Swift.Bool, - admin: Swift.Bool - ) { - self.pull = pull - self.triage = triage - self.push = push - self.maintain = maintain - self.admin = admin - } - public enum CodingKeys: String, CodingKey { - case pull - case triage - case push - case maintain - case admin - } - } - /// - Remark: Generated from `#/components/schemas/team/permissions`. - public var permissions: Components.Schemas.Team.PermissionsPayload? - /// - Remark: Generated from `#/components/schemas/team/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/team/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/team/members_url`. - public var membersUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/team/repositories_url`. - public var repositoriesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/team/parent`. - public var parent: Components.Schemas.NullableTeamSimple? - /// Creates a new `Team`. - /// - /// - Parameters: - /// - id: - /// - nodeId: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notificationSetting: - /// - permission: - /// - permissions: - /// - url: - /// - htmlUrl: - /// - membersUrl: - /// - repositoriesUrl: - /// - parent: - public init( - id: Swift.Int, - nodeId: Swift.String, - name: Swift.String, - slug: Swift.String, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notificationSetting: Swift.String? = nil, - permission: Swift.String, - permissions: Components.Schemas.Team.PermissionsPayload? = nil, - url: Swift.String, - htmlUrl: Swift.String, - membersUrl: Swift.String, - repositoriesUrl: Swift.String, - parent: Components.Schemas.NullableTeamSimple? = nil - ) { - self.id = id - self.nodeId = nodeId - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notificationSetting = notificationSetting - self.permission = permission - self.permissions = permissions - self.url = url - self.htmlUrl = htmlUrl - self.membersUrl = membersUrl - self.repositoriesUrl = repositoriesUrl - self.parent = parent - } - public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" - case name - case slug - case description - case privacy - case notificationSetting = "notification_setting" - case permission - case permissions - case url - case htmlUrl = "html_url" - case membersUrl = "members_url" - case repositoriesUrl = "repositories_url" - case parent + case customProperties = "custom_properties" } } /// Custom property name and associated value @@ -9698,6 +9560,818 @@ public enum Components { case value } } + /// An object without any properties. + /// + /// - Remark: Generated from `#/components/schemas/empty-object`. + public struct EmptyObject: Codable, Hashable, Sendable { + /// Creates a new `EmptyObject`. + public init() {} + public init(from decoder: any Decoder) throws { + try decoder.ensureNoAdditionalProperties(knownKeys: []) + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct NullableTeamSimple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var nodeId: Swift.String + /// URL for the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var membersUrl: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notificationSetting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositoriesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? + /// Creates a new `NullableTeamSimple`. + /// + /// - Parameters: + /// - id: Unique identifier of the team + /// - nodeId: + /// - url: URL for the team + /// - membersUrl: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notificationSetting: The notification setting the team has set + /// - htmlUrl: + /// - repositoriesUrl: + /// - slug: + /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs + public init( + id: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + membersUrl: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notificationSetting: Swift.String? = nil, + htmlUrl: Swift.String, + repositoriesUrl: Swift.String, + slug: Swift.String, + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.membersUrl = membersUrl + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notificationSetting = notificationSetting + self.htmlUrl = htmlUrl + self.repositoriesUrl = repositoriesUrl + self.slug = slug + self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case membersUrl = "members_url" + case name + case description + case permission + case privacy + case notificationSetting = "notification_setting" + case htmlUrl = "html_url" + case repositoriesUrl = "repositories_url" + case slug + case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/team`. + public struct Team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notificationSetting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `PermissionsPayload`. + /// + /// - Parameters: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: + public init( + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool + ) { + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin + } + public enum CodingKeys: String, CodingKey { + case pull + case triage + case push + case maintain + case admin + } + } + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.Team.PermissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var membersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.NullableTeamSimple? + /// Creates a new `Team`. + /// + /// - Parameters: + /// - id: + /// - nodeId: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notificationSetting: + /// - permission: + /// - permissions: + /// - url: + /// - htmlUrl: + /// - membersUrl: + /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs + /// - parent: + public init( + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notificationSetting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.Team.PermissionsPayload? = nil, + url: Swift.String, + htmlUrl: Swift.String, + membersUrl: Swift.String, + repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, + parent: Components.Schemas.NullableTeamSimple? = nil + ) { + self.id = id + self.nodeId = nodeId + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notificationSetting = notificationSetting + self.permission = permission + self.permissions = permissions + self.url = url + self.htmlUrl = htmlUrl + self.membersUrl = membersUrl + self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId + self.parent = parent + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case name + case slug + case description + case privacy + case notificationSetting = "notification_setting" + case permission + case permissions + case url + case htmlUrl = "html_url" + case membersUrl = "members_url" + case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" + case parent + } + } + /// Hypermedia Link + /// + /// - Remark: Generated from `#/components/schemas/link`. + public struct Link: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/link/href`. + public var href: Swift.String + /// Creates a new `Link`. + /// + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } + } + /// The status of auto merging a pull request. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge`. + public struct AutoMerge: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/auto-merge/enabled_by`. + public var enabledBy: Components.Schemas.SimpleUser + /// The merge method to use. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + @frozen public enum MergeMethodPayload: String, Codable, Hashable, Sendable, CaseIterable { + case merge = "merge" + case squash = "squash" + case rebase = "rebase" + } + /// The merge method to use. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + public var mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload + /// Title for the merge commit message. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_title`. + public var commitTitle: Swift.String + /// Commit message for the merge commit. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_message`. + public var commitMessage: Swift.String + /// Creates a new `AutoMerge`. + /// + /// - Parameters: + /// - enabledBy: + /// - mergeMethod: The merge method to use. + /// - commitTitle: Title for the merge commit message. + /// - commitMessage: Commit message for the merge commit. + public init( + enabledBy: Components.Schemas.SimpleUser, + mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload, + commitTitle: Swift.String, + commitMessage: Swift.String + ) { + self.enabledBy = enabledBy + self.mergeMethod = mergeMethod + self.commitTitle = commitTitle + self.commitMessage = commitMessage + } + public enum CodingKeys: String, CodingKey { + case enabledBy = "enabled_by" + case mergeMethod = "merge_method" + case commitTitle = "commit_title" + case commitMessage = "commit_message" + } + } + /// Pull Request Simple + /// + /// - Remark: Generated from `#/components/schemas/pull-request-simple`. + public struct PullRequestSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-simple/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/diff_url`. + public var diffUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/patch_url`. + public var patchUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/issue_url`. + public var issueUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/commits_url`. + public var commitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comments_url`. + public var reviewCommentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comment_url`. + public var reviewCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-simple/state`. + public var state: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/locked`. + public var locked: Swift.Bool + /// - Remark: Generated from `#/components/schemas/pull-request-simple/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload`. + public struct LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/description`. + public var description: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/color`. + public var color: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/default`. + public var _default: Swift.Bool + /// Creates a new `LabelsPayloadPayload`. + /// + /// - Parameters: + /// - id: + /// - nodeId: + /// - url: + /// - name: + /// - description: + /// - color: + /// - _default: + public init( + id: Swift.Int64, + nodeId: Swift.String, + url: Swift.String, + name: Swift.String, + description: Swift.String, + color: Swift.String, + _default: Swift.Bool + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.name = name + self.description = description + self.color = color + self._default = _default + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case name + case description + case color + case _default = "default" + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public typealias LabelsPayload = [Components.Schemas.PullRequestSimple.LabelsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public var labels: Components.Schemas.PullRequestSimple.LabelsPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/milestone`. + public var milestone: Components.Schemas.NullableMilestone? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/active_lock_reason`. + public var activeLockReason: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/closed_at`. + public var closedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merged_at`. + public var mergedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merge_commit_sha`. + public var mergeCommitSha: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignee`. + public var assignee: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_reviewers`. + public var requestedReviewers: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_teams`. + public var requestedTeams: [Components.Schemas.Team]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public struct HeadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `HeadPayload`. + /// + /// - Parameters: + /// - label: + /// - ref: + /// - repo: + /// - sha: + /// - user: + public init( + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, + sha: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil + ) { + self.label = label + self.ref = ref + self.repo = repo + self.sha = sha + self.user = user + } + public enum CodingKeys: String, CodingKey { + case label + case ref + case repo + case sha + case user + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public var head: Components.Schemas.PullRequestSimple.HeadPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `BasePayload`. + /// + /// - Parameters: + /// - label: + /// - ref: + /// - repo: + /// - sha: + /// - user: + public init( + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, + sha: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil + ) { + self.label = label + self.ref = ref + self.repo = repo + self.sha = sha + self.user = user + } + public enum CodingKeys: String, CodingKey { + case label + case ref + case repo + case sha + case user + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public var base: Components.Schemas.PullRequestSimple.BasePayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public struct _LinksPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/comments`. + public var comments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/commits`. + public var commits: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/statuses`. + public var statuses: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/html`. + public var html: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/issue`. + public var issue: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comments`. + public var reviewComments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comment`. + public var reviewComment: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/self`. + public var _self: Components.Schemas.Link + /// Creates a new `_LinksPayload`. + /// + /// - Parameters: + /// - comments: + /// - commits: + /// - statuses: + /// - html: + /// - issue: + /// - reviewComments: + /// - reviewComment: + /// - _self: + public init( + comments: Components.Schemas.Link, + commits: Components.Schemas.Link, + statuses: Components.Schemas.Link, + html: Components.Schemas.Link, + issue: Components.Schemas.Link, + reviewComments: Components.Schemas.Link, + reviewComment: Components.Schemas.Link, + _self: Components.Schemas.Link + ) { + self.comments = comments + self.commits = commits + self.statuses = statuses + self.html = html + self.issue = issue + self.reviewComments = reviewComments + self.reviewComment = reviewComment + self._self = _self + } + public enum CodingKeys: String, CodingKey { + case comments + case commits + case statuses + case html + case issue + case reviewComments = "review_comments" + case reviewComment = "review_comment" + case _self = "self" + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public var _links: Components.Schemas.PullRequestSimple._LinksPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation + /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. + public var autoMerge: Components.Schemas.AutoMerge? + /// Indicates whether or not the pull request is a draft. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. + public var draft: Swift.Bool? + /// Creates a new `PullRequestSimple`. + /// + /// - Parameters: + /// - url: + /// - id: + /// - nodeId: + /// - htmlUrl: + /// - diffUrl: + /// - patchUrl: + /// - issueUrl: + /// - commitsUrl: + /// - reviewCommentsUrl: + /// - reviewCommentUrl: + /// - commentsUrl: + /// - statusesUrl: + /// - number: + /// - state: + /// - locked: + /// - title: + /// - user: + /// - body: + /// - labels: + /// - milestone: + /// - activeLockReason: + /// - createdAt: + /// - updatedAt: + /// - closedAt: + /// - mergedAt: + /// - mergeCommitSha: + /// - assignee: + /// - assignees: + /// - requestedReviewers: + /// - requestedTeams: + /// - head: + /// - base: + /// - _links: + /// - authorAssociation: + /// - autoMerge: + /// - draft: Indicates whether or not the pull request is a draft. + public init( + url: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + htmlUrl: Swift.String, + diffUrl: Swift.String, + patchUrl: Swift.String, + issueUrl: Swift.String, + commitsUrl: Swift.String, + reviewCommentsUrl: Swift.String, + reviewCommentUrl: Swift.String, + commentsUrl: Swift.String, + statusesUrl: Swift.String, + number: Swift.Int, + state: Swift.String, + locked: Swift.Bool, + title: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil, + body: Swift.String? = nil, + labels: Components.Schemas.PullRequestSimple.LabelsPayload, + milestone: Components.Schemas.NullableMilestone? = nil, + activeLockReason: Swift.String? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + closedAt: Foundation.Date? = nil, + mergedAt: Foundation.Date? = nil, + mergeCommitSha: Swift.String? = nil, + assignee: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil, + requestedReviewers: [Components.Schemas.SimpleUser]? = nil, + requestedTeams: [Components.Schemas.Team]? = nil, + head: Components.Schemas.PullRequestSimple.HeadPayload, + base: Components.Schemas.PullRequestSimple.BasePayload, + _links: Components.Schemas.PullRequestSimple._LinksPayload, + authorAssociation: Components.Schemas.AuthorAssociation, + autoMerge: Components.Schemas.AutoMerge? = nil, + draft: Swift.Bool? = nil + ) { + self.url = url + self.id = id + self.nodeId = nodeId + self.htmlUrl = htmlUrl + self.diffUrl = diffUrl + self.patchUrl = patchUrl + self.issueUrl = issueUrl + self.commitsUrl = commitsUrl + self.reviewCommentsUrl = reviewCommentsUrl + self.reviewCommentUrl = reviewCommentUrl + self.commentsUrl = commentsUrl + self.statusesUrl = statusesUrl + self.number = number + self.state = state + self.locked = locked + self.title = title + self.user = user + self.body = body + self.labels = labels + self.milestone = milestone + self.activeLockReason = activeLockReason + self.createdAt = createdAt + self.updatedAt = updatedAt + self.closedAt = closedAt + self.mergedAt = mergedAt + self.mergeCommitSha = mergeCommitSha + self.assignee = assignee + self.assignees = assignees + self.requestedReviewers = requestedReviewers + self.requestedTeams = requestedTeams + self.head = head + self.base = base + self._links = _links + self.authorAssociation = authorAssociation + self.autoMerge = autoMerge + self.draft = draft + } + public enum CodingKeys: String, CodingKey { + case url + case id + case nodeId = "node_id" + case htmlUrl = "html_url" + case diffUrl = "diff_url" + case patchUrl = "patch_url" + case issueUrl = "issue_url" + case commitsUrl = "commits_url" + case reviewCommentsUrl = "review_comments_url" + case reviewCommentUrl = "review_comment_url" + case commentsUrl = "comments_url" + case statusesUrl = "statuses_url" + case number + case state + case locked + case title + case user + case body + case labels + case milestone + case activeLockReason = "active_lock_reason" + case createdAt = "created_at" + case updatedAt = "updated_at" + case closedAt = "closed_at" + case mergedAt = "merged_at" + case mergeCommitSha = "merge_commit_sha" + case assignee + case assignees + case requestedReviewers = "requested_reviewers" + case requestedTeams = "requested_teams" + case head + case base + case _links + case authorAssociation = "author_association" + case autoMerge = "auto_merge" + case draft + } + } /// A repository on GitHub. /// /// - Remark: Generated from `#/components/schemas/nullable-repository`. @@ -10049,6 +10723,35 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-repository/anonymous_access_enabled`. public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.NullableRepository.CodeSearchIndexStatusPayload? /// Creates a new `NullableRepository`. /// /// - Parameters: @@ -10147,6 +10850,7 @@ public enum Components { /// - masterBranch: /// - starredAt: /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository public init( id: Swift.Int64, nodeId: Swift.String, @@ -10242,7 +10946,8 @@ public enum Components { watchers: Swift.Int, masterBranch: Swift.String? = nil, starredAt: Swift.String? = nil, - anonymousAccessEnabled: Swift.Bool? = nil + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.NullableRepository.CodeSearchIndexStatusPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -10339,6 +11044,7 @@ public enum Components { self.masterBranch = masterBranch self.starredAt = starredAt self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus } public enum CodingKeys: String, CodingKey { case id @@ -10436,6 +11142,7 @@ public enum Components { case masterBranch = "master_branch" case starredAt = "starred_at" case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" } } /// Code of Conduct Simple @@ -11255,7 +11962,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor`. public struct RepositoryRulesetBypassActor: Codable, Hashable, Sendable { - /// The ID of the actor that can bypass a ruleset. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. + /// The ID of the actor that can bypass a ruleset. Required for `Integration`, `RepositoryRole`, and `Team` actor types. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. /// /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/actor_id`. public var actorId: Swift.Int? @@ -11273,23 +11980,24 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/actor_type`. public var actorType: Components.Schemas.RepositoryRulesetBypassActor.ActorTypePayload - /// When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. + /// When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. When `bypass_mode` is `exempt`, rules will not be run for that actor and a bypass audit entry will not be created. /// /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/bypass_mode`. @frozen public enum BypassModePayload: String, Codable, Hashable, Sendable, CaseIterable { case always = "always" case pullRequest = "pull_request" + case exempt = "exempt" } - /// When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. + /// When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. When `bypass_mode` is `exempt`, rules will not be run for that actor and a bypass audit entry will not be created. /// /// - Remark: Generated from `#/components/schemas/repository-ruleset-bypass-actor/bypass_mode`. public var bypassMode: Components.Schemas.RepositoryRulesetBypassActor.BypassModePayload? /// Creates a new `RepositoryRulesetBypassActor`. /// /// - Parameters: - /// - actorId: The ID of the actor that can bypass a ruleset. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. + /// - actorId: The ID of the actor that can bypass a ruleset. Required for `Integration`, `RepositoryRole`, and `Team` actor types. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. /// - actorType: The type of actor that can bypass a ruleset. - /// - bypassMode: When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. + /// - bypassMode: When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. Also, `pull_request` is only applicable to branch rulesets. When `bypass_mode` is `exempt`, rules will not be run for that actor and a bypass audit entry will not be created. public init( actorId: Swift.Int? = nil, actorType: Components.Schemas.RepositoryRulesetBypassActor.ActorTypePayload, @@ -11979,7 +12687,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/allowed_merge_methods`. public var allowedMergeMethods: Components.Schemas.RepositoryRulePullRequest.ParametersPayload.AllowedMergeMethodsPayload? - /// Automatically request review from Copilot for new pull requests, if the author has access to Copilot code review. + /// Request Copilot code review for new pull requests automatically if the author has access to Copilot code review. /// /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/automatic_copilot_code_review_enabled`. public var automaticCopilotCodeReviewEnabled: Swift.Bool? @@ -12007,7 +12715,7 @@ public enum Components { /// /// - Parameters: /// - allowedMergeMethods: Array of allowed merge methods. Allowed values include `merge`, `squash`, and `rebase`. At least one option must be enabled. - /// - automaticCopilotCodeReviewEnabled: Automatically request review from Copilot for new pull requests, if the author has access to Copilot code review. + /// - automaticCopilotCodeReviewEnabled: Request Copilot code review for new pull requests automatically if the author has access to Copilot code review. /// - dismissStaleReviewsOnPush: New, reviewable commits pushed will dismiss previous pull request review approvals. /// - requireCodeOwnerReview: Require an approving review in pull requests that modify files that have a designated code owner. /// - requireLastPushApproval: Whether the most recent reviewable push must be approved by someone other than the person who pushed it. @@ -12965,6 +13673,62 @@ public enum Components { case parameters } } + /// Request Copilot code review for new pull requests automatically if the author has access to Copilot code review. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review`. + public struct RepositoryRuleCopilotCodeReview: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case copilotCodeReview = "copilot_code_review" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/type`. + public var _type: Components.Schemas.RepositoryRuleCopilotCodeReview._TypePayload + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/parameters`. + public struct ParametersPayload: Codable, Hashable, Sendable { + /// Copilot automatically reviews draft pull requests before they are marked as ready for review. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/parameters/review_draft_pull_requests`. + public var reviewDraftPullRequests: Swift.Bool? + /// Copilot automatically reviews each new push to the pull request. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/parameters/review_on_push`. + public var reviewOnPush: Swift.Bool? + /// Creates a new `ParametersPayload`. + /// + /// - Parameters: + /// - reviewDraftPullRequests: Copilot automatically reviews draft pull requests before they are marked as ready for review. + /// - reviewOnPush: Copilot automatically reviews each new push to the pull request. + public init( + reviewDraftPullRequests: Swift.Bool? = nil, + reviewOnPush: Swift.Bool? = nil + ) { + self.reviewDraftPullRequests = reviewDraftPullRequests + self.reviewOnPush = reviewOnPush + } + public enum CodingKeys: String, CodingKey { + case reviewDraftPullRequests = "review_draft_pull_requests" + case reviewOnPush = "review_on_push" + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-copilot-code-review/parameters`. + public var parameters: Components.Schemas.RepositoryRuleCopilotCodeReview.ParametersPayload? + /// Creates a new `RepositoryRuleCopilotCodeReview`. + /// + /// - Parameters: + /// - _type: + /// - parameters: + public init( + _type: Components.Schemas.RepositoryRuleCopilotCodeReview._TypePayload, + parameters: Components.Schemas.RepositoryRuleCopilotCodeReview.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`. @@ -13011,6 +13775,8 @@ public enum Components { case RepositoryRuleWorkflows(Components.Schemas.RepositoryRuleWorkflows) /// - Remark: Generated from `#/components/schemas/repository-rule/case21`. case RepositoryRuleCodeScanning(Components.Schemas.RepositoryRuleCodeScanning) + /// - Remark: Generated from `#/components/schemas/repository-rule/case22`. + case RepositoryRuleCopilotCodeReview(Components.Schemas.RepositoryRuleCopilotCodeReview) public init(from decoder: any Decoder) throws { var errors: [any Error] = [] do { @@ -13139,6 +13905,12 @@ public enum Components { } catch { errors.append(error) } + do { + self = .RepositoryRuleCopilotCodeReview(try .init(from: decoder)) + return + } catch { + errors.append(error) + } throw Swift.DecodingError.failedToDecodeOneOfSchema( type: Self.self, codingPath: decoder.codingPath, @@ -13189,6 +13961,8 @@ public enum Components { try value.encode(to: encoder) case let .RepositoryRuleCodeScanning(value): try value.encode(to: encoder) + case let .RepositoryRuleCopilotCodeReview(value): + try value.encode(to: encoder) } } } @@ -13247,6 +14021,7 @@ public enum Components { case always = "always" case pullRequestsOnly = "pull_requests_only" case never = "never" + case exempt = "exempt" } /// The bypass type of the user making the API request for this ruleset. This field is only returned when /// querying the repository-level endpoint. @@ -13432,6 +14207,223 @@ public enum Components { case updatedAt = "updated_at" } } + /// A repository rule. + /// + /// - Remark: Generated from `#/components/schemas/org-rules`. + @frozen public enum OrgRules: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/org-rules/case1`. + case RepositoryRuleCreation(Components.Schemas.RepositoryRuleCreation) + /// - Remark: Generated from `#/components/schemas/org-rules/case2`. + case RepositoryRuleUpdate(Components.Schemas.RepositoryRuleUpdate) + /// - Remark: Generated from `#/components/schemas/org-rules/case3`. + case RepositoryRuleDeletion(Components.Schemas.RepositoryRuleDeletion) + /// - Remark: Generated from `#/components/schemas/org-rules/case4`. + case RepositoryRuleRequiredLinearHistory(Components.Schemas.RepositoryRuleRequiredLinearHistory) + /// - Remark: Generated from `#/components/schemas/org-rules/case5`. + case RepositoryRuleRequiredDeployments(Components.Schemas.RepositoryRuleRequiredDeployments) + /// - Remark: Generated from `#/components/schemas/org-rules/case6`. + case RepositoryRuleRequiredSignatures(Components.Schemas.RepositoryRuleRequiredSignatures) + /// - Remark: Generated from `#/components/schemas/org-rules/case7`. + case RepositoryRulePullRequest(Components.Schemas.RepositoryRulePullRequest) + /// - Remark: Generated from `#/components/schemas/org-rules/case8`. + case RepositoryRuleRequiredStatusChecks(Components.Schemas.RepositoryRuleRequiredStatusChecks) + /// - Remark: Generated from `#/components/schemas/org-rules/case9`. + case RepositoryRuleNonFastForward(Components.Schemas.RepositoryRuleNonFastForward) + /// - Remark: Generated from `#/components/schemas/org-rules/case10`. + case RepositoryRuleCommitMessagePattern(Components.Schemas.RepositoryRuleCommitMessagePattern) + /// - Remark: Generated from `#/components/schemas/org-rules/case11`. + case RepositoryRuleCommitAuthorEmailPattern(Components.Schemas.RepositoryRuleCommitAuthorEmailPattern) + /// - Remark: Generated from `#/components/schemas/org-rules/case12`. + case RepositoryRuleCommitterEmailPattern(Components.Schemas.RepositoryRuleCommitterEmailPattern) + /// - Remark: Generated from `#/components/schemas/org-rules/case13`. + case RepositoryRuleBranchNamePattern(Components.Schemas.RepositoryRuleBranchNamePattern) + /// - Remark: Generated from `#/components/schemas/org-rules/case14`. + case RepositoryRuleTagNamePattern(Components.Schemas.RepositoryRuleTagNamePattern) + /// - Remark: Generated from `#/components/schemas/org-rules/case15`. + case RepositoryRuleFilePathRestriction(Components.Schemas.RepositoryRuleFilePathRestriction) + /// - Remark: Generated from `#/components/schemas/org-rules/case16`. + case RepositoryRuleMaxFilePathLength(Components.Schemas.RepositoryRuleMaxFilePathLength) + /// - Remark: Generated from `#/components/schemas/org-rules/case17`. + case RepositoryRuleFileExtensionRestriction(Components.Schemas.RepositoryRuleFileExtensionRestriction) + /// - Remark: Generated from `#/components/schemas/org-rules/case18`. + case RepositoryRuleMaxFileSize(Components.Schemas.RepositoryRuleMaxFileSize) + /// - Remark: Generated from `#/components/schemas/org-rules/case19`. + case RepositoryRuleWorkflows(Components.Schemas.RepositoryRuleWorkflows) + /// - Remark: Generated from `#/components/schemas/org-rules/case20`. + case RepositoryRuleCodeScanning(Components.Schemas.RepositoryRuleCodeScanning) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .RepositoryRuleCreation(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleUpdate(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleDeletion(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleRequiredLinearHistory(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleRequiredDeployments(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleRequiredSignatures(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRulePullRequest(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleRequiredStatusChecks(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleNonFastForward(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleCommitMessagePattern(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleCommitAuthorEmailPattern(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleCommitterEmailPattern(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleBranchNamePattern(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleTagNamePattern(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleFilePathRestriction(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleMaxFilePathLength(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleFileExtensionRestriction(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleMaxFileSize(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleWorkflows(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .RepositoryRuleCodeScanning(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .RepositoryRuleCreation(value): + try value.encode(to: encoder) + case let .RepositoryRuleUpdate(value): + try value.encode(to: encoder) + case let .RepositoryRuleDeletion(value): + try value.encode(to: encoder) + case let .RepositoryRuleRequiredLinearHistory(value): + try value.encode(to: encoder) + case let .RepositoryRuleRequiredDeployments(value): + try value.encode(to: encoder) + case let .RepositoryRuleRequiredSignatures(value): + try value.encode(to: encoder) + case let .RepositoryRulePullRequest(value): + try value.encode(to: encoder) + case let .RepositoryRuleRequiredStatusChecks(value): + try value.encode(to: encoder) + case let .RepositoryRuleNonFastForward(value): + try value.encode(to: encoder) + case let .RepositoryRuleCommitMessagePattern(value): + try value.encode(to: encoder) + case let .RepositoryRuleCommitAuthorEmailPattern(value): + try value.encode(to: encoder) + case let .RepositoryRuleCommitterEmailPattern(value): + try value.encode(to: encoder) + case let .RepositoryRuleBranchNamePattern(value): + try value.encode(to: encoder) + case let .RepositoryRuleTagNamePattern(value): + try value.encode(to: encoder) + case let .RepositoryRuleFilePathRestriction(value): + try value.encode(to: encoder) + case let .RepositoryRuleMaxFilePathLength(value): + try value.encode(to: encoder) + case let .RepositoryRuleFileExtensionRestriction(value): + try value.encode(to: encoder) + case let .RepositoryRuleMaxFileSize(value): + try value.encode(to: encoder) + case let .RepositoryRuleWorkflows(value): + try value.encode(to: encoder) + case let .RepositoryRuleCodeScanning(value): + try value.encode(to: encoder) + } + } + } /// - Remark: Generated from `#/components/schemas/RuleSuites`. public struct RuleSuitesPayload: Codable, Hashable, Sendable { /// The unique identifier of the rule insight. @@ -13565,11 +14557,11 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/rule-suite/actor_name`. public var actorName: Swift.String? - /// The first commit sha before the push evaluation. + /// The previous commit SHA of the ref. /// /// - Remark: Generated from `#/components/schemas/rule-suite/before_sha`. public var beforeSha: Swift.String? - /// The last commit sha in the push evaluation. + /// The new commit SHA of the ref. /// /// - Remark: Generated from `#/components/schemas/rule-suite/after_sha`. public var afterSha: Swift.String? @@ -13724,8 +14716,8 @@ public enum Components { /// - id: The unique identifier of the rule insight. /// - actorId: The number that identifies the user. /// - actorName: The handle for the GitHub user account. - /// - beforeSha: The first commit sha before the push evaluation. - /// - afterSha: The last commit sha in the push evaluation. + /// - beforeSha: The previous commit SHA of the ref. + /// - afterSha: The new commit SHA of the ref. /// - ref: The ref name that the evaluation ran on. /// - repositoryId: The ID of the repository associated with the rule evaluation. /// - repositoryName: The name of the repository without the `.git` extension. @@ -14172,6 +15164,8 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/autolink/is_alphanumeric`. public var isAlphanumeric: Swift.Bool + /// - Remark: Generated from `#/components/schemas/autolink/updated_at`. + public var updatedAt: Foundation.Date? /// Creates a new `Autolink`. /// /// - Parameters: @@ -14179,22 +15173,26 @@ public enum Components { /// - keyPrefix: The prefix of a key that is linkified. /// - urlTemplate: A template for the target URL that is generated if a key was found. /// - isAlphanumeric: Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. + /// - updatedAt: public init( id: Swift.Int, keyPrefix: Swift.String, urlTemplate: Swift.String, - isAlphanumeric: Swift.Bool + isAlphanumeric: Swift.Bool, + updatedAt: Foundation.Date? = nil ) { self.id = id self.keyPrefix = keyPrefix self.urlTemplate = urlTemplate self.isAlphanumeric = isAlphanumeric + self.updatedAt = updatedAt } public enum CodingKeys: String, CodingKey { case id case keyPrefix = "key_prefix" case urlTemplate = "url_template" case isAlphanumeric = "is_alphanumeric" + case updatedAt = "updated_at" } } /// Check Dependabot security updates @@ -14615,99 +15613,8 @@ public enum Components { public typealias UsersPayload = [Components.Schemas.BranchRestrictionPolicy.UsersPayloadPayload] /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/users`. public var users: Components.Schemas.BranchRestrictionPolicy.UsersPayload - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload`. - public struct TeamsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/id`. - public var id: Swift.Int? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/node_id`. - public var nodeId: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/url`. - public var url: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/html_url`. - public var htmlUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/slug`. - public var slug: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/privacy`. - public var privacy: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/notification_setting`. - public var notificationSetting: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/permission`. - public var permission: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/members_url`. - public var membersUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/repositories_url`. - public var repositoriesUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/TeamsPayload/parent`. - public var parent: Swift.String? - /// Creates a new `TeamsPayloadPayload`. - /// - /// - Parameters: - /// - id: - /// - nodeId: - /// - url: - /// - htmlUrl: - /// - name: - /// - slug: - /// - description: - /// - privacy: - /// - notificationSetting: - /// - permission: - /// - membersUrl: - /// - repositoriesUrl: - /// - parent: - public init( - id: Swift.Int? = nil, - nodeId: Swift.String? = nil, - url: Swift.String? = nil, - htmlUrl: Swift.String? = nil, - name: Swift.String? = nil, - slug: Swift.String? = nil, - description: Swift.String? = nil, - privacy: Swift.String? = nil, - notificationSetting: Swift.String? = nil, - permission: Swift.String? = nil, - membersUrl: Swift.String? = nil, - repositoriesUrl: Swift.String? = nil, - parent: Swift.String? = nil - ) { - self.id = id - self.nodeId = nodeId - self.url = url - self.htmlUrl = htmlUrl - self.name = name - self.slug = slug - self.description = description - self.privacy = privacy - self.notificationSetting = notificationSetting - self.permission = permission - self.membersUrl = membersUrl - self.repositoriesUrl = repositoriesUrl - self.parent = parent - } - public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" - case url - case htmlUrl = "html_url" - case name - case slug - case description - case privacy - case notificationSetting = "notification_setting" - case permission - case membersUrl = "members_url" - case repositoriesUrl = "repositories_url" - case parent - } - } /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/teams`. - public typealias TeamsPayload = [Components.Schemas.BranchRestrictionPolicy.TeamsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/teams`. - public var teams: Components.Schemas.BranchRestrictionPolicy.TeamsPayload + public var teams: [Components.Schemas.Team] /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload`. public struct AppsPayloadPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/branch-restriction-policy/AppsPayload/id`. @@ -15007,7 +15914,7 @@ public enum Components { teamsUrl: Swift.String, appsUrl: Swift.String, users: Components.Schemas.BranchRestrictionPolicy.UsersPayload, - teams: Components.Schemas.BranchRestrictionPolicy.TeamsPayload, + teams: [Components.Schemas.Team], apps: Components.Schemas.BranchRestrictionPolicy.AppsPayload ) { self.url = url @@ -15416,7 +16323,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/diff-entry`. public struct DiffEntry: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/diff-entry/sha`. - public var sha: Swift.String + public var sha: Swift.String? /// - Remark: Generated from `#/components/schemas/diff-entry/filename`. public var filename: Swift.String /// - Remark: Generated from `#/components/schemas/diff-entry/status`. @@ -15462,7 +16369,7 @@ public enum Components { /// - patch: /// - previousFilename: public init( - sha: Swift.String, + sha: Swift.String? = nil, filename: Swift.String, status: Components.Schemas.DiffEntry.StatusPayload, additions: Swift.Int, @@ -16948,697 +17855,202 @@ public enum Components { case gravatarId = "gravatar_id" case url case htmlUrl = "html_url" - case followersUrl = "followers_url" - case followingUrl = "following_url" - case gistsUrl = "gists_url" - case starredUrl = "starred_url" - case subscriptionsUrl = "subscriptions_url" - case organizationsUrl = "organizations_url" - case reposUrl = "repos_url" - case eventsUrl = "events_url" - case receivedEventsUrl = "received_events_url" - case _type = "type" - case siteAdmin = "site_admin" - case permissions - case roleName = "role_name" - case userViewType = "user_view_type" - } - } - /// Repository Collaborator Permission - /// - /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission`. - public struct RepositoryCollaboratorPermission: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission/permission`. - public var permission: Swift.String - /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission/role_name`. - public var roleName: Swift.String - /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission/user`. - public var user: Components.Schemas.NullableCollaborator? - /// Creates a new `RepositoryCollaboratorPermission`. - /// - /// - Parameters: - /// - permission: - /// - roleName: - /// - user: - public init( - permission: Swift.String, - roleName: Swift.String, - user: Components.Schemas.NullableCollaborator? = nil - ) { - self.permission = permission - self.roleName = roleName - self.user = user - } - public enum CodingKeys: String, CodingKey { - case permission - case roleName = "role_name" - case user - } - } - /// Commit Comment - /// - /// - Remark: Generated from `#/components/schemas/commit-comment`. - public struct CommitComment: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/commit-comment/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/commit-comment/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/commit-comment/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/commit-comment/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/commit-comment/body`. - public var body: Swift.String - /// - Remark: Generated from `#/components/schemas/commit-comment/path`. - public var path: Swift.String? - /// - Remark: Generated from `#/components/schemas/commit-comment/position`. - public var position: Swift.Int? - /// - Remark: Generated from `#/components/schemas/commit-comment/line`. - public var line: Swift.Int? - /// - Remark: Generated from `#/components/schemas/commit-comment/commit_id`. - public var commitId: Swift.String - /// - Remark: Generated from `#/components/schemas/commit-comment/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/commit-comment/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/commit-comment/updated_at`. - public var updatedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/commit-comment/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation - /// - Remark: Generated from `#/components/schemas/commit-comment/reactions`. - public var reactions: Components.Schemas.ReactionRollup? - /// Creates a new `CommitComment`. - /// - /// - Parameters: - /// - htmlUrl: - /// - url: - /// - id: - /// - nodeId: - /// - body: - /// - path: - /// - position: - /// - line: - /// - commitId: - /// - user: - /// - createdAt: - /// - updatedAt: - /// - authorAssociation: - /// - reactions: - public init( - htmlUrl: Swift.String, - url: Swift.String, - id: Swift.Int, - nodeId: Swift.String, - body: Swift.String, - path: Swift.String? = nil, - position: Swift.Int? = nil, - line: Swift.Int? = nil, - commitId: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil, - createdAt: Foundation.Date, - updatedAt: Foundation.Date, - authorAssociation: Components.Schemas.AuthorAssociation, - reactions: Components.Schemas.ReactionRollup? = nil - ) { - self.htmlUrl = htmlUrl - self.url = url - self.id = id - self.nodeId = nodeId - self.body = body - self.path = path - self.position = position - self.line = line - self.commitId = commitId - self.user = user - self.createdAt = createdAt - self.updatedAt = updatedAt - self.authorAssociation = authorAssociation - self.reactions = reactions - } - public enum CodingKeys: String, CodingKey { - case htmlUrl = "html_url" - case url - case id - case nodeId = "node_id" - case body - case path - case position - case line - case commitId = "commit_id" - case user - case createdAt = "created_at" - case updatedAt = "updated_at" - case authorAssociation = "author_association" - case reactions - } - } - /// Branch Short - /// - /// - Remark: Generated from `#/components/schemas/branch-short`. - public struct BranchShort: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-short/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/branch-short/commit`. - public struct CommitPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/branch-short/commit/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/branch-short/commit/url`. - public var url: Swift.String - /// Creates a new `CommitPayload`. - /// - /// - Parameters: - /// - sha: - /// - url: - public init( - sha: Swift.String, - url: Swift.String - ) { - self.sha = sha - self.url = url - } - public enum CodingKeys: String, CodingKey { - case sha - case url - } - } - /// - Remark: Generated from `#/components/schemas/branch-short/commit`. - public var commit: Components.Schemas.BranchShort.CommitPayload - /// - Remark: Generated from `#/components/schemas/branch-short/protected`. - public var protected: Swift.Bool - /// Creates a new `BranchShort`. - /// - /// - Parameters: - /// - name: - /// - commit: - /// - protected: - public init( - name: Swift.String, - commit: Components.Schemas.BranchShort.CommitPayload, - protected: Swift.Bool - ) { - self.name = name - self.commit = commit - self.protected = protected - } - public enum CodingKeys: String, CodingKey { - case name - case commit - case protected - } - } - /// Hypermedia Link - /// - /// - Remark: Generated from `#/components/schemas/link`. - public struct Link: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/link/href`. - public var href: Swift.String - /// Creates a new `Link`. - /// - /// - Parameters: - /// - href: - public init(href: Swift.String) { - self.href = href - } - public enum CodingKeys: String, CodingKey { - case href - } - } - /// The status of auto merging a pull request. - /// - /// - Remark: Generated from `#/components/schemas/auto-merge`. - public struct AutoMerge: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/auto-merge/enabled_by`. - public var enabledBy: Components.Schemas.SimpleUser - /// The merge method to use. - /// - /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. - @frozen public enum MergeMethodPayload: String, Codable, Hashable, Sendable, CaseIterable { - case merge = "merge" - case squash = "squash" - case rebase = "rebase" - } - /// The merge method to use. - /// - /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. - public var mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload - /// Title for the merge commit message. - /// - /// - Remark: Generated from `#/components/schemas/auto-merge/commit_title`. - public var commitTitle: Swift.String - /// Commit message for the merge commit. - /// - /// - Remark: Generated from `#/components/schemas/auto-merge/commit_message`. - public var commitMessage: Swift.String - /// Creates a new `AutoMerge`. - /// - /// - Parameters: - /// - enabledBy: - /// - mergeMethod: The merge method to use. - /// - commitTitle: Title for the merge commit message. - /// - commitMessage: Commit message for the merge commit. - public init( - enabledBy: Components.Schemas.SimpleUser, - mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload, - commitTitle: Swift.String, - commitMessage: Swift.String - ) { - self.enabledBy = enabledBy - self.mergeMethod = mergeMethod - self.commitTitle = commitTitle - self.commitMessage = commitMessage - } - public enum CodingKeys: String, CodingKey { - case enabledBy = "enabled_by" - case mergeMethod = "merge_method" - case commitTitle = "commit_title" - case commitMessage = "commit_message" - } - } - /// Pull Request Simple - /// - /// - Remark: Generated from `#/components/schemas/pull-request-simple`. - public struct PullRequestSimple: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-simple/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/diff_url`. - public var diffUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/patch_url`. - public var patchUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/issue_url`. - public var issueUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/commits_url`. - public var commitsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comments_url`. - public var reviewCommentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comment_url`. - public var reviewCommentUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/comments_url`. - public var commentsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/statuses_url`. - public var statusesUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/number`. - public var number: Swift.Int - /// - Remark: Generated from `#/components/schemas/pull-request-simple/state`. - public var state: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/locked`. - public var locked: Swift.Bool - /// - Remark: Generated from `#/components/schemas/pull-request-simple/title`. - public var title: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/body`. - public var body: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload`. - public struct LabelsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/id`. - public var id: Swift.Int64 - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/description`. - public var description: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/color`. - public var color: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/default`. - public var _default: Swift.Bool - /// Creates a new `LabelsPayloadPayload`. - /// - /// - Parameters: - /// - id: - /// - nodeId: - /// - url: - /// - name: - /// - description: - /// - color: - /// - _default: - public init( - id: Swift.Int64, - nodeId: Swift.String, - url: Swift.String, - name: Swift.String, - description: Swift.String, - color: Swift.String, - _default: Swift.Bool - ) { - self.id = id - self.nodeId = nodeId - self.url = url - self.name = name - self.description = description - self.color = color - self._default = _default - } - public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" - case url - case name - case description - case color - case _default = "default" - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. - public typealias LabelsPayload = [Components.Schemas.PullRequestSimple.LabelsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. - public var labels: Components.Schemas.PullRequestSimple.LabelsPayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/milestone`. - public var milestone: Components.Schemas.NullableMilestone? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/active_lock_reason`. - public var activeLockReason: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request-simple/updated_at`. - public var updatedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request-simple/closed_at`. - public var closedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/merged_at`. - public var mergedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/merge_commit_sha`. - public var mergeCommitSha: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignee`. - public var assignee: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignees`. - public var assignees: [Components.Schemas.SimpleUser]? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_reviewers`. - public var requestedReviewers: [Components.Schemas.SimpleUser]? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_teams`. - public var requestedTeams: [Components.Schemas.Team]? - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. - public struct HeadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/label`. - public var label: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/ref`. - public var ref: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/repo`. - public var repo: Components.Schemas.Repository - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// Creates a new `HeadPayload`. - /// - /// - Parameters: - /// - label: - /// - ref: - /// - repo: - /// - sha: - /// - user: - public init( - label: Swift.String, - ref: Swift.String, - repo: Components.Schemas.Repository, - sha: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil - ) { - self.label = label - self.ref = ref - self.repo = repo - self.sha = sha - self.user = user - } - public enum CodingKeys: String, CodingKey { - case label - case ref - case repo - case sha - case user - } + case followersUrl = "followers_url" + case followingUrl = "following_url" + case gistsUrl = "gists_url" + case starredUrl = "starred_url" + case subscriptionsUrl = "subscriptions_url" + case organizationsUrl = "organizations_url" + case reposUrl = "repos_url" + case eventsUrl = "events_url" + case receivedEventsUrl = "received_events_url" + case _type = "type" + case siteAdmin = "site_admin" + case permissions + case roleName = "role_name" + case userViewType = "user_view_type" } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. - public var head: Components.Schemas.PullRequestSimple.HeadPayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. - public struct BasePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/label`. - public var label: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/ref`. - public var ref: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/repo`. - public var repo: Components.Schemas.Repository - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// Creates a new `BasePayload`. - /// - /// - Parameters: - /// - label: - /// - ref: - /// - repo: - /// - sha: - /// - user: - public init( - label: Swift.String, - ref: Swift.String, - repo: Components.Schemas.Repository, - sha: Swift.String, - user: Components.Schemas.NullableSimpleUser? = nil - ) { - self.label = label - self.ref = ref - self.repo = repo - self.sha = sha - self.user = user - } - public enum CodingKeys: String, CodingKey { - case label - case ref - case repo - case sha - case user - } + } + /// Repository Collaborator Permission + /// + /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission`. + public struct RepositoryCollaboratorPermission: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission/role_name`. + public var roleName: Swift.String + /// - Remark: Generated from `#/components/schemas/repository-collaborator-permission/user`. + public var user: Components.Schemas.NullableCollaborator? + /// Creates a new `RepositoryCollaboratorPermission`. + /// + /// - Parameters: + /// - permission: + /// - roleName: + /// - user: + public init( + permission: Swift.String, + roleName: Swift.String, + user: Components.Schemas.NullableCollaborator? = nil + ) { + self.permission = permission + self.roleName = roleName + self.user = user } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. - public var base: Components.Schemas.PullRequestSimple.BasePayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. - public struct _LinksPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/comments`. - public var comments: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/commits`. - public var commits: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/statuses`. - public var statuses: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/html`. - public var html: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/issue`. - public var issue: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comments`. - public var reviewComments: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comment`. - public var reviewComment: Components.Schemas.Link - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/self`. - public var _self: Components.Schemas.Link - /// Creates a new `_LinksPayload`. - /// - /// - Parameters: - /// - comments: - /// - commits: - /// - statuses: - /// - html: - /// - issue: - /// - reviewComments: - /// - reviewComment: - /// - _self: - public init( - comments: Components.Schemas.Link, - commits: Components.Schemas.Link, - statuses: Components.Schemas.Link, - html: Components.Schemas.Link, - issue: Components.Schemas.Link, - reviewComments: Components.Schemas.Link, - reviewComment: Components.Schemas.Link, - _self: Components.Schemas.Link - ) { - self.comments = comments - self.commits = commits - self.statuses = statuses - self.html = html - self.issue = issue - self.reviewComments = reviewComments - self.reviewComment = reviewComment - self._self = _self - } - public enum CodingKeys: String, CodingKey { - case comments - case commits - case statuses - case html - case issue - case reviewComments = "review_comments" - case reviewComment = "review_comment" - case _self = "self" - } + public enum CodingKeys: String, CodingKey { + case permission + case roleName = "role_name" + case user } - /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. - public var _links: Components.Schemas.PullRequestSimple._LinksPayload - /// - Remark: Generated from `#/components/schemas/pull-request-simple/author_association`. + } + /// Commit Comment + /// + /// - Remark: Generated from `#/components/schemas/commit-comment`. + public struct CommitComment: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/commit-comment/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/commit-comment/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/commit-comment/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/commit-comment/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/commit-comment/body`. + public var body: Swift.String + /// - Remark: Generated from `#/components/schemas/commit-comment/path`. + public var path: Swift.String? + /// - Remark: Generated from `#/components/schemas/commit-comment/position`. + public var position: Swift.Int? + /// - Remark: Generated from `#/components/schemas/commit-comment/line`. + public var line: Swift.Int? + /// - Remark: Generated from `#/components/schemas/commit-comment/commit_id`. + public var commitId: Swift.String + /// - Remark: Generated from `#/components/schemas/commit-comment/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/commit-comment/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/commit-comment/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/commit-comment/author_association`. public var authorAssociation: Components.Schemas.AuthorAssociation - /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. - public var autoMerge: Components.Schemas.AutoMerge? - /// Indicates whether or not the pull request is a draft. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. - public var draft: Swift.Bool? - /// Creates a new `PullRequestSimple`. + /// - Remark: Generated from `#/components/schemas/commit-comment/reactions`. + public var reactions: Components.Schemas.ReactionRollup? + /// Creates a new `CommitComment`. /// /// - Parameters: + /// - htmlUrl: /// - url: /// - id: /// - nodeId: - /// - htmlUrl: - /// - diffUrl: - /// - patchUrl: - /// - issueUrl: - /// - commitsUrl: - /// - reviewCommentsUrl: - /// - reviewCommentUrl: - /// - commentsUrl: - /// - statusesUrl: - /// - number: - /// - state: - /// - locked: - /// - title: - /// - user: /// - body: - /// - labels: - /// - milestone: - /// - activeLockReason: + /// - path: + /// - position: + /// - line: + /// - commitId: + /// - user: /// - createdAt: /// - updatedAt: - /// - closedAt: - /// - mergedAt: - /// - mergeCommitSha: - /// - assignee: - /// - assignees: - /// - requestedReviewers: - /// - requestedTeams: - /// - head: - /// - base: - /// - _links: /// - authorAssociation: - /// - autoMerge: - /// - draft: Indicates whether or not the pull request is a draft. + /// - reactions: public init( + htmlUrl: Swift.String, url: Swift.String, - id: Swift.Int64, + id: Swift.Int, nodeId: Swift.String, - htmlUrl: Swift.String, - diffUrl: Swift.String, - patchUrl: Swift.String, - issueUrl: Swift.String, - commitsUrl: Swift.String, - reviewCommentsUrl: Swift.String, - reviewCommentUrl: Swift.String, - commentsUrl: Swift.String, - statusesUrl: Swift.String, - number: Swift.Int, - state: Swift.String, - locked: Swift.Bool, - title: Swift.String, + body: Swift.String, + path: Swift.String? = nil, + position: Swift.Int? = nil, + line: Swift.Int? = nil, + commitId: Swift.String, user: Components.Schemas.NullableSimpleUser? = nil, - body: Swift.String? = nil, - labels: Components.Schemas.PullRequestSimple.LabelsPayload, - milestone: Components.Schemas.NullableMilestone? = nil, - activeLockReason: Swift.String? = nil, createdAt: Foundation.Date, updatedAt: Foundation.Date, - closedAt: Foundation.Date? = nil, - mergedAt: Foundation.Date? = nil, - mergeCommitSha: Swift.String? = nil, - assignee: Components.Schemas.NullableSimpleUser? = nil, - assignees: [Components.Schemas.SimpleUser]? = nil, - requestedReviewers: [Components.Schemas.SimpleUser]? = nil, - requestedTeams: [Components.Schemas.Team]? = nil, - head: Components.Schemas.PullRequestSimple.HeadPayload, - base: Components.Schemas.PullRequestSimple.BasePayload, - _links: Components.Schemas.PullRequestSimple._LinksPayload, authorAssociation: Components.Schemas.AuthorAssociation, - autoMerge: Components.Schemas.AutoMerge? = nil, - draft: Swift.Bool? = nil + reactions: Components.Schemas.ReactionRollup? = nil ) { + self.htmlUrl = htmlUrl self.url = url self.id = id self.nodeId = nodeId - self.htmlUrl = htmlUrl - self.diffUrl = diffUrl - self.patchUrl = patchUrl - self.issueUrl = issueUrl - self.commitsUrl = commitsUrl - self.reviewCommentsUrl = reviewCommentsUrl - self.reviewCommentUrl = reviewCommentUrl - self.commentsUrl = commentsUrl - self.statusesUrl = statusesUrl - self.number = number - self.state = state - self.locked = locked - self.title = title - self.user = user self.body = body - self.labels = labels - self.milestone = milestone - self.activeLockReason = activeLockReason + self.path = path + self.position = position + self.line = line + self.commitId = commitId + self.user = user self.createdAt = createdAt self.updatedAt = updatedAt - self.closedAt = closedAt - self.mergedAt = mergedAt - self.mergeCommitSha = mergeCommitSha - self.assignee = assignee - self.assignees = assignees - self.requestedReviewers = requestedReviewers - self.requestedTeams = requestedTeams - self.head = head - self.base = base - self._links = _links self.authorAssociation = authorAssociation - self.autoMerge = autoMerge - self.draft = draft + self.reactions = reactions } public enum CodingKeys: String, CodingKey { + case htmlUrl = "html_url" case url case id case nodeId = "node_id" - case htmlUrl = "html_url" - case diffUrl = "diff_url" - case patchUrl = "patch_url" - case issueUrl = "issue_url" - case commitsUrl = "commits_url" - case reviewCommentsUrl = "review_comments_url" - case reviewCommentUrl = "review_comment_url" - case commentsUrl = "comments_url" - case statusesUrl = "statuses_url" - case number - case state - case locked - case title - case user case body - case labels - case milestone - case activeLockReason = "active_lock_reason" + case path + case position + case line + case commitId = "commit_id" + case user case createdAt = "created_at" case updatedAt = "updated_at" - case closedAt = "closed_at" - case mergedAt = "merged_at" - case mergeCommitSha = "merge_commit_sha" - case assignee - case assignees - case requestedReviewers = "requested_reviewers" - case requestedTeams = "requested_teams" - case head - case base - case _links case authorAssociation = "author_association" - case autoMerge = "auto_merge" - case draft + case reactions + } + } + /// Branch Short + /// + /// - Remark: Generated from `#/components/schemas/branch-short`. + public struct BranchShort: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-short/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/branch-short/commit`. + public struct CommitPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/branch-short/commit/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/branch-short/commit/url`. + public var url: Swift.String + /// Creates a new `CommitPayload`. + /// + /// - Parameters: + /// - sha: + /// - url: + public init( + sha: Swift.String, + url: Swift.String + ) { + self.sha = sha + self.url = url + } + public enum CodingKeys: String, CodingKey { + case sha + case url + } + } + /// - Remark: Generated from `#/components/schemas/branch-short/commit`. + public var commit: Components.Schemas.BranchShort.CommitPayload + /// - Remark: Generated from `#/components/schemas/branch-short/protected`. + public var protected: Swift.Bool + /// Creates a new `BranchShort`. + /// + /// - Parameters: + /// - name: + /// - commit: + /// - protected: + public init( + name: Swift.String, + commit: Components.Schemas.BranchShort.CommitPayload, + protected: Swift.Bool + ) { + self.name = name + self.commit = commit + self.protected = protected + } + public enum CodingKeys: String, CodingKey { + case name + case commit + case protected } } /// - Remark: Generated from `#/components/schemas/simple-commit-status`. @@ -20201,6 +20613,35 @@ public enum Components { case lastResponse = "last_response" } } + /// Check immutable releases + /// + /// - Remark: Generated from `#/components/schemas/check-immutable-releases`. + public struct CheckImmutableReleases: Codable, Hashable, Sendable { + /// Whether immutable releases are enabled for the repository. + /// + /// - Remark: Generated from `#/components/schemas/check-immutable-releases/enabled`. + public var enabled: Swift.Bool + /// Whether immutable releases are enforced by the repository owner. + /// + /// - Remark: Generated from `#/components/schemas/check-immutable-releases/enforced_by_owner`. + public var enforcedByOwner: Swift.Bool + /// Creates a new `CheckImmutableReleases`. + /// + /// - Parameters: + /// - enabled: Whether immutable releases are enabled for the repository. + /// - enforcedByOwner: Whether immutable releases are enforced by the repository owner. + public init( + enabled: Swift.Bool, + enforcedByOwner: Swift.Bool + ) { + self.enabled = enabled + self.enforcedByOwner = enforcedByOwner + } + public enum CodingKeys: String, CodingKey { + case enabled + case enforcedByOwner = "enforced_by_owner" + } + } /// An SSH key granting access to a single repository. /// /// - Remark: Generated from `#/components/schemas/deploy-key`. @@ -20222,7 +20663,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/deploy-key/added_by`. public var addedBy: Swift.String? /// - Remark: Generated from `#/components/schemas/deploy-key/last_used`. - public var lastUsed: Swift.String? + public var lastUsed: Foundation.Date? /// - Remark: Generated from `#/components/schemas/deploy-key/enabled`. public var enabled: Swift.Bool? /// Creates a new `DeployKey`. @@ -20247,7 +20688,7 @@ public enum Components { createdAt: Swift.String, readOnly: Swift.Bool, addedBy: Swift.String? = nil, - lastUsed: Swift.String? = nil, + lastUsed: Foundation.Date? = nil, enabled: Swift.Bool? = nil ) { self.id = id @@ -21166,6 +21607,8 @@ public enum Components { public var contentType: Swift.String /// - Remark: Generated from `#/components/schemas/release-asset/size`. public var size: Swift.Int + /// - Remark: Generated from `#/components/schemas/release-asset/digest`. + public var digest: Swift.String? /// - Remark: Generated from `#/components/schemas/release-asset/download_count`. public var downloadCount: Swift.Int /// - Remark: Generated from `#/components/schemas/release-asset/created_at`. @@ -21186,6 +21629,7 @@ public enum Components { /// - state: State of the release asset. /// - contentType: /// - size: + /// - digest: /// - downloadCount: /// - createdAt: /// - updatedAt: @@ -21200,6 +21644,7 @@ public enum Components { state: Components.Schemas.ReleaseAsset.StatePayload, contentType: Swift.String, size: Swift.Int, + digest: Swift.String? = nil, downloadCount: Swift.Int, createdAt: Foundation.Date, updatedAt: Foundation.Date, @@ -21214,6 +21659,7 @@ public enum Components { self.state = state self.contentType = contentType self.size = size + self.digest = digest self.downloadCount = downloadCount self.createdAt = createdAt self.updatedAt = updatedAt @@ -21229,6 +21675,7 @@ public enum Components { case state case contentType = "content_type" case size + case digest case downloadCount = "download_count" case createdAt = "created_at" case updatedAt = "updated_at" @@ -21275,10 +21722,16 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/release/prerelease`. public var prerelease: Swift.Bool + /// Whether or not the release is immutable. + /// + /// - Remark: Generated from `#/components/schemas/release/immutable`. + public var immutable: Swift.Bool? /// - Remark: Generated from `#/components/schemas/release/created_at`. public var createdAt: Foundation.Date /// - Remark: Generated from `#/components/schemas/release/published_at`. public var publishedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/release/updated_at`. + public var updatedAt: Foundation.Date? /// - Remark: Generated from `#/components/schemas/release/author`. public var author: Components.Schemas.SimpleUser /// - Remark: Generated from `#/components/schemas/release/assets`. @@ -21312,8 +21765,10 @@ public enum Components { /// - body: /// - draft: true to create a draft (unpublished) release, false to create a published one. /// - prerelease: Whether to identify the release as a prerelease or a full release. + /// - immutable: Whether or not the release is immutable. /// - createdAt: /// - publishedAt: + /// - updatedAt: /// - author: /// - assets: /// - bodyHtml: @@ -21336,8 +21791,10 @@ public enum Components { body: Swift.String? = nil, draft: Swift.Bool, prerelease: Swift.Bool, + immutable: Swift.Bool? = nil, createdAt: Foundation.Date, publishedAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, author: Components.Schemas.SimpleUser, assets: [Components.Schemas.ReleaseAsset], bodyHtml: Swift.String? = nil, @@ -21360,8 +21817,10 @@ public enum Components { self.body = body self.draft = draft self.prerelease = prerelease + self.immutable = immutable self.createdAt = createdAt self.publishedAt = publishedAt + self.updatedAt = updatedAt self.author = author self.assets = assets self.bodyHtml = bodyHtml @@ -21385,8 +21844,10 @@ public enum Components { case body case draft case prerelease + case immutable case createdAt = "created_at" case publishedAt = "published_at" + case updatedAt = "updated_at" case author case assets case bodyHtml = "body_html" @@ -22082,6 +22543,35 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case21`. case case21(Components.Schemas.RepositoryRuleDetailed.Case21Payload) + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22`. + public struct Case22Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22/value1`. + public var value1: Components.Schemas.RepositoryRuleCopilotCodeReview + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22/value2`. + public var value2: Components.Schemas.RepositoryRuleRulesetInfo + /// Creates a new `Case22Payload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.RepositoryRuleCopilotCodeReview, + value2: Components.Schemas.RepositoryRuleRulesetInfo + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Decoder) throws { + self.value1 = try .init(from: decoder) + self.value2 = try .init(from: decoder) + } + public func encode(to encoder: any Encoder) throws { + try self.value1.encode(to: encoder) + try self.value2.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22`. + case case22(Components.Schemas.RepositoryRuleDetailed.Case22Payload) public init(from decoder: any Decoder) throws { var errors: [any Error] = [] do { @@ -22210,6 +22700,12 @@ public enum Components { } catch { errors.append(error) } + do { + self = .case22(try .init(from: decoder)) + return + } catch { + errors.append(error) + } throw Swift.DecodingError.failedToDecodeOneOfSchema( type: Self.self, codingPath: decoder.codingPath, @@ -22260,6 +22756,8 @@ public enum Components { try value.encode(to: encoder) case let .case21(value): try value.encode(to: encoder) + case let .case22(value): + try value.encode(to: encoder) } } } @@ -22706,6 +23204,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// The unique identifier of the comment. /// /// - Remark: Generated from `#/components/parameters/comment-id`. @@ -22718,14 +23224,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repo`. public typealias Repo = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String /// The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery. /// /// - Remark: Generated from `#/components/parameters/hook-id`. @@ -22751,7 +23249,7 @@ public enum Components { public typealias RepositoryNameInQuery = Swift.String /// The time period to filter by. /// - /// For example, `day` will filter for rule suites that occurred in the past 24 hours, and `week` will filter for insights that occurred in the past 7 days (168 hours). + /// For example, `day` will filter for rule suites that occurred in the past 24 hours, and `week` will filter for rule suites that occurred in the past 7 days (168 hours). /// /// - Remark: Generated from `#/components/parameters/time-period`. @frozen public enum TimePeriod: String, Codable, Hashable, Sendable, CaseIterable { @@ -22764,7 +23262,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/actor-name-in-query`. public typealias ActorNameInQuery = Swift.String - /// The rule results to filter on. When specified, only suites with this result will be returned. + /// The rule suite results to filter on. When specified, only suites with this result will be returned. /// /// - Remark: Generated from `#/components/parameters/rule-suite-result`. @frozen public enum RuleSuiteResult: String, Codable, Hashable, Sendable, CaseIterable { @@ -24319,7 +24817,7 @@ public enum Operations { /// An array of rules within the ruleset. /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/POST/requestBody/json/rules`. - public var rules: [Components.Schemas.RepositoryRule]? + public var rules: [Components.Schemas.OrgRules]? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -24335,7 +24833,7 @@ public enum Operations { enforcement: Components.Schemas.RepositoryRuleEnforcement, bypassActors: [Components.Schemas.RepositoryRulesetBypassActor]? = nil, conditions: Components.Schemas.OrgRulesetConditions? = nil, - rules: [Components.Schemas.RepositoryRule]? = nil + rules: [Components.Schemas.OrgRules]? = nil ) { self.name = name self.target = target @@ -24546,7 +25044,7 @@ public enum Operations { } /// The time period to filter by. /// - /// For example, `day` will filter for rule suites that occurred in the past 24 hours, and `week` will filter for insights that occurred in the past 7 days (168 hours). + /// For example, `day` will filter for rule suites that occurred in the past 24 hours, and `week` will filter for rule suites that occurred in the past 7 days (168 hours). /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/rule-suites/GET/query/time_period`. public var timePeriod: Components.Parameters.TimePeriod? @@ -24561,7 +25059,7 @@ public enum Operations { case bypass = "bypass" case all = "all" } - /// The rule results to filter on. When specified, only suites with this result will be returned. + /// The rule suite results to filter on. When specified, only suites with this result will be returned. /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/rule-suites/GET/query/rule_suite_result`. public var ruleSuiteResult: Components.Parameters.RuleSuiteResult? @@ -24580,7 +25078,7 @@ public enum Operations { /// - repositoryName: The name of the repository to filter on. /// - timePeriod: The time period to filter by. /// - actorName: The handle for the GitHub user account to filter on. When specified, only rule evaluations triggered by this actor will be returned. - /// - ruleSuiteResult: The rule results to filter on. When specified, only suites with this result will be returned. + /// - ruleSuiteResult: The rule suite results to filter on. When specified, only suites with this result will be returned. /// - perPage: The number of results per page (max 100). 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)." /// - page: The page number of the results to fetch. 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)." public init( @@ -25217,7 +25715,7 @@ public enum Operations { /// An array of rules within the ruleset. /// /// - Remark: Generated from `#/paths/orgs/{org}/rulesets/{ruleset_id}/PUT/requestBody/json/rules`. - public var rules: [Components.Schemas.RepositoryRule]? + public var rules: [Components.Schemas.OrgRules]? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -25233,7 +25731,7 @@ public enum Operations { enforcement: Components.Schemas.RepositoryRuleEnforcement? = nil, bypassActors: [Components.Schemas.RepositoryRulesetBypassActor]? = nil, conditions: Components.Schemas.OrgRulesetConditions? = nil, - rules: [Components.Schemas.RepositoryRule]? = nil + rules: [Components.Schemas.OrgRules]? = nil ) { self.name = name self.target = target @@ -25576,7 +26074,8 @@ public enum Operations { /// The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network. /// /// > [!NOTE] - /// > In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." + /// > - To view merge-related settings, you must have the `contents:read` and `contents:write` permissions. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/get(repos/get)`. @@ -25872,7 +26371,11 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis`. public struct SecurityAndAnalysisPayload: Codable, Hashable, Sendable { - /// Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." + /// Use the `status` property to enable or disable GitHub Advanced Security for this repository. + /// For more information, see "[About GitHub Advanced + /// Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { @@ -25891,7 +26394,11 @@ public enum Operations { case status } } - /// Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." + /// Use the `status` property to enable or disable GitHub Advanced Security for this repository. + /// For more information, see "[About GitHub Advanced + /// Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/PATCH/requestBody/json/security_and_analysis/advanced_security`. public var advancedSecurity: Operations.ReposUpdate.Input.Body.JsonPayload.SecurityAndAnalysisPayload.AdvancedSecurityPayload? @@ -26013,7 +26520,7 @@ public enum Operations { /// Creates a new `SecurityAndAnalysisPayload`. /// /// - Parameters: - /// - advancedSecurity: Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." + /// - advancedSecurity: Use the `status` property to enable or disable GitHub Advanced Security for this repository. /// - codeSecurity: Use the `status` property to enable or disable GitHub Code Security for this repository. /// - secretScanning: Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." /// - secretScanningPushProtection: Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." @@ -26720,6 +27227,29 @@ public enum Operations { } } } + /// Conflict + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/delete(repos/delete)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -27396,7 +27926,8 @@ public enum Operations { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/query/after`. public var after: Components.Parameters.PaginationAfter? /// Optional filter for fetching attestations with a given predicate type. - /// This option accepts `provenance`, `sbom`, or freeform text for custom predicate types. + /// This option accepts `provenance`, `sbom`, `release`, or freeform text + /// for custom predicate types. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/query/predicate_type`. public var predicateType: Swift.String? @@ -27533,25 +28064,31 @@ public enum Operations { public var repositoryId: Swift.Int? /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle_url`. public var bundleUrl: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/initiator`. + public var initiator: Swift.String? /// Creates a new `AttestationsPayloadPayload`. /// /// - Parameters: /// - bundle: The attestation's Sigstore Bundle. /// - repositoryId: /// - bundleUrl: + /// - initiator: public init( bundle: Operations.ReposListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload? = nil, repositoryId: Swift.Int? = nil, - bundleUrl: Swift.String? = nil + bundleUrl: Swift.String? = nil, + initiator: Swift.String? = nil ) { self.bundle = bundle self.repositoryId = repositoryId self.bundleUrl = bundleUrl + self.initiator = initiator } public enum CodingKeys: String, CodingKey { case bundle case repositoryId = "repository_id" case bundleUrl = "bundle_url" + case initiator } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. @@ -36233,12 +36770,12 @@ public enum Operations { /// List repository collaborators /// /// For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. - /// Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint. + /// The `permissions` hash returned in the response contains the base role permissions of the collaborator. The `role_name` is the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// Team members will include the members of child teams. /// - /// The authenticated user must have push access to the repository to use this endpoint. - /// + /// The authenticated user must have write, maintain, or admin privileges on the repository to use this endpoint. For organization-owned repositories, the authenticated user needs to be a member of the organization. /// OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators`. @@ -36608,11 +37145,13 @@ public enum Operations { } /// Add a repository collaborator /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// Add a user to a repository with a specified level of access. If the repository is owned by an organization, this API does not add the user to the organization - a user that has repository access without being an organization member is called an "outside collaborator" (if they are not an Enterprise Managed User) or a "repository collaborator" if they are an Enterprise Managed User. These users are exempt from some organization policies - see "[Adding outside collaborators to repositories](https://docs.github.com/organizations/managing-user-access-to-your-organizations-repositories/managing-outside-collaborators/adding-outside-collaborators-to-repositories-in-your-organization)" to learn more about these collaborator types. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). /// - /// Adding an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." + /// Adding an outside collaborator may be restricted by enterprise and organization administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)" and "[Setting permissions for adding outside collaborators](https://docs.github.com/organizations/managing-organization-settings/setting-permissions-for-adding-outside-collaborators)" for organization settings. /// - /// For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with: + /// For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the role being given must be equal to or higher than the org base permission. Otherwise, the request will fail with: /// /// ``` /// Cannot assign {member} permission of {role name} @@ -36622,6 +37161,8 @@ public enum Operations { /// /// The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [API](https://docs.github.com/rest/collaborators/invitations). /// + /// For Enterprise Managed Users, this endpoint does not send invitations - these users are automatically added to organizations and repositories. Enterprise Managed Users can only be added to organizations and repositories within their enterprise. + /// /// **Updating an existing collaborator's permission level** /// /// The endpoint can also be used to change the permissions of an existing collaborator without first removing and re-adding the collaborator. To change the permissions, use the same endpoint and pass a different `permission` parameter. The response will be a `204`, with no other indication that the permission level changed. @@ -36810,17 +37351,47 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/collaborators/{username}/PUT/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/collaborators/{username}/PUT/responses/422/content/application\/json`. + case json(Components.Schemas.ValidationError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ReposAddCollaborator.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ReposAddCollaborator.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Response when: + /// - validation failed, or the endpoint has been spammed + /// - an Enterprise Managed User (EMU) account was invited to a repository in an enterprise with personal user accounts /// /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/collaborators/{username}/put(repos/add-collaborator)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) + case unprocessableContent(Operations.ReposAddCollaborator.Output.UnprocessableContent) /// The associated value of the enum case if `self` is `.unprocessableContent`. /// /// - Throws: An error if `self` is not `.unprocessableContent`. /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + public var unprocessableContent: Operations.ReposAddCollaborator.Output.UnprocessableContent { get throws { switch self { case let .unprocessableContent(response): @@ -37088,13 +37659,15 @@ public enum Operations { } /// Get repository permissions for a user /// - /// Checks the repository permission of a collaborator. The possible repository - /// permissions are `admin`, `write`, `read`, and `none`. + /// Checks the repository permission and role of a collaborator. + /// + /// The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the + /// `maintain` role is mapped to `write` and the `triage` role is mapped to `read`. + /// The `role_name` attribute provides the name of the assigned role, including custom roles. The + /// `permission` can also be used to determine which base level of access the collaborator has to the repository. /// - /// *Note*: The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the - /// `maintain` role is mapped to `write` and the `triage` role is mapped to `read`. To determine the role assigned to the - /// collaborator, see the `role_name` attribute, which will provide the full role name, including custom roles. The - /// `permissions` hash can also be used to determine which base level of access the collaborator has to the repository. + /// The calculated permissions are the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise. + /// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/collaborators/{username}/permission`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/collaborators/{username}/permission/get(repos/get-collaborator-permission-level)`. @@ -49171,6 +49744,471 @@ public enum Operations { } } } + /// Check if immutable releases are enabled for a repository + /// + /// Shows whether immutable releases are enabled or disabled. Also identifies whether immutability is being + /// enforced by the repository owner. The authenticated user must have admin read access to the repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/get(repos/check-immutable-releases)`. + public enum ReposCheckImmutableReleases { + public static let id: Swift.String = "repos/check-immutable-releases" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ReposCheckImmutableReleases.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ReposCheckImmutableReleases.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ReposCheckImmutableReleases.Input.Path, + headers: Operations.ReposCheckImmutableReleases.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/GET/responses/200/content/application\/json`. + case json(Components.Schemas.CheckImmutableReleases) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.CheckImmutableReleases { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ReposCheckImmutableReleases.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ReposCheckImmutableReleases.Output.Ok.Body) { + self.body = body + } + } + /// Response if immutable releases are enabled + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/get(repos/check-immutable-releases)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ReposCheckImmutableReleases.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ReposCheckImmutableReleases.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Not Found if immutable releases are not enabled for the repository + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/get(repos/check-immutable-releases)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.ReposCheckImmutableReleases.Output.NotFound) + /// Not Found if immutable releases are not enabled for the repository + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/get(repos/check-immutable-releases)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.ReposCheckImmutableReleases.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Enable immutable releases + /// + /// Enables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/put(repos/enable-immutable-releases)`. + public enum ReposEnableImmutableReleases { + public static let id: Swift.String = "repos/enable-immutable-releases" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/PUT/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/PUT/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/PUT/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ReposEnableImmutableReleases.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ReposEnableImmutableReleases.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ReposEnableImmutableReleases.Input.Path, + headers: Operations.ReposEnableImmutableReleases.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/put(repos/enable-immutable-releases)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Components.Responses.NoContent) + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/put(repos/enable-immutable-releases)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Components.Responses.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/put(repos/enable-immutable-releases)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Disable immutable releases + /// + /// Disables immutable releases for a repository. The authenticated user must have admin access to the repository. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/immutable-releases`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/delete(repos/disable-immutable-releases)`. + public enum ReposDisableImmutableReleases { + public static let id: Swift.String = "repos/disable-immutable-releases" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/DELETE/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ReposDisableImmutableReleases.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/immutable-releases/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ReposDisableImmutableReleases.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ReposDisableImmutableReleases.Input.Path, + headers: Operations.ReposDisableImmutableReleases.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/delete(repos/disable-immutable-releases)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Components.Responses.NoContent) + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/delete(repos/disable-immutable-releases)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Components.Responses.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/immutable-releases/delete(repos/disable-immutable-releases)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// List repository invitations /// /// When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. @@ -54046,9 +55084,9 @@ public enum Operations { /// Users with read access to the repository can use this endpoint. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)`. - public enum ReposGetCustomPropertiesValues { - public static let id: Swift.String = "repos/get-custom-properties-values" + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)`. + public enum ReposCustomPropertiesForReposGetRepositoryValues { + public static let id: Swift.String = "repos/custom-properties-for-repos-get-repository-values" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/GET/path`. public struct Path: Sendable, Hashable { @@ -54073,27 +55111,27 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ReposGetCustomPropertiesValues.Input.Path + public var path: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Path /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ReposGetCustomPropertiesValues.Input.Headers + public var headers: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ReposGetCustomPropertiesValues.Input.Path, - headers: Operations.ReposGetCustomPropertiesValues.Input.Headers = .init() + path: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Path, + headers: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -54119,26 +55157,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ReposGetCustomPropertiesValues.Output.Ok.Body + public var body: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ReposGetCustomPropertiesValues.Output.Ok.Body) { + public init(body: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ReposGetCustomPropertiesValues.Output.Ok) + case ok(Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ReposGetCustomPropertiesValues.Output.Ok { + public var ok: Operations.ReposCustomPropertiesForReposGetRepositoryValues.Output.Ok { get throws { switch self { case let .ok(response): @@ -54153,7 +55191,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -54176,7 +55214,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/get-custom-properties-values)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/get(repos/custom-properties-for-repos-get-repository-values)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -54236,9 +55274,9 @@ public enum Operations { /// Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/properties/values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)`. - public enum ReposCreateOrUpdateCustomPropertiesValues { - public static let id: Swift.String = "repos/create-or-update-custom-properties-values" + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)`. + public enum ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues { + public static let id: Swift.String = "repos/custom-properties-for-repos-create-or-update-repository-values" public struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/PATCH/path`. public struct Path: Sendable, Hashable { @@ -54263,19 +55301,19 @@ public enum Operations { self.repo = repo } } - public var path: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Path + public var path: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Path /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Headers + public var headers: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Headers /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/PATCH/requestBody/json`. @@ -54296,9 +55334,9 @@ public enum Operations { } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/properties/values/PATCH/requestBody/content/application\/json`. - case json(Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Body.JsonPayload) + case json(Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Body.JsonPayload) } - public var body: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Body + public var body: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -54306,9 +55344,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Path, - headers: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Headers = .init(), - body: Operations.ReposCreateOrUpdateCustomPropertiesValues.Input.Body + path: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Path, + headers: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Headers = .init(), + body: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Input.Body ) { self.path = path self.headers = headers @@ -54322,13 +55360,13 @@ public enum Operations { } /// No Content when custom property values are successfully created or updated /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.ReposCreateOrUpdateCustomPropertiesValues.Output.NoContent) + case noContent(Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Output.NoContent) /// No Content when custom property values are successfully created or updated /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -54338,7 +55376,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.ReposCreateOrUpdateCustomPropertiesValues.Output.NoContent { + public var noContent: Operations.ReposCustomPropertiesForReposCreateOrUpdateRepositoryValues.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -54353,7 +55391,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -54376,7 +55414,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -54399,7 +55437,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/create-or-update-custom-properties-values)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/properties/values/patch(repos/custom-properties-for-repos-create-or-update-repository-values)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -58186,7 +59224,7 @@ public enum Operations { } /// The time period to filter by. /// - /// For example, `day` will filter for rule suites that occurred in the past 24 hours, and `week` will filter for insights that occurred in the past 7 days (168 hours). + /// For example, `day` will filter for rule suites that occurred in the past 24 hours, and `week` will filter for rule suites that occurred in the past 7 days (168 hours). /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/rule-suites/GET/query/time_period`. public var timePeriod: Components.Parameters.TimePeriod? @@ -58201,7 +59239,7 @@ public enum Operations { case bypass = "bypass" case all = "all" } - /// The rule results to filter on. When specified, only suites with this result will be returned. + /// The rule suite results to filter on. When specified, only suites with this result will be returned. /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/rulesets/rule-suites/GET/query/rule_suite_result`. public var ruleSuiteResult: Components.Parameters.RuleSuiteResult? @@ -58219,7 +59257,7 @@ public enum Operations { /// - ref: The name of the ref. Cannot contain wildcard characters. Optionally prefix with `refs/heads/` to limit to branches or `refs/tags/` to limit to tags. Omit the prefix to search across all refs. When specified, only rule evaluations triggered for this ref will be returned. /// - timePeriod: The time period to filter by. /// - actorName: The handle for the GitHub user account to filter on. When specified, only rule evaluations triggered by this actor will be returned. - /// - ruleSuiteResult: The rule results to filter on. When specified, only suites with this result will be returned. + /// - ruleSuiteResult: The rule suite results to filter on. When specified, only suites with this result will be returned. /// - perPage: The number of results per page (max 100). 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)." /// - page: The page number of the results to fetch. 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)." public init( diff --git a/Sources/search/Client.swift b/Sources/search/Client.swift index b3adc61e392..fe57d347b64 100644 --- a/Sources/search/Client.swift +++ b/Sources/search/Client.swift @@ -330,13 +330,22 @@ public struct Client: APIProtocol { } /// Search issues and pull requests /// - /// > [!WARNING] - /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on September 4, 2025. - /// > You can read more about this change on [the GitHub blog](https://github.blog/changelog/2025-03-06-github-issues-projects-api-support-for-issues-advanced-search-and-more/). + /// Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api). + /// + /// When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted + /// search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). + /// + /// For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. + /// + /// `q=windows+label:bug+language:python+state:open&sort=created&order=asc` + /// + /// This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. + /// + /// > [!NOTE] + /// > For requests made by GitHub Apps with a user access token, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." /// /// - Remark: HTTP `GET /search/issues`. /// - Remark: Generated from `#/paths//search/issues/get(search/issues-and-pull-requests)`. - @available(*, deprecated) public func searchIssuesAndPullRequests(_ input: Operations.SearchIssuesAndPullRequests.Input) async throws -> Operations.SearchIssuesAndPullRequests.Output { try await client.send( input: input, diff --git a/Sources/search/Types.swift b/Sources/search/Types.swift index a606b12c8eb..3b97263dce6 100644 --- a/Sources/search/Types.swift +++ b/Sources/search/Types.swift @@ -53,13 +53,22 @@ public protocol APIProtocol: Sendable { func searchCommits(_ input: Operations.SearchCommits.Input) async throws -> Operations.SearchCommits.Output /// Search issues and pull requests /// - /// > [!WARNING] - /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on September 4, 2025. - /// > You can read more about this change on [the GitHub blog](https://github.blog/changelog/2025-03-06-github-issues-projects-api-support-for-issues-advanced-search-and-more/). + /// Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api). + /// + /// When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted + /// search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). + /// + /// For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. + /// + /// `q=windows+label:bug+language:python+state:open&sort=created&order=asc` + /// + /// This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. + /// + /// > [!NOTE] + /// > For requests made by GitHub Apps with a user access token, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." /// /// - Remark: HTTP `GET /search/issues`. /// - Remark: Generated from `#/paths//search/issues/get(search/issues-and-pull-requests)`. - @available(*, deprecated) func searchIssuesAndPullRequests(_ input: Operations.SearchIssuesAndPullRequests.Input) async throws -> Operations.SearchIssuesAndPullRequests.Output /// Search labels /// @@ -185,13 +194,22 @@ extension APIProtocol { } /// Search issues and pull requests /// - /// > [!WARNING] - /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on September 4, 2025. - /// > You can read more about this change on [the GitHub blog](https://github.blog/changelog/2025-03-06-github-issues-projects-api-support-for-issues-advanced-search-and-more/). + /// Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api). + /// + /// When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted + /// search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). + /// + /// For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. + /// + /// `q=windows+label:bug+language:python+state:open&sort=created&order=asc` + /// + /// This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. + /// + /// > [!NOTE] + /// > For requests made by GitHub Apps with a user access token, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." /// /// - Remark: HTTP `GET /search/issues`. /// - Remark: Generated from `#/paths//search/issues/get(search/issues-and-pull-requests)`. - @available(*, deprecated) public func searchIssuesAndPullRequests( query: Operations.SearchIssuesAndPullRequests.Input.Query, headers: Operations.SearchIssuesAndPullRequests.Input.Headers = .init() @@ -1255,6 +1273,35 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/anonymous_access_enabled`. public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? /// Creates a new `Repository`. /// /// - Parameters: @@ -1353,6 +1400,7 @@ public enum Components { /// - masterBranch: /// - starredAt: /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository public init( id: Swift.Int64, nodeId: Swift.String, @@ -1448,7 +1496,8 @@ public enum Components { watchers: Swift.Int, masterBranch: Swift.String? = nil, starredAt: Swift.String? = nil, - anonymousAccessEnabled: Swift.Bool? = nil + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -1545,6 +1594,7 @@ public enum Components { self.masterBranch = masterBranch self.starredAt = starredAt self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus } public enum CodingKeys: String, CodingKey { case id @@ -1642,6 +1692,7 @@ public enum Components { case masterBranch = "master_branch" case starredAt = "starred_at" case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" } } /// Code Of Conduct @@ -2072,20 +2123,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-integration/permissions`. public var permissions: Components.Schemas.NullableIntegration.PermissionsPayload - /// The list of events for the GitHub app + /// The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. /// /// - Remark: Generated from `#/components/schemas/nullable-integration/events`. public var events: [Swift.String] - /// The number of installations associated with the GitHub app + /// The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. /// /// - Remark: Generated from `#/components/schemas/nullable-integration/installations_count`. public var installationsCount: Swift.Int? - /// - Remark: Generated from `#/components/schemas/nullable-integration/client_secret`. - public var clientSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/webhook_secret`. - public var webhookSecret: Swift.String? - /// - Remark: Generated from `#/components/schemas/nullable-integration/pem`. - public var pem: Swift.String? /// Creates a new `NullableIntegration`. /// /// - Parameters: @@ -2101,11 +2146,8 @@ public enum Components { /// - createdAt: /// - updatedAt: /// - permissions: The set of permissions for the GitHub app - /// - events: The list of events for the GitHub app - /// - installationsCount: The number of installations associated with the GitHub app - /// - clientSecret: - /// - webhookSecret: - /// - pem: + /// - events: The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation. + /// - installationsCount: The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself. public init( id: Swift.Int, slug: Swift.String? = nil, @@ -2120,10 +2162,7 @@ public enum Components { updatedAt: Foundation.Date, permissions: Components.Schemas.NullableIntegration.PermissionsPayload, events: [Swift.String], - installationsCount: Swift.Int? = nil, - clientSecret: Swift.String? = nil, - webhookSecret: Swift.String? = nil, - pem: Swift.String? = nil + installationsCount: Swift.Int? = nil ) { self.id = id self.slug = slug @@ -2139,9 +2178,6 @@ public enum Components { self.permissions = permissions self.events = events self.installationsCount = installationsCount - self.clientSecret = clientSecret - self.webhookSecret = webhookSecret - self.pem = pem } public enum CodingKeys: String, CodingKey { case id @@ -2158,9 +2194,6 @@ public enum Components { case permissions case events case installationsCount = "installations_count" - case clientSecret = "client_secret" - case webhookSecret = "webhook_secret" - case pem } } /// How the author is associated with the repository. @@ -2247,8 +2280,235 @@ public enum Components { case rocket } } + /// - Remark: Generated from `#/components/schemas/sub-issues-summary`. + public struct SubIssuesSummary: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/sub-issues-summary/total`. + public var total: Swift.Int + /// - Remark: Generated from `#/components/schemas/sub-issues-summary/completed`. + public var completed: Swift.Int + /// - Remark: Generated from `#/components/schemas/sub-issues-summary/percent_completed`. + public var percentCompleted: Swift.Int + /// Creates a new `SubIssuesSummary`. + /// + /// - Parameters: + /// - total: + /// - completed: + /// - percentCompleted: + public init( + total: Swift.Int, + completed: Swift.Int, + percentCompleted: Swift.Int + ) { + self.total = total + self.completed = completed + self.percentCompleted = percentCompleted + } + public enum CodingKeys: String, CodingKey { + case total + case completed + case percentCompleted = "percent_completed" + } + } + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary`. + public struct IssueDependenciesSummary: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocked_by`. + public var blockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/blocking`. + public var blocking: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocked_by`. + public var totalBlockedBy: Swift.Int + /// - Remark: Generated from `#/components/schemas/issue-dependencies-summary/total_blocking`. + public var totalBlocking: Swift.Int + /// Creates a new `IssueDependenciesSummary`. + /// + /// - Parameters: + /// - blockedBy: + /// - blocking: + /// - totalBlockedBy: + /// - totalBlocking: + public init( + blockedBy: Swift.Int, + blocking: Swift.Int, + totalBlockedBy: Swift.Int, + totalBlocking: Swift.Int + ) { + self.blockedBy = blockedBy + self.blocking = blocking + self.totalBlockedBy = totalBlockedBy + self.totalBlocking = totalBlocking + } + public enum CodingKeys: String, CodingKey { + case blockedBy = "blocked_by" + case blocking + case totalBlockedBy = "total_blocked_by" + case totalBlocking = "total_blocking" + } + } + /// A value assigned to an issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value`. + public struct IssueFieldValue: Codable, Hashable, Sendable { + /// Unique identifier for the issue field. + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/issue_field_id`. + public var issueFieldId: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/issue-field-value/node_id`. + public var nodeId: Swift.String + /// The data type of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/data_type`. + @frozen public enum DataTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case text = "text" + case singleSelect = "single_select" + case number = "number" + case date = "date" + } + /// The data type of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/data_type`. + public var dataType: Components.Schemas.IssueFieldValue.DataTypePayload + /// The value of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/value`. + public struct ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value1`. + public var value1: Swift.String? + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value2`. + public var value2: Swift.Double? + /// - Remark: Generated from `#/components/schemas/issue-field-value/value/value3`. + public var value3: Swift.Int? + /// Creates a new `ValuePayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + /// - value3: + public init( + value1: Swift.String? = nil, + value2: Swift.Double? = nil, + value3: Swift.Int? = nil + ) { + self.value1 = value1 + self.value2 = value2 + self.value3 = value3 + } + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self.value1 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + do { + self.value2 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + do { + self.value3 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2, + self.value3 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeFirstNonNilValueToSingleValueContainer([ + self.value1, + self.value2, + self.value3 + ]) + } + } + /// The value of the issue field + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/value`. + public var value: Components.Schemas.IssueFieldValue.ValuePayload? + /// Details about the selected option (only present for single_select fields) + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option`. + public struct SingleSelectOptionPayload: Codable, Hashable, Sendable { + /// Unique identifier for the option. + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option/id`. + public var id: Swift.Int64 + /// The name of the option + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option/name`. + public var name: Swift.String + /// The color of the option + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option/color`. + public var color: Swift.String + /// Creates a new `SingleSelectOptionPayload`. + /// + /// - Parameters: + /// - id: Unique identifier for the option. + /// - name: The name of the option + /// - color: The color of the option + public init( + id: Swift.Int64, + name: Swift.String, + color: Swift.String + ) { + self.id = id + self.name = name + self.color = color + } + public enum CodingKeys: String, CodingKey { + case id + case name + case color + } + } + /// Details about the selected option (only present for single_select fields) + /// + /// - Remark: Generated from `#/components/schemas/issue-field-value/single_select_option`. + public var singleSelectOption: Components.Schemas.IssueFieldValue.SingleSelectOptionPayload? + /// Creates a new `IssueFieldValue`. + /// + /// - Parameters: + /// - issueFieldId: Unique identifier for the issue field. + /// - nodeId: + /// - dataType: The data type of the issue field + /// - value: The value of the issue field + /// - singleSelectOption: Details about the selected option (only present for single_select fields) + public init( + issueFieldId: Swift.Int64, + nodeId: Swift.String, + dataType: Components.Schemas.IssueFieldValue.DataTypePayload, + value: Components.Schemas.IssueFieldValue.ValuePayload? = nil, + singleSelectOption: Components.Schemas.IssueFieldValue.SingleSelectOptionPayload? = nil + ) { + self.issueFieldId = issueFieldId + self.nodeId = nodeId + self.dataType = dataType + self.value = value + self.singleSelectOption = singleSelectOption + } + public enum CodingKeys: String, CodingKey { + case issueFieldId = "issue_field_id" + case nodeId = "node_id" + case dataType = "data_type" + case value + case singleSelectOption = "single_select_option" + } + } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -2269,6 +2529,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -2414,7 +2679,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: @@ -2710,6 +2975,30 @@ public enum Components { public var webCommitSignoffRequired: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/security_and_analysis`. public var securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public struct CustomPropertiesPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CustomPropertiesPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public var customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? /// Creates a new `MinimalRepository`. /// /// - Parameters: @@ -2800,6 +3089,7 @@ public enum Components { /// - allowForking: /// - webCommitSignoffRequired: /// - securityAndAnalysis: + /// - customProperties: The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. public init( id: Swift.Int64, nodeId: Swift.String, @@ -2887,7 +3177,8 @@ public enum Components { watchers: Swift.Int? = nil, allowForking: Swift.Bool? = nil, webCommitSignoffRequired: Swift.Bool? = nil, - securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil + securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil, + customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -2976,6 +3267,7 @@ public enum Components { self.allowForking = allowForking self.webCommitSignoffRequired = webCommitSignoffRequired self.securityAndAnalysis = securityAndAnalysis + self.customProperties = customProperties } public enum CodingKeys: String, CodingKey { case id @@ -3065,6 +3357,7 @@ public enum Components { case allowForking = "allow_forking" case webCommitSignoffRequired = "web_commit_signoff_required" case securityAndAnalysis = "security_and_analysis" + case customProperties = "custom_properties" } } /// Metaproperties for Git author/committer information. @@ -3609,36 +3902,11 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/issue-search-result-item/labels`. public var labels: Components.Schemas.IssueSearchResultItem.LabelsPayload /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary`. - public struct SubIssuesSummaryPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary/total`. - public var total: Swift.Int - /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary/completed`. - public var completed: Swift.Int - /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary/percent_completed`. - public var percentCompleted: Swift.Int - /// Creates a new `SubIssuesSummaryPayload`. - /// - /// - Parameters: - /// - total: - /// - completed: - /// - percentCompleted: - public init( - total: Swift.Int, - completed: Swift.Int, - percentCompleted: Swift.Int - ) { - self.total = total - self.completed = completed - self.percentCompleted = percentCompleted - } - public enum CodingKeys: String, CodingKey { - case total - case completed - case percentCompleted = "percent_completed" - } - } - /// - Remark: Generated from `#/components/schemas/issue-search-result-item/sub_issues_summary`. - public var subIssuesSummary: Components.Schemas.IssueSearchResultItem.SubIssuesSummaryPayload? + public var subIssuesSummary: Components.Schemas.SubIssuesSummary? + /// - Remark: Generated from `#/components/schemas/issue-search-result-item/issue_dependencies_summary`. + public var issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? + /// - Remark: Generated from `#/components/schemas/issue-search-result-item/issue_field_values`. + public var issueFieldValues: [Components.Schemas.IssueFieldValue]? /// - Remark: Generated from `#/components/schemas/issue-search-result-item/state`. public var state: Swift.String /// - Remark: Generated from `#/components/schemas/issue-search-result-item/state_reason`. @@ -3741,6 +4009,8 @@ public enum Components { /// - user: /// - labels: /// - subIssuesSummary: + /// - issueDependenciesSummary: + /// - issueFieldValues: /// - state: /// - stateReason: /// - assignee: @@ -3778,7 +4048,9 @@ public enum Components { assignees: [Components.Schemas.SimpleUser]? = nil, user: Components.Schemas.NullableSimpleUser? = nil, labels: Components.Schemas.IssueSearchResultItem.LabelsPayload, - subIssuesSummary: Components.Schemas.IssueSearchResultItem.SubIssuesSummaryPayload? = nil, + subIssuesSummary: Components.Schemas.SubIssuesSummary? = nil, + issueDependenciesSummary: Components.Schemas.IssueDependenciesSummary? = nil, + issueFieldValues: [Components.Schemas.IssueFieldValue]? = nil, state: Swift.String, stateReason: Swift.String? = nil, assignee: Components.Schemas.NullableSimpleUser? = nil, @@ -3817,6 +4089,8 @@ public enum Components { self.user = user self.labels = labels self.subIssuesSummary = subIssuesSummary + self.issueDependenciesSummary = issueDependenciesSummary + self.issueFieldValues = issueFieldValues self.state = state self.stateReason = stateReason self.assignee = assignee @@ -3856,6 +4130,8 @@ public enum Components { case user case labels case subIssuesSummary = "sub_issues_summary" + case issueDependenciesSummary = "issue_dependencies_summary" + case issueFieldValues = "issue_field_values" case state case stateReason = "state_reason" case assignee @@ -5716,9 +5992,19 @@ public enum Operations { } /// Search issues and pull requests /// - /// > [!WARNING] - /// > **Notice:** Search for issues and pull requests will be overridden by advanced search on September 4, 2025. - /// > You can read more about this change on [the GitHub blog](https://github.blog/changelog/2025-03-06-github-issues-projects-api-support-for-issues-advanced-search-and-more/). + /// Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api). + /// + /// When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted + /// search results, see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata). + /// + /// For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. + /// + /// `q=windows+label:bug+language:python+state:open&sort=created&order=asc` + /// + /// This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. + /// + /// > [!NOTE] + /// > For requests made by GitHub Apps with a user access token, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." /// /// - Remark: HTTP `GET /search/issues`. /// - Remark: Generated from `#/paths//search/issues/get(search/issues-and-pull-requests)`. diff --git a/Sources/secret-scanning/Client.swift b/Sources/secret-scanning/Client.swift index 78ceb861882..da7e340d4d6 100644 --- a/Sources/secret-scanning/Client.swift +++ b/Sources/secret-scanning/Client.swift @@ -38,27 +38,25 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } - /// List secret scanning alerts for an enterprise - /// - /// Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest. + /// List secret scanning alerts for an organization /// - /// Alerts are only returned for organizations in the enterprise for which the authenticated user is an organization owner or a [security manager](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization). + /// Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest. /// - /// The authenticated user must be a member of the enterprise in order to use this endpoint. + /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope or `security_events` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. /// - /// - Remark: HTTP `GET /enterprises/{enterprise}/secret-scanning/alerts`. - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-enterprise)`. - public func secretScanningListAlertsForEnterprise(_ input: Operations.SecretScanningListAlertsForEnterprise.Input) async throws -> Operations.SecretScanningListAlertsForEnterprise.Output { + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/alerts`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-org)`. + public func secretScanningListAlertsForOrg(_ input: Operations.SecretScanningListAlertsForOrg.Input) async throws -> Operations.SecretScanningListAlertsForOrg.Output { try await client.send( input: input, - forOperation: Operations.SecretScanningListAlertsForEnterprise.id, + forOperation: Operations.SecretScanningListAlertsForOrg.id, serializer: { input in let path = try converter.renderedPath( - template: "/enterprises/{}/secret-scanning/alerts", + template: "/orgs/{}/secret-scanning/alerts", parameters: [ - input.path.enterprise + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -101,6 +99,13 @@ public struct Client: APIProtocol { name: "direction", value: input.query.direction ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -143,6 +148,13 @@ public struct Client: APIProtocol { name: "is_multi_repo", value: input.query.isMultiRepo ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "hide_secret", + value: input.query.hideSecret + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -152,13 +164,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.SecretScanningListAlertsForEnterprise.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + let headers: Operations.SecretScanningListAlertsForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( in: response.headerFields, name: "Link", as: Components.Headers.Link.self )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SecretScanningListAlertsForEnterprise.Output.Ok.Body + let body: Operations.SecretScanningListAlertsForOrg.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -237,23 +249,21 @@ public struct Client: APIProtocol { } ) } - /// List secret scanning alerts for an organization + /// List organization pattern configurations /// - /// Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest. + /// Lists the secret scanning pattern configurations for an organization. /// - /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. + /// Personal access tokens (classic) need the `read:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/alerts`. - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-org)`. - public func secretScanningListAlertsForOrg(_ input: Operations.SecretScanningListAlertsForOrg.Input) async throws -> Operations.SecretScanningListAlertsForOrg.Output { + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)`. + public func secretScanningListOrgPatternConfigs(_ input: Operations.SecretScanningListOrgPatternConfigs.Input) async throws -> Operations.SecretScanningListOrgPatternConfigs.Output { try await client.send( input: input, - forOperation: Operations.SecretScanningListAlertsForOrg.id, + forOperation: Operations.SecretScanningListOrgPatternConfigs.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/secret-scanning/alerts", + template: "/orgs/{}/secret-scanning/pattern-configurations", parameters: [ input.path.org ] @@ -263,106 +273,136 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "state", - value: input.query.state - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "secret_type", - value: input.query.secretType - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "resolution", - value: input.query.resolution - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "sort", - value: input.query.sort - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "direction", - value: input.query.direction - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "before", - value: input.query.before - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "after", - value: input.query.after - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "validity", - value: input.query.validity + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "is_publicly_leaked", - value: input.query.isPubliclyLeaked + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.SecretScanningListOrgPatternConfigs.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.SecretScanningPatternConfiguration.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update organization pattern configurations + /// + /// Updates the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)`. + public func secretScanningUpdateOrgPatternConfigs(_ input: Operations.SecretScanningUpdateOrgPatternConfigs.Input) async throws -> Operations.SecretScanningUpdateOrgPatternConfigs.Output { + try await client.send( + input: input, + forOperation: Operations.SecretScanningUpdateOrgPatternConfigs.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/secret-scanning/pattern-configurations", + parameters: [ + input.path.org + ] ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "is_multi_repo", - value: input.query.isMultiRepo + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch ) + suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.SecretScanningListAlertsForOrg.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.Link.self - )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SecretScanningListAlertsForOrg.Output.Ok.Body + let body: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -372,7 +412,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.OrganizationSecretScanningAlert].self, + Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -381,10 +421,60 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.NotFound.Body @@ -407,9 +497,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 503: + case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ServiceUnavailable.Body + let body: Components.Responses.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -419,7 +509,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -428,7 +518,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .serviceUnavailable(.init(body: body)) + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -552,6 +664,13 @@ public struct Client: APIProtocol { name: "is_multi_repo", value: input.query.isMultiRepo ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "hide_secret", + value: input.query.hideSecret + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -646,6 +765,13 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "hide_secret", + value: input.query.hideSecret + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -1047,6 +1173,9 @@ public struct Client: APIProtocol { /// /// Lists the latest default incremental and backfill scans by type for a repository. Scans from Copilot Secret Scanning are not included. /// + /// > [!NOTE] + /// > This endpoint requires [GitHub Advanced Security](https://docs.github.com/get-started/learning-about-github/about-github-advanced-security)." + /// /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/scan-history`. diff --git a/Sources/secret-scanning/Types.swift b/Sources/secret-scanning/Types.swift index 61bbdaa0b9e..aca48a2859c 100644 --- a/Sources/secret-scanning/Types.swift +++ b/Sources/secret-scanning/Types.swift @@ -11,19 +11,6 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { - /// List secret scanning alerts for an enterprise - /// - /// Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest. - /// - /// Alerts are only returned for organizations in the enterprise for which the authenticated user is an organization owner or a [security manager](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization). - /// - /// The authenticated user must be a member of the enterprise in order to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope or `security_events` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /enterprises/{enterprise}/secret-scanning/alerts`. - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-enterprise)`. - func secretScanningListAlertsForEnterprise(_ input: Operations.SecretScanningListAlertsForEnterprise.Input) async throws -> Operations.SecretScanningListAlertsForEnterprise.Output /// List secret scanning alerts for an organization /// /// Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest. @@ -35,6 +22,24 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/alerts`. /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-org)`. func secretScanningListAlertsForOrg(_ input: Operations.SecretScanningListAlertsForOrg.Input) async throws -> Operations.SecretScanningListAlertsForOrg.Output + /// List organization pattern configurations + /// + /// Lists the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)`. + func secretScanningListOrgPatternConfigs(_ input: Operations.SecretScanningListOrgPatternConfigs.Input) async throws -> Operations.SecretScanningListOrgPatternConfigs.Output + /// Update organization pattern configurations + /// + /// Updates the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)`. + func secretScanningUpdateOrgPatternConfigs(_ input: Operations.SecretScanningUpdateOrgPatternConfigs.Input) async throws -> Operations.SecretScanningUpdateOrgPatternConfigs.Output /// List secret scanning alerts for a repository /// /// Lists secret scanning alerts for an eligible repository, from newest to oldest. @@ -94,6 +99,9 @@ public protocol APIProtocol: Sendable { /// /// Lists the latest default incremental and backfill scans by type for a repository. Scans from Copilot Secret Scanning are not included. /// + /// > [!NOTE] + /// > This endpoint requires [GitHub Advanced Security](https://docs.github.com/get-started/learning-about-github/about-github-advanced-security)." + /// /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/scan-history`. @@ -103,29 +111,6 @@ public protocol APIProtocol: Sendable { /// Convenience overloads for operation inputs. extension APIProtocol { - /// List secret scanning alerts for an enterprise - /// - /// Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest. - /// - /// Alerts are only returned for organizations in the enterprise for which the authenticated user is an organization owner or a [security manager](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization). - /// - /// The authenticated user must be a member of the enterprise in order to use this endpoint. - /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope or `security_events` scope to use this endpoint. - /// - /// - Remark: HTTP `GET /enterprises/{enterprise}/secret-scanning/alerts`. - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-enterprise)`. - public func secretScanningListAlertsForEnterprise( - path: Operations.SecretScanningListAlertsForEnterprise.Input.Path, - query: Operations.SecretScanningListAlertsForEnterprise.Input.Query = .init(), - headers: Operations.SecretScanningListAlertsForEnterprise.Input.Headers = .init() - ) async throws -> Operations.SecretScanningListAlertsForEnterprise.Output { - try await secretScanningListAlertsForEnterprise(Operations.SecretScanningListAlertsForEnterprise.Input( - path: path, - query: query, - headers: headers - )) - } /// List secret scanning alerts for an organization /// /// Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest. @@ -147,6 +132,42 @@ extension APIProtocol { headers: headers )) } + /// List organization pattern configurations + /// + /// Lists the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)`. + public func secretScanningListOrgPatternConfigs( + path: Operations.SecretScanningListOrgPatternConfigs.Input.Path, + headers: Operations.SecretScanningListOrgPatternConfigs.Input.Headers = .init() + ) async throws -> Operations.SecretScanningListOrgPatternConfigs.Output { + try await secretScanningListOrgPatternConfigs(Operations.SecretScanningListOrgPatternConfigs.Input( + path: path, + headers: headers + )) + } + /// Update organization pattern configurations + /// + /// Updates the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)`. + public func secretScanningUpdateOrgPatternConfigs( + path: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Path, + headers: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Headers = .init(), + body: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body + ) async throws -> Operations.SecretScanningUpdateOrgPatternConfigs.Output { + try await secretScanningUpdateOrgPatternConfigs(Operations.SecretScanningUpdateOrgPatternConfigs.Input( + path: path, + headers: headers, + body: body + )) + } /// List secret scanning alerts for a repository /// /// Lists secret scanning alerts for an eligible repository, from newest to oldest. @@ -180,10 +201,12 @@ extension APIProtocol { /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)`. public func secretScanningGetAlert( path: Operations.SecretScanningGetAlert.Input.Path, + query: Operations.SecretScanningGetAlert.Input.Query = .init(), headers: Operations.SecretScanningGetAlert.Input.Headers = .init() ) async throws -> Operations.SecretScanningGetAlert.Output { try await secretScanningGetAlert(Operations.SecretScanningGetAlert.Input( path: path, + query: query, headers: headers )) } @@ -254,6 +277,9 @@ extension APIProtocol { /// /// Lists the latest default incremental and backfill scans by type for a repository. Scans from Copilot Secret Scanning are not included. /// + /// > [!NOTE] + /// > This endpoint requires [GitHub Advanced Security](https://docs.github.com/get-started/learning-about-github/about-github-advanced-security)." + /// /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/scan-history`. @@ -474,6 +500,180 @@ public enum Components { case status } } + /// Scim Error + /// + /// - Remark: Generated from `#/components/schemas/scim-error`. + public struct ScimError: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/scim-error/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/scim-error/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/scim-error/detail`. + public var detail: Swift.String? + /// - Remark: Generated from `#/components/schemas/scim-error/status`. + public var status: Swift.Int? + /// - Remark: Generated from `#/components/schemas/scim-error/scimType`. + public var scimType: Swift.String? + /// - Remark: Generated from `#/components/schemas/scim-error/schemas`. + public var schemas: [Swift.String]? + /// Creates a new `ScimError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - detail: + /// - status: + /// - scimType: + /// - schemas: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + detail: Swift.String? = nil, + status: Swift.Int? = nil, + scimType: Swift.String? = nil, + schemas: [Swift.String]? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.detail = detail + self.status = status + self.scimType = scimType + self.schemas = schemas + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case detail + case status + case scimType + case schemas + } + } + /// Validation Error + /// + /// - Remark: Generated from `#/components/schemas/validation-error`. + public struct ValidationError: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`. + public var documentationUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/field`. + public var field: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/code`. + public var code: Swift.String + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/index`. + public var index: Swift.Int? + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case1`. + case case1(Swift.String?) + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case2`. + case case2(Swift.Int?) + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`. + case case3([Swift.String]?) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value`. + public var value: Components.Schemas.ValidationError.ErrorsPayloadPayload.ValuePayload? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - resource: + /// - field: + /// - message: + /// - code: + /// - index: + /// - value: + public init( + resource: Swift.String? = nil, + field: Swift.String? = nil, + message: Swift.String? = nil, + code: Swift.String, + index: Swift.Int? = nil, + value: Components.Schemas.ValidationError.ErrorsPayloadPayload.ValuePayload? = nil + ) { + self.resource = resource + self.field = field + self.message = message + self.code = code + self.index = index + self.value = value + } + public enum CodingKeys: String, CodingKey { + case resource + case field + case message + case code + case index + case value + } + } + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public typealias ErrorsPayload = [Components.Schemas.ValidationError.ErrorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/validation-error/errors`. + public var errors: Components.Schemas.ValidationError.ErrorsPayload? + /// Creates a new `ValidationError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String, + documentationUrl: Swift.String, + errors: Components.Schemas.ValidationError.ErrorsPayload? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } /// A GitHub user. /// /// - Remark: Generated from `#/components/schemas/nullable-simple-user`. @@ -1034,286 +1234,605 @@ public enum Components { case revoked = "revoked" case usedInTests = "used_in_tests" } - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert`. - public struct OrganizationSecretScanningAlert: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/number`. - public var number: Components.Schemas.AlertNumber? - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/created_at`. - public var createdAt: Components.Schemas.AlertCreatedAt? - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/updated_at`. - public var updatedAt: Components.Schemas.NullableAlertUpdatedAt? - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/url`. - public var url: Components.Schemas.AlertUrl? - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/html_url`. - public var htmlUrl: Components.Schemas.AlertHtmlUrl? - /// The REST API URL of the code locations for this alert. - /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/locations_url`. - public var locationsUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/state`. - public var state: Components.Schemas.SecretScanningAlertState? - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/resolution`. - public var resolution: Components.Schemas.SecretScanningAlertResolution? - /// The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/resolved_at`. - public var resolvedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/resolved_by`. - public var resolvedBy: Components.Schemas.NullableSimpleUser? - /// The type of secret that secret scanning detected. + /// Represents a 'commit' secret scanning location type. This location type shows that a secret was detected inside a commit to a repository. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit`. + public struct SecretScanningLocationCommit: Codable, Hashable, Sendable { + /// The file path in the repository /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/secret_type`. - public var secretType: Swift.String? - /// User-friendly name for the detected secret, matching the `secret_type`. - /// For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/path`. + public var path: Swift.String + /// Line number at which the secret starts in the file /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/secret_type_display_name`. - public var secretTypeDisplayName: Swift.String? - /// The secret that was detected. + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/start_line`. + public var startLine: Swift.Double + /// Line number at which the secret ends in the file /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/secret`. - public var secret: Swift.String? - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/repository`. - public var repository: Components.Schemas.SimpleRepository? - /// Whether push protection was bypassed for the detected secret. + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/end_line`. + public var endLine: Swift.Double + /// The column at which the secret starts within the start line when the file is interpreted as 8BIT ASCII /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypassed`. - public var pushProtectionBypassed: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypassed_by`. - public var pushProtectionBypassedBy: Components.Schemas.NullableSimpleUser? - /// The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/start_column`. + public var startColumn: Swift.Double + /// The column at which the secret ends within the end line when the file is interpreted as 8BIT ASCII /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypassed_at`. - public var pushProtectionBypassedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypass_request_reviewer`. - public var pushProtectionBypassRequestReviewer: Components.Schemas.NullableSimpleUser? - /// An optional comment when reviewing a push protection bypass. + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/end_column`. + public var endColumn: Swift.Double + /// SHA-1 hash ID of the associated blob /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypass_request_reviewer_comment`. - public var pushProtectionBypassRequestReviewerComment: Swift.String? - /// An optional comment when requesting a push protection bypass. + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/blob_sha`. + public var blobSha: Swift.String + /// The API URL to get the associated blob resource /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypass_request_comment`. - public var pushProtectionBypassRequestComment: Swift.String? - /// The URL to a push protection bypass request. + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/blob_url`. + public var blobUrl: Swift.String + /// SHA-1 hash ID of the associated commit /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypass_request_html_url`. - public var pushProtectionBypassRequestHtmlUrl: Swift.String? - /// The comment that was optionally added when this alert was closed + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/commit_sha`. + public var commitSha: Swift.String + /// The API URL to get the associated commit resource /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/resolution_comment`. - public var resolutionComment: Swift.String? - /// The token status as of the latest validity check. + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/commit_url`. + public var commitUrl: Swift.String + /// Creates a new `SecretScanningLocationCommit`. /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/validity`. - @frozen public enum ValidityPayload: String, Codable, Hashable, Sendable, CaseIterable { - case active = "active" - case inactive = "inactive" - case unknown = "unknown" + /// - Parameters: + /// - path: The file path in the repository + /// - startLine: Line number at which the secret starts in the file + /// - endLine: Line number at which the secret ends in the file + /// - startColumn: The column at which the secret starts within the start line when the file is interpreted as 8BIT ASCII + /// - endColumn: The column at which the secret ends within the end line when the file is interpreted as 8BIT ASCII + /// - blobSha: SHA-1 hash ID of the associated blob + /// - blobUrl: The API URL to get the associated blob resource + /// - commitSha: SHA-1 hash ID of the associated commit + /// - commitUrl: The API URL to get the associated commit resource + public init( + path: Swift.String, + startLine: Swift.Double, + endLine: Swift.Double, + startColumn: Swift.Double, + endColumn: Swift.Double, + blobSha: Swift.String, + blobUrl: Swift.String, + commitSha: Swift.String, + commitUrl: Swift.String + ) { + self.path = path + self.startLine = startLine + self.endLine = endLine + self.startColumn = startColumn + self.endColumn = endColumn + self.blobSha = blobSha + self.blobUrl = blobUrl + self.commitSha = commitSha + self.commitUrl = commitUrl } - /// The token status as of the latest validity check. + public enum CodingKeys: String, CodingKey { + case path + case startLine = "start_line" + case endLine = "end_line" + case startColumn = "start_column" + case endColumn = "end_column" + case blobSha = "blob_sha" + case blobUrl = "blob_url" + case commitSha = "commit_sha" + case commitUrl = "commit_url" + } + } + /// Represents a 'wiki_commit' secret scanning location type. This location type shows that a secret was detected inside a commit to a repository wiki. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit`. + public struct SecretScanningLocationWikiCommit: Codable, Hashable, Sendable { + /// The file path of the wiki page /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/validity`. - public var validity: Components.Schemas.OrganizationSecretScanningAlert.ValidityPayload? - /// Whether the secret was publicly leaked. + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/path`. + public var path: Swift.String + /// Line number at which the secret starts in the file /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/publicly_leaked`. - public var publiclyLeaked: Swift.Bool? - /// Whether the detected secret was found in multiple repositories in the same organization or enterprise. + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/start_line`. + public var startLine: Swift.Double + /// Line number at which the secret ends in the file /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/multi_repo`. - public var multiRepo: Swift.Bool? - /// A boolean value representing whether or not alert is base64 encoded + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/end_line`. + public var endLine: Swift.Double + /// The column at which the secret starts within the start line when the file is interpreted as 8-bit ASCII. /// - /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/is_base64_encoded`. - public var isBase64Encoded: Swift.Bool? - /// Creates a new `OrganizationSecretScanningAlert`. + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/start_column`. + public var startColumn: Swift.Double + /// The column at which the secret ends within the end line when the file is interpreted as 8-bit ASCII. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/end_column`. + public var endColumn: Swift.Double + /// SHA-1 hash ID of the associated blob + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/blob_sha`. + public var blobSha: Swift.String + /// The GitHub URL to get the associated wiki page + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/page_url`. + public var pageUrl: Swift.String + /// SHA-1 hash ID of the associated commit + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/commit_sha`. + public var commitSha: Swift.String + /// The GitHub URL to get the associated wiki commit + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/commit_url`. + public var commitUrl: Swift.String + /// Creates a new `SecretScanningLocationWikiCommit`. /// /// - Parameters: - /// - number: - /// - createdAt: - /// - updatedAt: - /// - url: - /// - htmlUrl: - /// - locationsUrl: The REST API URL of the code locations for this alert. - /// - state: - /// - resolution: - /// - resolvedAt: The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - resolvedBy: - /// - secretType: The type of secret that secret scanning detected. - /// - secretTypeDisplayName: User-friendly name for the detected secret, matching the `secret_type`. - /// - secret: The secret that was detected. - /// - repository: - /// - pushProtectionBypassed: Whether push protection was bypassed for the detected secret. - /// - pushProtectionBypassedBy: - /// - pushProtectionBypassedAt: The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - pushProtectionBypassRequestReviewer: - /// - pushProtectionBypassRequestReviewerComment: An optional comment when reviewing a push protection bypass. - /// - pushProtectionBypassRequestComment: An optional comment when requesting a push protection bypass. - /// - pushProtectionBypassRequestHtmlUrl: The URL to a push protection bypass request. - /// - resolutionComment: The comment that was optionally added when this alert was closed - /// - validity: The token status as of the latest validity check. - /// - publiclyLeaked: Whether the secret was publicly leaked. - /// - multiRepo: Whether the detected secret was found in multiple repositories in the same organization or enterprise. - /// - isBase64Encoded: A boolean value representing whether or not alert is base64 encoded + /// - path: The file path of the wiki page + /// - startLine: Line number at which the secret starts in the file + /// - endLine: Line number at which the secret ends in the file + /// - startColumn: The column at which the secret starts within the start line when the file is interpreted as 8-bit ASCII. + /// - endColumn: The column at which the secret ends within the end line when the file is interpreted as 8-bit ASCII. + /// - blobSha: SHA-1 hash ID of the associated blob + /// - pageUrl: The GitHub URL to get the associated wiki page + /// - commitSha: SHA-1 hash ID of the associated commit + /// - commitUrl: The GitHub URL to get the associated wiki commit public init( - number: Components.Schemas.AlertNumber? = nil, - createdAt: Components.Schemas.AlertCreatedAt? = nil, - updatedAt: Components.Schemas.NullableAlertUpdatedAt? = nil, - url: Components.Schemas.AlertUrl? = nil, - htmlUrl: Components.Schemas.AlertHtmlUrl? = nil, - locationsUrl: Swift.String? = nil, - state: Components.Schemas.SecretScanningAlertState? = nil, - resolution: Components.Schemas.SecretScanningAlertResolution? = nil, - resolvedAt: Foundation.Date? = nil, - resolvedBy: Components.Schemas.NullableSimpleUser? = nil, - secretType: Swift.String? = nil, - secretTypeDisplayName: Swift.String? = nil, - secret: Swift.String? = nil, - repository: Components.Schemas.SimpleRepository? = nil, - pushProtectionBypassed: Swift.Bool? = nil, - pushProtectionBypassedBy: Components.Schemas.NullableSimpleUser? = nil, - pushProtectionBypassedAt: Foundation.Date? = nil, - pushProtectionBypassRequestReviewer: Components.Schemas.NullableSimpleUser? = nil, - pushProtectionBypassRequestReviewerComment: Swift.String? = nil, - pushProtectionBypassRequestComment: Swift.String? = nil, - pushProtectionBypassRequestHtmlUrl: Swift.String? = nil, - resolutionComment: Swift.String? = nil, - validity: Components.Schemas.OrganizationSecretScanningAlert.ValidityPayload? = nil, - publiclyLeaked: Swift.Bool? = nil, - multiRepo: Swift.Bool? = nil, - isBase64Encoded: Swift.Bool? = nil + path: Swift.String, + startLine: Swift.Double, + endLine: Swift.Double, + startColumn: Swift.Double, + endColumn: Swift.Double, + blobSha: Swift.String, + pageUrl: Swift.String, + commitSha: Swift.String, + commitUrl: Swift.String ) { - self.number = number - self.createdAt = createdAt - self.updatedAt = updatedAt - self.url = url - self.htmlUrl = htmlUrl - self.locationsUrl = locationsUrl - self.state = state - self.resolution = resolution - self.resolvedAt = resolvedAt - self.resolvedBy = resolvedBy - self.secretType = secretType - self.secretTypeDisplayName = secretTypeDisplayName - self.secret = secret - self.repository = repository - self.pushProtectionBypassed = pushProtectionBypassed - self.pushProtectionBypassedBy = pushProtectionBypassedBy - self.pushProtectionBypassedAt = pushProtectionBypassedAt - self.pushProtectionBypassRequestReviewer = pushProtectionBypassRequestReviewer - self.pushProtectionBypassRequestReviewerComment = pushProtectionBypassRequestReviewerComment - self.pushProtectionBypassRequestComment = pushProtectionBypassRequestComment - self.pushProtectionBypassRequestHtmlUrl = pushProtectionBypassRequestHtmlUrl - self.resolutionComment = resolutionComment - self.validity = validity - self.publiclyLeaked = publiclyLeaked - self.multiRepo = multiRepo - self.isBase64Encoded = isBase64Encoded + self.path = path + self.startLine = startLine + self.endLine = endLine + self.startColumn = startColumn + self.endColumn = endColumn + self.blobSha = blobSha + self.pageUrl = pageUrl + self.commitSha = commitSha + self.commitUrl = commitUrl } public enum CodingKeys: String, CodingKey { - case number - case createdAt = "created_at" - case updatedAt = "updated_at" - case url - case htmlUrl = "html_url" - case locationsUrl = "locations_url" - case state - case resolution - case resolvedAt = "resolved_at" - case resolvedBy = "resolved_by" - case secretType = "secret_type" - case secretTypeDisplayName = "secret_type_display_name" - case secret - case repository - case pushProtectionBypassed = "push_protection_bypassed" - case pushProtectionBypassedBy = "push_protection_bypassed_by" - case pushProtectionBypassedAt = "push_protection_bypassed_at" - case pushProtectionBypassRequestReviewer = "push_protection_bypass_request_reviewer" - case pushProtectionBypassRequestReviewerComment = "push_protection_bypass_request_reviewer_comment" - case pushProtectionBypassRequestComment = "push_protection_bypass_request_comment" - case pushProtectionBypassRequestHtmlUrl = "push_protection_bypass_request_html_url" - case resolutionComment = "resolution_comment" - case validity - case publiclyLeaked = "publicly_leaked" - case multiRepo = "multi_repo" - case isBase64Encoded = "is_base64_encoded" + case path + case startLine = "start_line" + case endLine = "end_line" + case startColumn = "start_column" + case endColumn = "end_column" + case blobSha = "blob_sha" + case pageUrl = "page_url" + case commitSha = "commit_sha" + case commitUrl = "commit_url" } } - /// The ID of the push protection bypass placeholder. This value is returned on any push protected routes. + /// Represents an 'issue_title' secret scanning location type. This location type shows that a secret was detected in the title of an issue. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-push-protection-bypass-placeholder-id`. - public typealias SecretScanningPushProtectionBypassPlaceholderId = Swift.String - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert`. - public struct SecretScanningAlert: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/number`. + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-title`. + public struct SecretScanningLocationIssueTitle: Codable, Hashable, Sendable { + /// The API URL to get the issue where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-title/issue_title_url`. + public var issueTitleUrl: Swift.String + /// Creates a new `SecretScanningLocationIssueTitle`. + /// + /// - Parameters: + /// - issueTitleUrl: The API URL to get the issue where the secret was detected. + public init(issueTitleUrl: Swift.String) { + self.issueTitleUrl = issueTitleUrl + } + public enum CodingKeys: String, CodingKey { + case issueTitleUrl = "issue_title_url" + } + } + /// Represents an 'issue_body' secret scanning location type. This location type shows that a secret was detected in the body of an issue. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-body`. + public struct SecretScanningLocationIssueBody: Codable, Hashable, Sendable { + /// The API URL to get the issue where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-body/issue_body_url`. + public var issueBodyUrl: Swift.String + /// Creates a new `SecretScanningLocationIssueBody`. + /// + /// - Parameters: + /// - issueBodyUrl: The API URL to get the issue where the secret was detected. + public init(issueBodyUrl: Swift.String) { + self.issueBodyUrl = issueBodyUrl + } + public enum CodingKeys: String, CodingKey { + case issueBodyUrl = "issue_body_url" + } + } + /// Represents an 'issue_comment' secret scanning location type. This location type shows that a secret was detected in a comment on an issue. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-comment`. + public struct SecretScanningLocationIssueComment: Codable, Hashable, Sendable { + /// The API URL to get the issue comment where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-comment/issue_comment_url`. + public var issueCommentUrl: Swift.String + /// Creates a new `SecretScanningLocationIssueComment`. + /// + /// - Parameters: + /// - issueCommentUrl: The API URL to get the issue comment where the secret was detected. + public init(issueCommentUrl: Swift.String) { + self.issueCommentUrl = issueCommentUrl + } + public enum CodingKeys: String, CodingKey { + case issueCommentUrl = "issue_comment_url" + } + } + /// Represents a 'discussion_title' secret scanning location type. This location type shows that a secret was detected in the title of a discussion. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-discussion-title`. + public struct SecretScanningLocationDiscussionTitle: Codable, Hashable, Sendable { + /// The URL to the discussion where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-discussion-title/discussion_title_url`. + public var discussionTitleUrl: Swift.String + /// Creates a new `SecretScanningLocationDiscussionTitle`. + /// + /// - Parameters: + /// - discussionTitleUrl: The URL to the discussion where the secret was detected. + public init(discussionTitleUrl: Swift.String) { + self.discussionTitleUrl = discussionTitleUrl + } + public enum CodingKeys: String, CodingKey { + case discussionTitleUrl = "discussion_title_url" + } + } + /// Represents a 'discussion_body' secret scanning location type. This location type shows that a secret was detected in the body of a discussion. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-discussion-body`. + public struct SecretScanningLocationDiscussionBody: Codable, Hashable, Sendable { + /// The URL to the discussion where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-discussion-body/discussion_body_url`. + public var discussionBodyUrl: Swift.String + /// Creates a new `SecretScanningLocationDiscussionBody`. + /// + /// - Parameters: + /// - discussionBodyUrl: The URL to the discussion where the secret was detected. + public init(discussionBodyUrl: Swift.String) { + self.discussionBodyUrl = discussionBodyUrl + } + public enum CodingKeys: String, CodingKey { + case discussionBodyUrl = "discussion_body_url" + } + } + /// Represents a 'discussion_comment' secret scanning location type. This location type shows that a secret was detected in a comment on a discussion. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-discussion-comment`. + public struct SecretScanningLocationDiscussionComment: Codable, Hashable, Sendable { + /// The API URL to get the discussion comment where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-discussion-comment/discussion_comment_url`. + public var discussionCommentUrl: Swift.String + /// Creates a new `SecretScanningLocationDiscussionComment`. + /// + /// - Parameters: + /// - discussionCommentUrl: The API URL to get the discussion comment where the secret was detected. + public init(discussionCommentUrl: Swift.String) { + self.discussionCommentUrl = discussionCommentUrl + } + public enum CodingKeys: String, CodingKey { + case discussionCommentUrl = "discussion_comment_url" + } + } + /// Represents a 'pull_request_title' secret scanning location type. This location type shows that a secret was detected in the title of a pull request. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-title`. + public struct SecretScanningLocationPullRequestTitle: Codable, Hashable, Sendable { + /// The API URL to get the pull request where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-title/pull_request_title_url`. + public var pullRequestTitleUrl: Swift.String + /// Creates a new `SecretScanningLocationPullRequestTitle`. + /// + /// - Parameters: + /// - pullRequestTitleUrl: The API URL to get the pull request where the secret was detected. + public init(pullRequestTitleUrl: Swift.String) { + self.pullRequestTitleUrl = pullRequestTitleUrl + } + public enum CodingKeys: String, CodingKey { + case pullRequestTitleUrl = "pull_request_title_url" + } + } + /// Represents a 'pull_request_body' secret scanning location type. This location type shows that a secret was detected in the body of a pull request. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-body`. + public struct SecretScanningLocationPullRequestBody: Codable, Hashable, Sendable { + /// The API URL to get the pull request where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-body/pull_request_body_url`. + public var pullRequestBodyUrl: Swift.String + /// Creates a new `SecretScanningLocationPullRequestBody`. + /// + /// - Parameters: + /// - pullRequestBodyUrl: The API URL to get the pull request where the secret was detected. + public init(pullRequestBodyUrl: Swift.String) { + self.pullRequestBodyUrl = pullRequestBodyUrl + } + public enum CodingKeys: String, CodingKey { + case pullRequestBodyUrl = "pull_request_body_url" + } + } + /// Represents a 'pull_request_comment' secret scanning location type. This location type shows that a secret was detected in a comment on a pull request. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-comment`. + public struct SecretScanningLocationPullRequestComment: Codable, Hashable, Sendable { + /// The API URL to get the pull request comment where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-comment/pull_request_comment_url`. + public var pullRequestCommentUrl: Swift.String + /// Creates a new `SecretScanningLocationPullRequestComment`. + /// + /// - Parameters: + /// - pullRequestCommentUrl: The API URL to get the pull request comment where the secret was detected. + public init(pullRequestCommentUrl: Swift.String) { + self.pullRequestCommentUrl = pullRequestCommentUrl + } + public enum CodingKeys: String, CodingKey { + case pullRequestCommentUrl = "pull_request_comment_url" + } + } + /// Represents a 'pull_request_review' secret scanning location type. This location type shows that a secret was detected in a review on a pull request. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-review`. + public struct SecretScanningLocationPullRequestReview: Codable, Hashable, Sendable { + /// The API URL to get the pull request review where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-review/pull_request_review_url`. + public var pullRequestReviewUrl: Swift.String + /// Creates a new `SecretScanningLocationPullRequestReview`. + /// + /// - Parameters: + /// - pullRequestReviewUrl: The API URL to get the pull request review where the secret was detected. + public init(pullRequestReviewUrl: Swift.String) { + self.pullRequestReviewUrl = pullRequestReviewUrl + } + public enum CodingKeys: String, CodingKey { + case pullRequestReviewUrl = "pull_request_review_url" + } + } + /// Represents a 'pull_request_review_comment' secret scanning location type. This location type shows that a secret was detected in a review comment on a pull request. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-review-comment`. + public struct SecretScanningLocationPullRequestReviewComment: Codable, Hashable, Sendable { + /// The API URL to get the pull request review comment where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-review-comment/pull_request_review_comment_url`. + public var pullRequestReviewCommentUrl: Swift.String + /// Creates a new `SecretScanningLocationPullRequestReviewComment`. + /// + /// - Parameters: + /// - pullRequestReviewCommentUrl: The API URL to get the pull request review comment where the secret was detected. + public init(pullRequestReviewCommentUrl: Swift.String) { + self.pullRequestReviewCommentUrl = pullRequestReviewCommentUrl + } + public enum CodingKeys: String, CodingKey { + case pullRequestReviewCommentUrl = "pull_request_review_comment_url" + } + } + /// Details on the location where the token was initially detected. This can be a commit, wiki commit, issue, discussion, pull request. + /// + /// + /// - Remark: Generated from `#/components/schemas/nullable-secret-scanning-first-detected-location`. + @frozen public enum NullableSecretScanningFirstDetectedLocation: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-secret-scanning-first-detected-location/case1`. + case SecretScanningLocationCommit(Components.Schemas.SecretScanningLocationCommit) + /// - Remark: Generated from `#/components/schemas/nullable-secret-scanning-first-detected-location/case2`. + case SecretScanningLocationWikiCommit(Components.Schemas.SecretScanningLocationWikiCommit) + /// - Remark: Generated from `#/components/schemas/nullable-secret-scanning-first-detected-location/case3`. + case SecretScanningLocationIssueTitle(Components.Schemas.SecretScanningLocationIssueTitle) + /// - Remark: Generated from `#/components/schemas/nullable-secret-scanning-first-detected-location/case4`. + case SecretScanningLocationIssueBody(Components.Schemas.SecretScanningLocationIssueBody) + /// - Remark: Generated from `#/components/schemas/nullable-secret-scanning-first-detected-location/case5`. + case SecretScanningLocationIssueComment(Components.Schemas.SecretScanningLocationIssueComment) + /// - Remark: Generated from `#/components/schemas/nullable-secret-scanning-first-detected-location/case6`. + case SecretScanningLocationDiscussionTitle(Components.Schemas.SecretScanningLocationDiscussionTitle) + /// - Remark: Generated from `#/components/schemas/nullable-secret-scanning-first-detected-location/case7`. + case SecretScanningLocationDiscussionBody(Components.Schemas.SecretScanningLocationDiscussionBody) + /// - Remark: Generated from `#/components/schemas/nullable-secret-scanning-first-detected-location/case8`. + case SecretScanningLocationDiscussionComment(Components.Schemas.SecretScanningLocationDiscussionComment) + /// - Remark: Generated from `#/components/schemas/nullable-secret-scanning-first-detected-location/case9`. + case SecretScanningLocationPullRequestTitle(Components.Schemas.SecretScanningLocationPullRequestTitle) + /// - Remark: Generated from `#/components/schemas/nullable-secret-scanning-first-detected-location/case10`. + case SecretScanningLocationPullRequestBody(Components.Schemas.SecretScanningLocationPullRequestBody) + /// - Remark: Generated from `#/components/schemas/nullable-secret-scanning-first-detected-location/case11`. + case SecretScanningLocationPullRequestComment(Components.Schemas.SecretScanningLocationPullRequestComment) + /// - Remark: Generated from `#/components/schemas/nullable-secret-scanning-first-detected-location/case12`. + case SecretScanningLocationPullRequestReview(Components.Schemas.SecretScanningLocationPullRequestReview) + /// - Remark: Generated from `#/components/schemas/nullable-secret-scanning-first-detected-location/case13`. + case SecretScanningLocationPullRequestReviewComment(Components.Schemas.SecretScanningLocationPullRequestReviewComment) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .SecretScanningLocationCommit(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .SecretScanningLocationWikiCommit(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .SecretScanningLocationIssueTitle(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .SecretScanningLocationIssueBody(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .SecretScanningLocationIssueComment(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .SecretScanningLocationDiscussionTitle(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .SecretScanningLocationDiscussionBody(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .SecretScanningLocationDiscussionComment(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .SecretScanningLocationPullRequestTitle(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .SecretScanningLocationPullRequestBody(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .SecretScanningLocationPullRequestComment(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .SecretScanningLocationPullRequestReview(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .SecretScanningLocationPullRequestReviewComment(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .SecretScanningLocationCommit(value): + try value.encode(to: encoder) + case let .SecretScanningLocationWikiCommit(value): + try value.encode(to: encoder) + case let .SecretScanningLocationIssueTitle(value): + try value.encode(to: encoder) + case let .SecretScanningLocationIssueBody(value): + try value.encode(to: encoder) + case let .SecretScanningLocationIssueComment(value): + try value.encode(to: encoder) + case let .SecretScanningLocationDiscussionTitle(value): + try value.encode(to: encoder) + case let .SecretScanningLocationDiscussionBody(value): + try value.encode(to: encoder) + case let .SecretScanningLocationDiscussionComment(value): + try value.encode(to: encoder) + case let .SecretScanningLocationPullRequestTitle(value): + try value.encode(to: encoder) + case let .SecretScanningLocationPullRequestBody(value): + try value.encode(to: encoder) + case let .SecretScanningLocationPullRequestComment(value): + try value.encode(to: encoder) + case let .SecretScanningLocationPullRequestReview(value): + try value.encode(to: encoder) + case let .SecretScanningLocationPullRequestReviewComment(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert`. + public struct OrganizationSecretScanningAlert: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/number`. public var number: Components.Schemas.AlertNumber? - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/created_at`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/created_at`. public var createdAt: Components.Schemas.AlertCreatedAt? - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/updated_at`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/updated_at`. public var updatedAt: Components.Schemas.NullableAlertUpdatedAt? - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/url`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/url`. public var url: Components.Schemas.AlertUrl? - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/html_url`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/html_url`. public var htmlUrl: Components.Schemas.AlertHtmlUrl? /// The REST API URL of the code locations for this alert. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/locations_url`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/locations_url`. public var locationsUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/state`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/state`. public var state: Components.Schemas.SecretScanningAlertState? - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/resolution`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/resolution`. public var resolution: Components.Schemas.SecretScanningAlertResolution? /// The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/resolved_at`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/resolved_at`. public var resolvedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/resolved_by`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/resolved_by`. public var resolvedBy: Components.Schemas.NullableSimpleUser? - /// An optional comment to resolve an alert. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/resolution_comment`. - public var resolutionComment: Swift.String? /// The type of secret that secret scanning detected. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/secret_type`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/secret_type`. public var secretType: Swift.String? /// User-friendly name for the detected secret, matching the `secret_type`. /// For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/secret_type_display_name`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/secret_type_display_name`. public var secretTypeDisplayName: Swift.String? /// The secret that was detected. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/secret`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/secret`. public var secret: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/repository`. + public var repository: Components.Schemas.SimpleRepository? /// Whether push protection was bypassed for the detected secret. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypassed`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypassed`. public var pushProtectionBypassed: Swift.Bool? - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypassed_by`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypassed_by`. public var pushProtectionBypassedBy: Components.Schemas.NullableSimpleUser? /// The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypassed_at`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypassed_at`. public var pushProtectionBypassedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypass_request_reviewer`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypass_request_reviewer`. public var pushProtectionBypassRequestReviewer: Components.Schemas.NullableSimpleUser? /// An optional comment when reviewing a push protection bypass. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypass_request_reviewer_comment`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypass_request_reviewer_comment`. public var pushProtectionBypassRequestReviewerComment: Swift.String? /// An optional comment when requesting a push protection bypass. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypass_request_comment`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypass_request_comment`. public var pushProtectionBypassRequestComment: Swift.String? /// The URL to a push protection bypass request. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypass_request_html_url`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/push_protection_bypass_request_html_url`. public var pushProtectionBypassRequestHtmlUrl: Swift.String? + /// The comment that was optionally added when this alert was closed + /// + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/resolution_comment`. + public var resolutionComment: Swift.String? /// The token status as of the latest validity check. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/validity`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/validity`. @frozen public enum ValidityPayload: String, Codable, Hashable, Sendable, CaseIterable { case active = "active" case inactive = "inactive" @@ -1321,21 +1840,29 @@ public enum Components { } /// The token status as of the latest validity check. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/validity`. - public var validity: Components.Schemas.SecretScanningAlert.ValidityPayload? - /// Whether the detected secret was publicly leaked. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/validity`. + public var validity: Components.Schemas.OrganizationSecretScanningAlert.ValidityPayload? + /// Whether the secret was publicly leaked. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/publicly_leaked`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/publicly_leaked`. public var publiclyLeaked: Swift.Bool? - /// Whether the detected secret was found in multiple repositories under the same organization or enterprise. + /// Whether the detected secret was found in multiple repositories in the same organization or enterprise. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/multi_repo`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/multi_repo`. public var multiRepo: Swift.Bool? /// A boolean value representing whether or not alert is base64 encoded /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/is_base64_encoded`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/is_base64_encoded`. public var isBase64Encoded: Swift.Bool? - /// Creates a new `SecretScanningAlert`. + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/first_location_detected`. + public var firstLocationDetected: Components.Schemas.NullableSecretScanningFirstDetectedLocation? + /// A boolean value representing whether or not the token in the alert was detected in more than one location. + /// + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/has_more_locations`. + public var hasMoreLocations: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/assigned_to`. + public var assignedTo: Components.Schemas.NullableSimpleUser? + /// Creates a new `OrganizationSecretScanningAlert`. /// /// - Parameters: /// - number: @@ -1348,10 +1875,10 @@ public enum Components { /// - resolution: /// - resolvedAt: The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. /// - resolvedBy: - /// - resolutionComment: An optional comment to resolve an alert. /// - secretType: The type of secret that secret scanning detected. /// - secretTypeDisplayName: User-friendly name for the detected secret, matching the `secret_type`. /// - secret: The secret that was detected. + /// - repository: /// - pushProtectionBypassed: Whether push protection was bypassed for the detected secret. /// - pushProtectionBypassedBy: /// - pushProtectionBypassedAt: The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. @@ -1359,10 +1886,14 @@ public enum Components { /// - pushProtectionBypassRequestReviewerComment: An optional comment when reviewing a push protection bypass. /// - pushProtectionBypassRequestComment: An optional comment when requesting a push protection bypass. /// - pushProtectionBypassRequestHtmlUrl: The URL to a push protection bypass request. + /// - resolutionComment: The comment that was optionally added when this alert was closed /// - validity: The token status as of the latest validity check. - /// - publiclyLeaked: Whether the detected secret was publicly leaked. - /// - multiRepo: Whether the detected secret was found in multiple repositories under the same organization or enterprise. + /// - publiclyLeaked: Whether the secret was publicly leaked. + /// - multiRepo: Whether the detected secret was found in multiple repositories in the same organization or enterprise. /// - isBase64Encoded: A boolean value representing whether or not alert is base64 encoded + /// - firstLocationDetected: + /// - hasMoreLocations: A boolean value representing whether or not the token in the alert was detected in more than one location. + /// - assignedTo: public init( number: Components.Schemas.AlertNumber? = nil, createdAt: Components.Schemas.AlertCreatedAt? = nil, @@ -1374,10 +1905,10 @@ public enum Components { resolution: Components.Schemas.SecretScanningAlertResolution? = nil, resolvedAt: Foundation.Date? = nil, resolvedBy: Components.Schemas.NullableSimpleUser? = nil, - resolutionComment: Swift.String? = nil, secretType: Swift.String? = nil, secretTypeDisplayName: Swift.String? = nil, secret: Swift.String? = nil, + repository: Components.Schemas.SimpleRepository? = nil, pushProtectionBypassed: Swift.Bool? = nil, pushProtectionBypassedBy: Components.Schemas.NullableSimpleUser? = nil, pushProtectionBypassedAt: Foundation.Date? = nil, @@ -1385,10 +1916,14 @@ public enum Components { pushProtectionBypassRequestReviewerComment: Swift.String? = nil, pushProtectionBypassRequestComment: Swift.String? = nil, pushProtectionBypassRequestHtmlUrl: Swift.String? = nil, - validity: Components.Schemas.SecretScanningAlert.ValidityPayload? = nil, + resolutionComment: Swift.String? = nil, + validity: Components.Schemas.OrganizationSecretScanningAlert.ValidityPayload? = nil, publiclyLeaked: Swift.Bool? = nil, multiRepo: Swift.Bool? = nil, - isBase64Encoded: Swift.Bool? = nil + isBase64Encoded: Swift.Bool? = nil, + firstLocationDetected: Components.Schemas.NullableSecretScanningFirstDetectedLocation? = nil, + hasMoreLocations: Swift.Bool? = nil, + assignedTo: Components.Schemas.NullableSimpleUser? = nil ) { self.number = number self.createdAt = createdAt @@ -1399,434 +1934,456 @@ public enum Components { self.state = state self.resolution = resolution self.resolvedAt = resolvedAt - self.resolvedBy = resolvedBy - self.resolutionComment = resolutionComment - self.secretType = secretType - self.secretTypeDisplayName = secretTypeDisplayName - self.secret = secret - self.pushProtectionBypassed = pushProtectionBypassed - self.pushProtectionBypassedBy = pushProtectionBypassedBy - self.pushProtectionBypassedAt = pushProtectionBypassedAt - self.pushProtectionBypassRequestReviewer = pushProtectionBypassRequestReviewer - self.pushProtectionBypassRequestReviewerComment = pushProtectionBypassRequestReviewerComment - self.pushProtectionBypassRequestComment = pushProtectionBypassRequestComment - self.pushProtectionBypassRequestHtmlUrl = pushProtectionBypassRequestHtmlUrl - self.validity = validity - self.publiclyLeaked = publiclyLeaked - self.multiRepo = multiRepo - self.isBase64Encoded = isBase64Encoded - } - public enum CodingKeys: String, CodingKey { - case number - case createdAt = "created_at" - case updatedAt = "updated_at" - case url - case htmlUrl = "html_url" - case locationsUrl = "locations_url" - case state - case resolution - case resolvedAt = "resolved_at" - case resolvedBy = "resolved_by" - case resolutionComment = "resolution_comment" - case secretType = "secret_type" - case secretTypeDisplayName = "secret_type_display_name" - case secret - case pushProtectionBypassed = "push_protection_bypassed" - case pushProtectionBypassedBy = "push_protection_bypassed_by" - case pushProtectionBypassedAt = "push_protection_bypassed_at" - case pushProtectionBypassRequestReviewer = "push_protection_bypass_request_reviewer" - case pushProtectionBypassRequestReviewerComment = "push_protection_bypass_request_reviewer_comment" - case pushProtectionBypassRequestComment = "push_protection_bypass_request_comment" - case pushProtectionBypassRequestHtmlUrl = "push_protection_bypass_request_html_url" - case validity - case publiclyLeaked = "publicly_leaked" - case multiRepo = "multi_repo" - case isBase64Encoded = "is_base64_encoded" - } - } - /// An optional comment when closing an alert. Cannot be updated or deleted. Must be `null` when changing `state` to `open`. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-resolution-comment`. - public typealias SecretScanningAlertResolutionComment = Swift.String - /// Represents a 'commit' secret scanning location type. This location type shows that a secret was detected inside a commit to a repository. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit`. - public struct SecretScanningLocationCommit: Codable, Hashable, Sendable { - /// The file path in the repository - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/path`. - public var path: Swift.String - /// Line number at which the secret starts in the file - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/start_line`. - public var startLine: Swift.Double - /// Line number at which the secret ends in the file - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/end_line`. - public var endLine: Swift.Double - /// The column at which the secret starts within the start line when the file is interpreted as 8BIT ASCII - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/start_column`. - public var startColumn: Swift.Double - /// The column at which the secret ends within the end line when the file is interpreted as 8BIT ASCII - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/end_column`. - public var endColumn: Swift.Double - /// SHA-1 hash ID of the associated blob - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/blob_sha`. - public var blobSha: Swift.String - /// The API URL to get the associated blob resource - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/blob_url`. - public var blobUrl: Swift.String - /// SHA-1 hash ID of the associated commit - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/commit_sha`. - public var commitSha: Swift.String - /// The API URL to get the associated commit resource - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/commit_url`. - public var commitUrl: Swift.String - /// Creates a new `SecretScanningLocationCommit`. - /// - /// - Parameters: - /// - path: The file path in the repository - /// - startLine: Line number at which the secret starts in the file - /// - endLine: Line number at which the secret ends in the file - /// - startColumn: The column at which the secret starts within the start line when the file is interpreted as 8BIT ASCII - /// - endColumn: The column at which the secret ends within the end line when the file is interpreted as 8BIT ASCII - /// - blobSha: SHA-1 hash ID of the associated blob - /// - blobUrl: The API URL to get the associated blob resource - /// - commitSha: SHA-1 hash ID of the associated commit - /// - commitUrl: The API URL to get the associated commit resource - public init( - path: Swift.String, - startLine: Swift.Double, - endLine: Swift.Double, - startColumn: Swift.Double, - endColumn: Swift.Double, - blobSha: Swift.String, - blobUrl: Swift.String, - commitSha: Swift.String, - commitUrl: Swift.String - ) { - self.path = path - self.startLine = startLine - self.endLine = endLine - self.startColumn = startColumn - self.endColumn = endColumn - self.blobSha = blobSha - self.blobUrl = blobUrl - self.commitSha = commitSha - self.commitUrl = commitUrl - } - public enum CodingKeys: String, CodingKey { - case path - case startLine = "start_line" - case endLine = "end_line" - case startColumn = "start_column" - case endColumn = "end_column" - case blobSha = "blob_sha" - case blobUrl = "blob_url" - case commitSha = "commit_sha" - case commitUrl = "commit_url" - } - } - /// Represents a 'wiki_commit' secret scanning location type. This location type shows that a secret was detected inside a commit to a repository wiki. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit`. - public struct SecretScanningLocationWikiCommit: Codable, Hashable, Sendable { - /// The file path of the wiki page - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/path`. - public var path: Swift.String - /// Line number at which the secret starts in the file - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/start_line`. - public var startLine: Swift.Double - /// Line number at which the secret ends in the file - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/end_line`. - public var endLine: Swift.Double - /// The column at which the secret starts within the start line when the file is interpreted as 8-bit ASCII. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/start_column`. - public var startColumn: Swift.Double - /// The column at which the secret ends within the end line when the file is interpreted as 8-bit ASCII. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/end_column`. - public var endColumn: Swift.Double - /// SHA-1 hash ID of the associated blob - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/blob_sha`. - public var blobSha: Swift.String - /// The GitHub URL to get the associated wiki page - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/page_url`. - public var pageUrl: Swift.String - /// SHA-1 hash ID of the associated commit - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/commit_sha`. - public var commitSha: Swift.String - /// The GitHub URL to get the associated wiki commit - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-wiki-commit/commit_url`. - public var commitUrl: Swift.String - /// Creates a new `SecretScanningLocationWikiCommit`. - /// - /// - Parameters: - /// - path: The file path of the wiki page - /// - startLine: Line number at which the secret starts in the file - /// - endLine: Line number at which the secret ends in the file - /// - startColumn: The column at which the secret starts within the start line when the file is interpreted as 8-bit ASCII. - /// - endColumn: The column at which the secret ends within the end line when the file is interpreted as 8-bit ASCII. - /// - blobSha: SHA-1 hash ID of the associated blob - /// - pageUrl: The GitHub URL to get the associated wiki page - /// - commitSha: SHA-1 hash ID of the associated commit - /// - commitUrl: The GitHub URL to get the associated wiki commit - public init( - path: Swift.String, - startLine: Swift.Double, - endLine: Swift.Double, - startColumn: Swift.Double, - endColumn: Swift.Double, - blobSha: Swift.String, - pageUrl: Swift.String, - commitSha: Swift.String, - commitUrl: Swift.String - ) { - self.path = path - self.startLine = startLine - self.endLine = endLine - self.startColumn = startColumn - self.endColumn = endColumn - self.blobSha = blobSha - self.pageUrl = pageUrl - self.commitSha = commitSha - self.commitUrl = commitUrl - } - public enum CodingKeys: String, CodingKey { - case path - case startLine = "start_line" - case endLine = "end_line" - case startColumn = "start_column" - case endColumn = "end_column" - case blobSha = "blob_sha" - case pageUrl = "page_url" - case commitSha = "commit_sha" - case commitUrl = "commit_url" - } - } - /// Represents an 'issue_title' secret scanning location type. This location type shows that a secret was detected in the title of an issue. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-title`. - public struct SecretScanningLocationIssueTitle: Codable, Hashable, Sendable { - /// The API URL to get the issue where the secret was detected. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-title/issue_title_url`. - public var issueTitleUrl: Swift.String - /// Creates a new `SecretScanningLocationIssueTitle`. - /// - /// - Parameters: - /// - issueTitleUrl: The API URL to get the issue where the secret was detected. - public init(issueTitleUrl: Swift.String) { - self.issueTitleUrl = issueTitleUrl + self.resolvedBy = resolvedBy + self.secretType = secretType + self.secretTypeDisplayName = secretTypeDisplayName + self.secret = secret + self.repository = repository + self.pushProtectionBypassed = pushProtectionBypassed + self.pushProtectionBypassedBy = pushProtectionBypassedBy + self.pushProtectionBypassedAt = pushProtectionBypassedAt + self.pushProtectionBypassRequestReviewer = pushProtectionBypassRequestReviewer + self.pushProtectionBypassRequestReviewerComment = pushProtectionBypassRequestReviewerComment + self.pushProtectionBypassRequestComment = pushProtectionBypassRequestComment + self.pushProtectionBypassRequestHtmlUrl = pushProtectionBypassRequestHtmlUrl + self.resolutionComment = resolutionComment + self.validity = validity + self.publiclyLeaked = publiclyLeaked + self.multiRepo = multiRepo + self.isBase64Encoded = isBase64Encoded + self.firstLocationDetected = firstLocationDetected + self.hasMoreLocations = hasMoreLocations + self.assignedTo = assignedTo } public enum CodingKeys: String, CodingKey { - case issueTitleUrl = "issue_title_url" + case number + case createdAt = "created_at" + case updatedAt = "updated_at" + case url + case htmlUrl = "html_url" + case locationsUrl = "locations_url" + case state + case resolution + case resolvedAt = "resolved_at" + case resolvedBy = "resolved_by" + case secretType = "secret_type" + case secretTypeDisplayName = "secret_type_display_name" + case secret + case repository + case pushProtectionBypassed = "push_protection_bypassed" + case pushProtectionBypassedBy = "push_protection_bypassed_by" + case pushProtectionBypassedAt = "push_protection_bypassed_at" + case pushProtectionBypassRequestReviewer = "push_protection_bypass_request_reviewer" + case pushProtectionBypassRequestReviewerComment = "push_protection_bypass_request_reviewer_comment" + case pushProtectionBypassRequestComment = "push_protection_bypass_request_comment" + case pushProtectionBypassRequestHtmlUrl = "push_protection_bypass_request_html_url" + case resolutionComment = "resolution_comment" + case validity + case publiclyLeaked = "publicly_leaked" + case multiRepo = "multi_repo" + case isBase64Encoded = "is_base64_encoded" + case firstLocationDetected = "first_location_detected" + case hasMoreLocations = "has_more_locations" + case assignedTo = "assigned_to" } } - /// Represents an 'issue_body' secret scanning location type. This location type shows that a secret was detected in the body of an issue. + /// The version of the entity. This is used to confirm you're updating the current version of the entity and mitigate unintentionally overriding someone else's update. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-body`. - public struct SecretScanningLocationIssueBody: Codable, Hashable, Sendable { - /// The API URL to get the issue where the secret was detected. + /// - Remark: Generated from `#/components/schemas/secret-scanning-row-version`. + public typealias SecretScanningRowVersion = Swift.String + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override`. + public struct SecretScanningPatternOverride: Codable, Hashable, Sendable { + /// The ID of the pattern. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-body/issue_body_url`. - public var issueBodyUrl: Swift.String - /// Creates a new `SecretScanningLocationIssueBody`. + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/token_type`. + public var tokenType: Swift.String? + /// The version of this pattern if it's a custom pattern. /// - /// - Parameters: - /// - issueBodyUrl: The API URL to get the issue where the secret was detected. - public init(issueBodyUrl: Swift.String) { - self.issueBodyUrl = issueBodyUrl - } - public enum CodingKeys: String, CodingKey { - case issueBodyUrl = "issue_body_url" - } - } - /// Represents an 'issue_comment' secret scanning location type. This location type shows that a secret was detected in a comment on an issue. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-comment`. - public struct SecretScanningLocationIssueComment: Codable, Hashable, Sendable { - /// The API URL to get the issue comment where the secret was detected. + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/custom_pattern_version`. + public var customPatternVersion: Swift.String? + /// The slug of the pattern. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-comment/issue_comment_url`. - public var issueCommentUrl: Swift.String - /// Creates a new `SecretScanningLocationIssueComment`. + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/slug`. + public var slug: Swift.String? + /// The user-friendly name for the pattern. /// - /// - Parameters: - /// - issueCommentUrl: The API URL to get the issue comment where the secret was detected. - public init(issueCommentUrl: Swift.String) { - self.issueCommentUrl = issueCommentUrl - } - public enum CodingKeys: String, CodingKey { - case issueCommentUrl = "issue_comment_url" - } - } - /// Represents a 'discussion_title' secret scanning location type. This location type shows that a secret was detected in the title of a discussion. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-discussion-title`. - public struct SecretScanningLocationDiscussionTitle: Codable, Hashable, Sendable { - /// The URL to the discussion where the secret was detected. + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/display_name`. + public var displayName: Swift.String? + /// The total number of alerts generated by this pattern. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-discussion-title/discussion_title_url`. - public var discussionTitleUrl: Swift.String - /// Creates a new `SecretScanningLocationDiscussionTitle`. + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/alert_total`. + public var alertTotal: Swift.Int? + /// The percentage of all alerts that this pattern represents, rounded to the nearest integer. /// - /// - Parameters: - /// - discussionTitleUrl: The URL to the discussion where the secret was detected. - public init(discussionTitleUrl: Swift.String) { - self.discussionTitleUrl = discussionTitleUrl - } - public enum CodingKeys: String, CodingKey { - case discussionTitleUrl = "discussion_title_url" - } - } - /// Represents a 'discussion_body' secret scanning location type. This location type shows that a secret was detected in the body of a discussion. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-discussion-body`. - public struct SecretScanningLocationDiscussionBody: Codable, Hashable, Sendable { - /// The URL to the discussion where the secret was detected. + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/alert_total_percentage`. + public var alertTotalPercentage: Swift.Int? + /// The number of false positive alerts generated by this pattern. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-discussion-body/discussion_body_url`. - public var discussionBodyUrl: Swift.String - /// Creates a new `SecretScanningLocationDiscussionBody`. + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/false_positives`. + public var falsePositives: Swift.Int? + /// The percentage of alerts from this pattern that are false positives, rounded to the nearest integer. /// - /// - Parameters: - /// - discussionBodyUrl: The URL to the discussion where the secret was detected. - public init(discussionBodyUrl: Swift.String) { - self.discussionBodyUrl = discussionBodyUrl - } - public enum CodingKeys: String, CodingKey { - case discussionBodyUrl = "discussion_body_url" + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/false_positive_rate`. + public var falsePositiveRate: Swift.Int? + /// The percentage of blocks for this pattern that were bypassed, rounded to the nearest integer. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/bypass_rate`. + public var bypassRate: Swift.Int? + /// The default push protection setting for this pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/default_setting`. + @frozen public enum DefaultSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case disabled = "disabled" + case enabled = "enabled" } - } - /// Represents a 'discussion_comment' secret scanning location type. This location type shows that a secret was detected in a comment on a discussion. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-discussion-comment`. - public struct SecretScanningLocationDiscussionComment: Codable, Hashable, Sendable { - /// The API URL to get the discussion comment where the secret was detected. + /// The default push protection setting for this pattern. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-discussion-comment/discussion_comment_url`. - public var discussionCommentUrl: Swift.String - /// Creates a new `SecretScanningLocationDiscussionComment`. + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/default_setting`. + public var defaultSetting: Components.Schemas.SecretScanningPatternOverride.DefaultSettingPayload? + /// The push protection setting for this pattern set at the enterprise level. Only present for partner patterns when the organization has a parent enterprise. /// - /// - Parameters: - /// - discussionCommentUrl: The API URL to get the discussion comment where the secret was detected. - public init(discussionCommentUrl: Swift.String) { - self.discussionCommentUrl = discussionCommentUrl + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/enterprise_setting`. + @frozen public enum EnterpriseSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case notSet = "not-set" + case disabled = "disabled" + case enabled = "enabled" } - public enum CodingKeys: String, CodingKey { - case discussionCommentUrl = "discussion_comment_url" + /// The push protection setting for this pattern set at the enterprise level. Only present for partner patterns when the organization has a parent enterprise. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/enterprise_setting`. + public var enterpriseSetting: Components.Schemas.SecretScanningPatternOverride.EnterpriseSettingPayload? + /// The current push protection setting for this pattern. If this is `not-set`, then it inherits either the enterprise setting if it exists or the default setting. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/setting`. + @frozen public enum SettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case notSet = "not-set" + case disabled = "disabled" + case enabled = "enabled" } - } - /// Represents a 'pull_request_title' secret scanning location type. This location type shows that a secret was detected in the title of a pull request. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-title`. - public struct SecretScanningLocationPullRequestTitle: Codable, Hashable, Sendable { - /// The API URL to get the pull request where the secret was detected. + /// The current push protection setting for this pattern. If this is `not-set`, then it inherits either the enterprise setting if it exists or the default setting. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-title/pull_request_title_url`. - public var pullRequestTitleUrl: Swift.String - /// Creates a new `SecretScanningLocationPullRequestTitle`. + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override/setting`. + public var setting: Components.Schemas.SecretScanningPatternOverride.SettingPayload? + /// Creates a new `SecretScanningPatternOverride`. /// /// - Parameters: - /// - pullRequestTitleUrl: The API URL to get the pull request where the secret was detected. - public init(pullRequestTitleUrl: Swift.String) { - self.pullRequestTitleUrl = pullRequestTitleUrl + /// - tokenType: The ID of the pattern. + /// - customPatternVersion: The version of this pattern if it's a custom pattern. + /// - slug: The slug of the pattern. + /// - displayName: The user-friendly name for the pattern. + /// - alertTotal: The total number of alerts generated by this pattern. + /// - alertTotalPercentage: The percentage of all alerts that this pattern represents, rounded to the nearest integer. + /// - falsePositives: The number of false positive alerts generated by this pattern. + /// - falsePositiveRate: The percentage of alerts from this pattern that are false positives, rounded to the nearest integer. + /// - bypassRate: The percentage of blocks for this pattern that were bypassed, rounded to the nearest integer. + /// - defaultSetting: The default push protection setting for this pattern. + /// - enterpriseSetting: The push protection setting for this pattern set at the enterprise level. Only present for partner patterns when the organization has a parent enterprise. + /// - setting: The current push protection setting for this pattern. If this is `not-set`, then it inherits either the enterprise setting if it exists or the default setting. + public init( + tokenType: Swift.String? = nil, + customPatternVersion: Swift.String? = nil, + slug: Swift.String? = nil, + displayName: Swift.String? = nil, + alertTotal: Swift.Int? = nil, + alertTotalPercentage: Swift.Int? = nil, + falsePositives: Swift.Int? = nil, + falsePositiveRate: Swift.Int? = nil, + bypassRate: Swift.Int? = nil, + defaultSetting: Components.Schemas.SecretScanningPatternOverride.DefaultSettingPayload? = nil, + enterpriseSetting: Components.Schemas.SecretScanningPatternOverride.EnterpriseSettingPayload? = nil, + setting: Components.Schemas.SecretScanningPatternOverride.SettingPayload? = nil + ) { + self.tokenType = tokenType + self.customPatternVersion = customPatternVersion + self.slug = slug + self.displayName = displayName + self.alertTotal = alertTotal + self.alertTotalPercentage = alertTotalPercentage + self.falsePositives = falsePositives + self.falsePositiveRate = falsePositiveRate + self.bypassRate = bypassRate + self.defaultSetting = defaultSetting + self.enterpriseSetting = enterpriseSetting + self.setting = setting } public enum CodingKeys: String, CodingKey { - case pullRequestTitleUrl = "pull_request_title_url" + case tokenType = "token_type" + case customPatternVersion = "custom_pattern_version" + case slug + case displayName = "display_name" + case alertTotal = "alert_total" + case alertTotalPercentage = "alert_total_percentage" + case falsePositives = "false_positives" + case falsePositiveRate = "false_positive_rate" + case bypassRate = "bypass_rate" + case defaultSetting = "default_setting" + case enterpriseSetting = "enterprise_setting" + case setting } } - /// Represents a 'pull_request_body' secret scanning location type. This location type shows that a secret was detected in the body of a pull request. + /// A collection of secret scanning patterns and their settings related to push protection. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-body`. - public struct SecretScanningLocationPullRequestBody: Codable, Hashable, Sendable { - /// The API URL to get the pull request where the secret was detected. + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-configuration`. + public struct SecretScanningPatternConfiguration: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-configuration/pattern_config_version`. + public var patternConfigVersion: Components.Schemas.SecretScanningRowVersion? + /// Overrides for partner patterns. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-body/pull_request_body_url`. - public var pullRequestBodyUrl: Swift.String - /// Creates a new `SecretScanningLocationPullRequestBody`. + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-configuration/provider_pattern_overrides`. + public var providerPatternOverrides: [Components.Schemas.SecretScanningPatternOverride]? + /// Overrides for custom patterns defined by the organization. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-configuration/custom_pattern_overrides`. + public var customPatternOverrides: [Components.Schemas.SecretScanningPatternOverride]? + /// Creates a new `SecretScanningPatternConfiguration`. /// /// - Parameters: - /// - pullRequestBodyUrl: The API URL to get the pull request where the secret was detected. - public init(pullRequestBodyUrl: Swift.String) { - self.pullRequestBodyUrl = pullRequestBodyUrl + /// - patternConfigVersion: + /// - providerPatternOverrides: Overrides for partner patterns. + /// - customPatternOverrides: Overrides for custom patterns defined by the organization. + public init( + patternConfigVersion: Components.Schemas.SecretScanningRowVersion? = nil, + providerPatternOverrides: [Components.Schemas.SecretScanningPatternOverride]? = nil, + customPatternOverrides: [Components.Schemas.SecretScanningPatternOverride]? = nil + ) { + self.patternConfigVersion = patternConfigVersion + self.providerPatternOverrides = providerPatternOverrides + self.customPatternOverrides = customPatternOverrides } public enum CodingKeys: String, CodingKey { - case pullRequestBodyUrl = "pull_request_body_url" + case patternConfigVersion = "pattern_config_version" + case providerPatternOverrides = "provider_pattern_overrides" + case customPatternOverrides = "custom_pattern_overrides" } } - /// Represents a 'pull_request_comment' secret scanning location type. This location type shows that a secret was detected in a comment on a pull request. + /// The ID of the push protection bypass placeholder. This value is returned on any push protected routes. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-comment`. - public struct SecretScanningLocationPullRequestComment: Codable, Hashable, Sendable { - /// The API URL to get the pull request comment where the secret was detected. + /// - Remark: Generated from `#/components/schemas/secret-scanning-push-protection-bypass-placeholder-id`. + public typealias SecretScanningPushProtectionBypassPlaceholderId = Swift.String + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert`. + public struct SecretScanningAlert: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/number`. + public var number: Components.Schemas.AlertNumber? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/created_at`. + public var createdAt: Components.Schemas.AlertCreatedAt? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/updated_at`. + public var updatedAt: Components.Schemas.NullableAlertUpdatedAt? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/url`. + public var url: Components.Schemas.AlertUrl? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/html_url`. + public var htmlUrl: Components.Schemas.AlertHtmlUrl? + /// The REST API URL of the code locations for this alert. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-comment/pull_request_comment_url`. - public var pullRequestCommentUrl: Swift.String - /// Creates a new `SecretScanningLocationPullRequestComment`. + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/locations_url`. + public var locationsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/state`. + public var state: Components.Schemas.SecretScanningAlertState? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/resolution`. + public var resolution: Components.Schemas.SecretScanningAlertResolution? + /// The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Parameters: - /// - pullRequestCommentUrl: The API URL to get the pull request comment where the secret was detected. - public init(pullRequestCommentUrl: Swift.String) { - self.pullRequestCommentUrl = pullRequestCommentUrl - } - public enum CodingKeys: String, CodingKey { - case pullRequestCommentUrl = "pull_request_comment_url" + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/resolved_at`. + public var resolvedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/resolved_by`. + public var resolvedBy: Components.Schemas.NullableSimpleUser? + /// An optional comment to resolve an alert. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/resolution_comment`. + public var resolutionComment: Swift.String? + /// The type of secret that secret scanning detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/secret_type`. + public var secretType: Swift.String? + /// User-friendly name for the detected secret, matching the `secret_type`. + /// For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/secret_type_display_name`. + public var secretTypeDisplayName: Swift.String? + /// The secret that was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/secret`. + public var secret: Swift.String? + /// Whether push protection was bypassed for the detected secret. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypassed`. + public var pushProtectionBypassed: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypassed_by`. + public var pushProtectionBypassedBy: Components.Schemas.NullableSimpleUser? + /// The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypassed_at`. + public var pushProtectionBypassedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypass_request_reviewer`. + public var pushProtectionBypassRequestReviewer: Components.Schemas.NullableSimpleUser? + /// An optional comment when reviewing a push protection bypass. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypass_request_reviewer_comment`. + public var pushProtectionBypassRequestReviewerComment: Swift.String? + /// An optional comment when requesting a push protection bypass. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypass_request_comment`. + public var pushProtectionBypassRequestComment: Swift.String? + /// The URL to a push protection bypass request. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/push_protection_bypass_request_html_url`. + public var pushProtectionBypassRequestHtmlUrl: Swift.String? + /// The token status as of the latest validity check. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/validity`. + @frozen public enum ValidityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case active = "active" + case inactive = "inactive" + case unknown = "unknown" } - } - /// Represents a 'pull_request_review' secret scanning location type. This location type shows that a secret was detected in a review on a pull request. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-review`. - public struct SecretScanningLocationPullRequestReview: Codable, Hashable, Sendable { - /// The API URL to get the pull request review where the secret was detected. + /// The token status as of the latest validity check. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-review/pull_request_review_url`. - public var pullRequestReviewUrl: Swift.String - /// Creates a new `SecretScanningLocationPullRequestReview`. + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/validity`. + public var validity: Components.Schemas.SecretScanningAlert.ValidityPayload? + /// Whether the detected secret was publicly leaked. /// - /// - Parameters: - /// - pullRequestReviewUrl: The API URL to get the pull request review where the secret was detected. - public init(pullRequestReviewUrl: Swift.String) { - self.pullRequestReviewUrl = pullRequestReviewUrl - } - public enum CodingKeys: String, CodingKey { - case pullRequestReviewUrl = "pull_request_review_url" - } - } - /// Represents a 'pull_request_review_comment' secret scanning location type. This location type shows that a secret was detected in a review comment on a pull request. - /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-review-comment`. - public struct SecretScanningLocationPullRequestReviewComment: Codable, Hashable, Sendable { - /// The API URL to get the pull request review comment where the secret was detected. + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/publicly_leaked`. + public var publiclyLeaked: Swift.Bool? + /// Whether the detected secret was found in multiple repositories under the same organization or enterprise. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-review-comment/pull_request_review_comment_url`. - public var pullRequestReviewCommentUrl: Swift.String - /// Creates a new `SecretScanningLocationPullRequestReviewComment`. + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/multi_repo`. + public var multiRepo: Swift.Bool? + /// A boolean value representing whether or not alert is base64 encoded + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/is_base64_encoded`. + public var isBase64Encoded: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/first_location_detected`. + public var firstLocationDetected: Components.Schemas.NullableSecretScanningFirstDetectedLocation? + /// A boolean value representing whether or not the token in the alert was detected in more than one location. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/has_more_locations`. + public var hasMoreLocations: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/assigned_to`. + public var assignedTo: Components.Schemas.NullableSimpleUser? + /// Creates a new `SecretScanningAlert`. /// /// - Parameters: - /// - pullRequestReviewCommentUrl: The API URL to get the pull request review comment where the secret was detected. - public init(pullRequestReviewCommentUrl: Swift.String) { - self.pullRequestReviewCommentUrl = pullRequestReviewCommentUrl + /// - number: + /// - createdAt: + /// - updatedAt: + /// - url: + /// - htmlUrl: + /// - locationsUrl: The REST API URL of the code locations for this alert. + /// - state: + /// - resolution: + /// - resolvedAt: The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - resolvedBy: + /// - resolutionComment: An optional comment to resolve an alert. + /// - secretType: The type of secret that secret scanning detected. + /// - secretTypeDisplayName: User-friendly name for the detected secret, matching the `secret_type`. + /// - secret: The secret that was detected. + /// - pushProtectionBypassed: Whether push protection was bypassed for the detected secret. + /// - pushProtectionBypassedBy: + /// - pushProtectionBypassedAt: The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - pushProtectionBypassRequestReviewer: + /// - pushProtectionBypassRequestReviewerComment: An optional comment when reviewing a push protection bypass. + /// - pushProtectionBypassRequestComment: An optional comment when requesting a push protection bypass. + /// - pushProtectionBypassRequestHtmlUrl: The URL to a push protection bypass request. + /// - validity: The token status as of the latest validity check. + /// - publiclyLeaked: Whether the detected secret was publicly leaked. + /// - multiRepo: Whether the detected secret was found in multiple repositories under the same organization or enterprise. + /// - isBase64Encoded: A boolean value representing whether or not alert is base64 encoded + /// - firstLocationDetected: + /// - hasMoreLocations: A boolean value representing whether or not the token in the alert was detected in more than one location. + /// - assignedTo: + public init( + number: Components.Schemas.AlertNumber? = nil, + createdAt: Components.Schemas.AlertCreatedAt? = nil, + updatedAt: Components.Schemas.NullableAlertUpdatedAt? = nil, + url: Components.Schemas.AlertUrl? = nil, + htmlUrl: Components.Schemas.AlertHtmlUrl? = nil, + locationsUrl: Swift.String? = nil, + state: Components.Schemas.SecretScanningAlertState? = nil, + resolution: Components.Schemas.SecretScanningAlertResolution? = nil, + resolvedAt: Foundation.Date? = nil, + resolvedBy: Components.Schemas.NullableSimpleUser? = nil, + resolutionComment: Swift.String? = nil, + secretType: Swift.String? = nil, + secretTypeDisplayName: Swift.String? = nil, + secret: Swift.String? = nil, + pushProtectionBypassed: Swift.Bool? = nil, + pushProtectionBypassedBy: Components.Schemas.NullableSimpleUser? = nil, + pushProtectionBypassedAt: Foundation.Date? = nil, + pushProtectionBypassRequestReviewer: Components.Schemas.NullableSimpleUser? = nil, + pushProtectionBypassRequestReviewerComment: Swift.String? = nil, + pushProtectionBypassRequestComment: Swift.String? = nil, + pushProtectionBypassRequestHtmlUrl: Swift.String? = nil, + validity: Components.Schemas.SecretScanningAlert.ValidityPayload? = nil, + publiclyLeaked: Swift.Bool? = nil, + multiRepo: Swift.Bool? = nil, + isBase64Encoded: Swift.Bool? = nil, + firstLocationDetected: Components.Schemas.NullableSecretScanningFirstDetectedLocation? = nil, + hasMoreLocations: Swift.Bool? = nil, + assignedTo: Components.Schemas.NullableSimpleUser? = nil + ) { + self.number = number + self.createdAt = createdAt + self.updatedAt = updatedAt + self.url = url + self.htmlUrl = htmlUrl + self.locationsUrl = locationsUrl + self.state = state + self.resolution = resolution + self.resolvedAt = resolvedAt + self.resolvedBy = resolvedBy + self.resolutionComment = resolutionComment + self.secretType = secretType + self.secretTypeDisplayName = secretTypeDisplayName + self.secret = secret + self.pushProtectionBypassed = pushProtectionBypassed + self.pushProtectionBypassedBy = pushProtectionBypassedBy + self.pushProtectionBypassedAt = pushProtectionBypassedAt + self.pushProtectionBypassRequestReviewer = pushProtectionBypassRequestReviewer + self.pushProtectionBypassRequestReviewerComment = pushProtectionBypassRequestReviewerComment + self.pushProtectionBypassRequestComment = pushProtectionBypassRequestComment + self.pushProtectionBypassRequestHtmlUrl = pushProtectionBypassRequestHtmlUrl + self.validity = validity + self.publiclyLeaked = publiclyLeaked + self.multiRepo = multiRepo + self.isBase64Encoded = isBase64Encoded + self.firstLocationDetected = firstLocationDetected + self.hasMoreLocations = hasMoreLocations + self.assignedTo = assignedTo } public enum CodingKeys: String, CodingKey { - case pullRequestReviewCommentUrl = "pull_request_review_comment_url" + case number + case createdAt = "created_at" + case updatedAt = "updated_at" + case url + case htmlUrl = "html_url" + case locationsUrl = "locations_url" + case state + case resolution + case resolvedAt = "resolved_at" + case resolvedBy = "resolved_by" + case resolutionComment = "resolution_comment" + case secretType = "secret_type" + case secretTypeDisplayName = "secret_type_display_name" + case secret + case pushProtectionBypassed = "push_protection_bypassed" + case pushProtectionBypassedBy = "push_protection_bypassed_by" + case pushProtectionBypassedAt = "push_protection_bypassed_at" + case pushProtectionBypassRequestReviewer = "push_protection_bypass_request_reviewer" + case pushProtectionBypassRequestReviewerComment = "push_protection_bypass_request_reviewer_comment" + case pushProtectionBypassRequestComment = "push_protection_bypass_request_comment" + case pushProtectionBypassRequestHtmlUrl = "push_protection_bypass_request_html_url" + case validity + case publiclyLeaked = "publicly_leaked" + case multiRepo = "multi_repo" + case isBase64Encoded = "is_base64_encoded" + case firstLocationDetected = "first_location_detected" + case hasMoreLocations = "has_more_locations" + case assignedTo = "assigned_to" } } + /// An optional comment when closing or reopening an alert. Cannot be updated or deleted. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-resolution-comment`. + public typealias SecretScanningAlertResolutionComment = Swift.String /// - Remark: Generated from `#/components/schemas/secret-scanning-location`. public struct SecretScanningLocation: Codable, Hashable, Sendable { /// The location type. Because secrets may be found in different types of resources (ie. code, comments, issues, pull requests, discussions), this field identifies the type of resource where the secret was found. @@ -2195,14 +2752,6 @@ public enum Components { } /// Types generated from the `#/components/parameters` section of the OpenAPI document. public enum Parameters { - /// 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)." - /// - /// - Remark: Generated from `#/components/parameters/pagination-before`. - public typealias PaginationBefore = Swift.String - /// 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)." - /// - /// - Remark: Generated from `#/components/parameters/pagination-after`. - public typealias PaginationAfter = Swift.String /// The direction to sort the results by. /// /// - Remark: Generated from `#/components/parameters/direction`. @@ -2218,10 +2767,18 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/components/parameters/enterprise`. - public typealias Enterprise = Swift.String + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/owner`. + public typealias Owner = Swift.String + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/repo`. + public typealias Repo = Swift.String /// Set to `open` or `resolved` to only list secret scanning alerts in a specific state. /// /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-state`. @@ -2244,6 +2801,14 @@ public enum Components { case created = "created" case updated = "updated" } + /// 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 events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. + /// + /// - Remark: Generated from `#/components/parameters/secret-scanning-pagination-before-org-repo`. + public typealias SecretScanningPaginationBeforeOrgRepo = Swift.String + /// 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 events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. + /// + /// - Remark: Generated from `#/components/parameters/secret-scanning-pagination-after-org-repo`. + public typealias SecretScanningPaginationAfterOrgRepo = Swift.String /// A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. /// /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-validity`. @@ -2256,26 +2821,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-multi-repo`. public typealias SecretScanningAlertMultiRepo = Swift.Bool - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/owner`. - public typealias Owner = Swift.String - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/repo`. - public typealias Repo = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String - /// 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 events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. - /// - /// - Remark: Generated from `#/components/parameters/secret-scanning-pagination-before-org-repo`. - public typealias SecretScanningPaginationBeforeOrgRepo = Swift.String - /// 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 events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. + /// A boolean value representing whether or not to hide literal secrets in the results. /// - /// - Remark: Generated from `#/components/parameters/secret-scanning-pagination-after-org-repo`. - public typealias SecretScanningPaginationAfterOrgRepo = Swift.String + /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-hide-secret`. + public typealias SecretScanningAlertHideSecret = Swift.Bool /// 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. /// /// - Remark: Generated from `#/components/parameters/alert-number`. @@ -2288,7 +2837,119 @@ public enum Components { public struct NotFound: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/not_found/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.NotFound.Body) { + self.body = body + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/bad_request/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/json", + body: self + ) + } + } + } + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/scim+json`. + case applicationScimJson(Components.Schemas.ScimError) + /// The associated value of the enum case if `self` is `.applicationScimJson`. + /// + /// - Throws: An error if `self` is not `.applicationScimJson`. + /// - SeeAlso: `.applicationScimJson`. + public var applicationScimJson: Components.Schemas.ScimError { + get throws { + switch self { + case let .applicationScimJson(body): + return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/scim+json", + body: self + ) + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.BadRequest.Body) { + self.body = body + } + } + public struct ValidationFailed: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content/application\/json`. + case json(Components.Schemas.ValidationError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailed.Body + /// Creates a new `ValidationFailed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailed.Body) { + self.body = body + } + } + public struct NotModified: Sendable, Hashable { + /// Creates a new `NotModified`. + public init() {} + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. case json(Components.Schemas.BasicError) /// The associated value of the enum case if `self` is `.json`. /// @@ -2304,18 +2965,42 @@ public enum Components { } } /// Received HTTP response body - public var body: Components.Responses.NotFound.Body - /// Creates a new `NotFound`. + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Components.Responses.NotFound.Body) { + public init(body: Components.Responses.Forbidden.Body) { self.body = body } } - public struct NotModified: Sendable, Hashable { - /// Creates a new `NotModified`. - public init() {} + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/conflict/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/conflict/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Conflict.Body) { + self.body = body + } } public struct ServiceUnavailable: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/service_unavailable/content`. @@ -2384,37 +3069,35 @@ public enum Components { /// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. public enum Operations { - /// List secret scanning alerts for an enterprise - /// - /// Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest. + /// List secret scanning alerts for an organization /// - /// Alerts are only returned for organizations in the enterprise for which the authenticated user is an organization owner or a [security manager](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization). + /// Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest. /// - /// The authenticated user must be a member of the enterprise in order to use this endpoint. + /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope or `security_events` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. /// - /// - Remark: HTTP `GET /enterprises/{enterprise}/secret-scanning/alerts`. - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-enterprise)`. - public enum SecretScanningListAlertsForEnterprise { - public static let id: Swift.String = "secret-scanning/list-alerts-for-enterprise" + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/alerts`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-org)`. + public enum SecretScanningListAlertsForOrg { + public static let id: Swift.String = "secret-scanning/list-alerts-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/path`. public struct Path: Sendable, Hashable { - /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/path/enterprise`. - public var enterprise: Components.Parameters.Enterprise + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/path/org`. + public var org: Components.Parameters.Org /// Creates a new `Path`. /// /// - Parameters: - /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. - public init(enterprise: Components.Parameters.Enterprise) { - self.enterprise = enterprise + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org } } - public var path: Operations.SecretScanningListAlertsForEnterprise.Input.Path - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query`. + public var path: Operations.SecretScanningListAlertsForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query`. public struct Query: Sendable, Hashable { /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-state`. @frozen public enum SecretScanningAlertState: String, Codable, Hashable, Sendable, CaseIterable { @@ -2423,15 +3106,15 @@ public enum Operations { } /// Set to `open` or `resolved` to only list secret scanning alerts in a specific state. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/state`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/state`. public var state: Components.Parameters.SecretScanningAlertState? /// A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/secret_type`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/secret_type`. public var secretType: Components.Parameters.SecretScanningAlertSecretType? /// A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/resolution`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/resolution`. public var resolution: Components.Parameters.SecretScanningAlertResolution? /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-sort`. @frozen public enum SecretScanningAlertSort: String, Codable, Hashable, Sendable, CaseIterable { @@ -2440,7 +3123,7 @@ public enum Operations { } /// The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/sort`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/sort`. public var sort: Components.Parameters.SecretScanningAlertSort? /// - Remark: Generated from `#/components/parameters/direction`. @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { @@ -2449,32 +3132,40 @@ public enum Operations { } /// The direction to sort the results by. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/direction`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/direction`. public var direction: Components.Parameters.Direction? + /// The page number of the results to fetch. 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)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/page`. + public var page: Components.Parameters.Page? /// The number of results per page (max 100). 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)." /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/per_page`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? - /// 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)." + /// 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 events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/before`. - public var before: Components.Parameters.PaginationBefore? - /// 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)." + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/before`. + public var before: Components.Parameters.SecretScanningPaginationBeforeOrgRepo? + /// 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 events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/after`. - public var after: Components.Parameters.PaginationAfter? + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/after`. + public var after: Components.Parameters.SecretScanningPaginationAfterOrgRepo? /// A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/validity`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/validity`. public var validity: Components.Parameters.SecretScanningAlertValidity? /// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/is_publicly_leaked`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/is_publicly_leaked`. public var isPubliclyLeaked: Components.Parameters.SecretScanningAlertPubliclyLeaked? /// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/query/is_multi_repo`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/is_multi_repo`. public var isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? + /// A boolean value representing whether or not to hide literal secrets in the results. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/hide_secret`. + public var hideSecret: Components.Parameters.SecretScanningAlertHideSecret? /// Creates a new `Query`. /// /// - Parameters: @@ -2483,51 +3174,57 @@ public enum Operations { /// - resolution: A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. /// - sort: The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. /// - direction: The direction to sort the results by. + /// - page: The page number of the results to fetch. 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)." /// - perPage: The number of results per page (max 100). 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)." - /// - 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)." - /// - 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)." + /// - 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 events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. + /// - 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 events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. /// - validity: A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. /// - isPubliclyLeaked: A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. /// - isMultiRepo: A boolean value representing whether or not to filter alerts by the multi-repo tag being present. + /// - hideSecret: A boolean value representing whether or not to hide literal secrets in the results. public init( state: Components.Parameters.SecretScanningAlertState? = nil, secretType: Components.Parameters.SecretScanningAlertSecretType? = nil, resolution: Components.Parameters.SecretScanningAlertResolution? = nil, sort: Components.Parameters.SecretScanningAlertSort? = nil, direction: Components.Parameters.Direction? = nil, + page: Components.Parameters.Page? = nil, perPage: Components.Parameters.PerPage? = nil, - before: Components.Parameters.PaginationBefore? = nil, - after: Components.Parameters.PaginationAfter? = nil, + before: Components.Parameters.SecretScanningPaginationBeforeOrgRepo? = nil, + after: Components.Parameters.SecretScanningPaginationAfterOrgRepo? = nil, validity: Components.Parameters.SecretScanningAlertValidity? = nil, isPubliclyLeaked: Components.Parameters.SecretScanningAlertPubliclyLeaked? = nil, - isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? = nil + isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? = nil, + hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil ) { self.state = state self.secretType = secretType self.resolution = resolution self.sort = sort self.direction = direction + self.page = page self.perPage = perPage self.before = before self.after = after self.validity = validity self.isPubliclyLeaked = isPubliclyLeaked self.isMultiRepo = isMultiRepo + self.hideSecret = hideSecret } } - public var query: Operations.SecretScanningListAlertsForEnterprise.Input.Query - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/header`. + public var query: Operations.SecretScanningListAlertsForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.SecretScanningListAlertsForEnterprise.Input.Headers + public var headers: Operations.SecretScanningListAlertsForOrg.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -2535,9 +3232,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.SecretScanningListAlertsForEnterprise.Input.Path, - query: Operations.SecretScanningListAlertsForEnterprise.Input.Query = .init(), - headers: Operations.SecretScanningListAlertsForEnterprise.Input.Headers = .init() + path: Operations.SecretScanningListAlertsForOrg.Input.Path, + query: Operations.SecretScanningListAlertsForOrg.Input.Query = .init(), + headers: Operations.SecretScanningListAlertsForOrg.Input.Headers = .init() ) { self.path = path self.query = query @@ -2546,9 +3243,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -2559,10 +3256,10 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.SecretScanningListAlertsForEnterprise.Output.Ok.Headers - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/responses/200/content`. + public var headers: Operations.SecretScanningListAlertsForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/secret-scanning/alerts/GET/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/responses/200/content/application\/json`. case json([Components.Schemas.OrganizationSecretScanningAlert]) /// The associated value of the enum case if `self` is `.json`. /// @@ -2578,15 +3275,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SecretScanningListAlertsForEnterprise.Output.Ok.Body + public var body: Operations.SecretScanningListAlertsForOrg.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.SecretScanningListAlertsForEnterprise.Output.Ok.Headers = .init(), - body: Operations.SecretScanningListAlertsForEnterprise.Output.Ok.Body + headers: Operations.SecretScanningListAlertsForOrg.Output.Ok.Headers = .init(), + body: Operations.SecretScanningListAlertsForOrg.Output.Ok.Body ) { self.headers = headers self.body = body @@ -2594,15 +3291,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-enterprise)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-org)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.SecretScanningListAlertsForEnterprise.Output.Ok) + case ok(Operations.SecretScanningListAlertsForOrg.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.SecretScanningListAlertsForEnterprise.Output.Ok { + public var ok: Operations.SecretScanningListAlertsForOrg.Output.Ok { get throws { switch self { case let .ok(response): @@ -2617,7 +3314,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-enterprise)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-org)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -2640,7 +3337,7 @@ public enum Operations { } /// Service unavailable /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-enterprise)/responses/503`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-org)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. case serviceUnavailable(Components.Responses.ServiceUnavailable) @@ -2692,24 +3389,202 @@ public enum Operations { } } } - /// List secret scanning alerts for an organization + /// List organization pattern configurations /// - /// Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest. + /// Lists the secret scanning pattern configurations for an organization. /// - /// The authenticated user must be an administrator or security manager for the organization to use this endpoint. + /// Personal access tokens (classic) need the `read:org` scope to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)`. + public enum SecretScanningListOrgPatternConfigs { + public static let id: Swift.String = "secret-scanning/list-org-pattern-configs" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.SecretScanningListOrgPatternConfigs.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.SecretScanningListOrgPatternConfigs.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.SecretScanningListOrgPatternConfigs.Input.Path, + headers: Operations.SecretScanningListOrgPatternConfigs.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/responses/200/content/application\/json`. + case json(Components.Schemas.SecretScanningPatternConfiguration) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.SecretScanningPatternConfiguration { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SecretScanningListOrgPatternConfigs.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SecretScanningListOrgPatternConfigs.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.SecretScanningListOrgPatternConfigs.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.SecretScanningListOrgPatternConfigs.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update organization pattern configurations /// - /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/alerts`. - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-org)`. - public enum SecretScanningListAlertsForOrg { - public static let id: Swift.String = "secret-scanning/list-alerts-for-org" + /// Updates the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)`. + public enum SecretScanningUpdateOrgPatternConfigs { + public static let id: Swift.String = "secret-scanning/update-org-pattern-configs" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -2719,169 +3594,185 @@ public enum Operations { self.org = org } } - public var path: Operations.SecretScanningListAlertsForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-state`. - @frozen public enum SecretScanningAlertState: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case resolved = "resolved" - } - /// Set to `open` or `resolved` to only list secret scanning alerts in a specific state. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/state`. - public var state: Components.Parameters.SecretScanningAlertState? - /// A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/secret_type`. - public var secretType: Components.Parameters.SecretScanningAlertSecretType? - /// A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/resolution`. - public var resolution: Components.Parameters.SecretScanningAlertResolution? - /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-sort`. - @frozen public enum SecretScanningAlertSort: String, Codable, Hashable, Sendable, CaseIterable { - case created = "created" - case updated = "updated" - } - /// The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/sort`. - public var sort: Components.Parameters.SecretScanningAlertSort? - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// The page number of the results to fetch. 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/page`. - public var page: Components.Parameters.Page? - /// The number of results per page (max 100). 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)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// 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 events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/before`. - public var before: Components.Parameters.SecretScanningPaginationBeforeOrgRepo? - /// 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 events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/after`. - public var after: Components.Parameters.SecretScanningPaginationAfterOrgRepo? - /// A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/validity`. - public var validity: Components.Parameters.SecretScanningAlertValidity? - /// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/is_publicly_leaked`. - public var isPubliclyLeaked: Components.Parameters.SecretScanningAlertPubliclyLeaked? - /// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/is_multi_repo`. - public var isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - state: Set to `open` or `resolved` to only list secret scanning alerts in a specific state. - /// - secretType: A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. - /// - resolution: A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. - /// - sort: The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. - /// - direction: The direction to sort the results by. - /// - page: The page number of the results to fetch. 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)." - /// - perPage: The number of results per page (max 100). 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)." - /// - 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 events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. - /// - 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 events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. - /// - validity: A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. - /// - isPubliclyLeaked: A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. - /// - isMultiRepo: A boolean value representing whether or not to filter alerts by the multi-repo tag being present. - public init( - state: Components.Parameters.SecretScanningAlertState? = nil, - secretType: Components.Parameters.SecretScanningAlertSecretType? = nil, - resolution: Components.Parameters.SecretScanningAlertResolution? = nil, - sort: Components.Parameters.SecretScanningAlertSort? = nil, - direction: Components.Parameters.Direction? = nil, - page: Components.Parameters.Page? = nil, - perPage: Components.Parameters.PerPage? = nil, - before: Components.Parameters.SecretScanningPaginationBeforeOrgRepo? = nil, - after: Components.Parameters.SecretScanningPaginationAfterOrgRepo? = nil, - validity: Components.Parameters.SecretScanningAlertValidity? = nil, - isPubliclyLeaked: Components.Parameters.SecretScanningAlertPubliclyLeaked? = nil, - isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? = nil - ) { - self.state = state - self.secretType = secretType - self.resolution = resolution - self.sort = sort - self.direction = direction - self.page = page - self.perPage = perPage - self.before = before - self.after = after - self.validity = validity - self.isPubliclyLeaked = isPubliclyLeaked - self.isMultiRepo = isMultiRepo - } - } - public var query: Operations.SecretScanningListAlertsForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/header`. + public var path: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.SecretScanningListAlertsForOrg.Input.Headers + public var headers: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/pattern_config_version`. + public var patternConfigVersion: Components.Schemas.SecretScanningRowVersion? + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload`. + public struct ProviderPatternSettingsPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the pattern to configure. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload/token_type`. + public var tokenType: Swift.String? + /// Push protection setting to set for the pattern. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload/push_protection_setting`. + @frozen public enum PushProtectionSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case notSet = "not-set" + case disabled = "disabled" + case enabled = "enabled" + } + /// Push protection setting to set for the pattern. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload/push_protection_setting`. + public var pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayloadPayload.PushProtectionSettingPayload? + /// Creates a new `ProviderPatternSettingsPayloadPayload`. + /// + /// - Parameters: + /// - tokenType: The ID of the pattern to configure. + /// - pushProtectionSetting: Push protection setting to set for the pattern. + public init( + tokenType: Swift.String? = nil, + pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayloadPayload.PushProtectionSettingPayload? = nil + ) { + self.tokenType = tokenType + self.pushProtectionSetting = pushProtectionSetting + } + public enum CodingKeys: String, CodingKey { + case tokenType = "token_type" + case pushProtectionSetting = "push_protection_setting" + } + } + /// Pattern settings for provider patterns. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/provider_pattern_settings`. + public typealias ProviderPatternSettingsPayload = [Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayloadPayload] + /// Pattern settings for provider patterns. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/provider_pattern_settings`. + public var providerPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload`. + public struct CustomPatternSettingsPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the pattern to configure. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/token_type`. + public var tokenType: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/custom_pattern_version`. + public var customPatternVersion: Components.Schemas.SecretScanningRowVersion? + /// Push protection setting to set for the pattern. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/push_protection_setting`. + @frozen public enum PushProtectionSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case disabled = "disabled" + case enabled = "enabled" + } + /// Push protection setting to set for the pattern. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/push_protection_setting`. + public var pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayloadPayload.PushProtectionSettingPayload? + /// Creates a new `CustomPatternSettingsPayloadPayload`. + /// + /// - Parameters: + /// - tokenType: The ID of the pattern to configure. + /// - customPatternVersion: + /// - pushProtectionSetting: Push protection setting to set for the pattern. + public init( + tokenType: Swift.String? = nil, + customPatternVersion: Components.Schemas.SecretScanningRowVersion? = nil, + pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayloadPayload.PushProtectionSettingPayload? = nil + ) { + self.tokenType = tokenType + self.customPatternVersion = customPatternVersion + self.pushProtectionSetting = pushProtectionSetting + } + public enum CodingKeys: String, CodingKey { + case tokenType = "token_type" + case customPatternVersion = "custom_pattern_version" + case pushProtectionSetting = "push_protection_setting" + } + } + /// Pattern settings for custom patterns. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/custom_pattern_settings`. + public typealias CustomPatternSettingsPayload = [Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayloadPayload] + /// Pattern settings for custom patterns. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/custom_pattern_settings`. + public var customPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - patternConfigVersion: + /// - providerPatternSettings: Pattern settings for provider patterns. + /// - customPatternSettings: Pattern settings for custom patterns. + public init( + patternConfigVersion: Components.Schemas.SecretScanningRowVersion? = nil, + providerPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayload? = nil, + customPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayload? = nil + ) { + self.patternConfigVersion = patternConfigVersion + self.providerPatternSettings = providerPatternSettings + self.customPatternSettings = customPatternSettings + } + public enum CodingKeys: String, CodingKey { + case patternConfigVersion = "pattern_config_version" + case providerPatternSettings = "provider_pattern_settings" + case customPatternSettings = "custom_pattern_settings" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/content/application\/json`. + case json(Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload) + } + public var body: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.SecretScanningListAlertsForOrg.Input.Path, - query: Operations.SecretScanningListAlertsForOrg.Input.Query = .init(), - headers: Operations.SecretScanningListAlertsForOrg.Input.Headers = .init() + path: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Path, + headers: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Headers = .init(), + body: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.SecretScanningListAlertsForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/responses/200/content/application\/json`. - case json([Components.Schemas.OrganizationSecretScanningAlert]) + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The updated pattern configuration version. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/responses/200/content/json/pattern_config_version`. + public var patternConfigVersion: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - patternConfigVersion: The updated pattern configuration version. + public init(patternConfigVersion: Swift.String? = nil) { + self.patternConfigVersion = patternConfigVersion + } + public enum CodingKeys: String, CodingKey { + case patternConfigVersion = "pattern_config_version" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/responses/200/content/application\/json`. + case json(Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.OrganizationSecretScanningAlert] { + public var json: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -2891,31 +3782,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SecretScanningListAlertsForOrg.Output.Ok.Body + public var body: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.SecretScanningListAlertsForOrg.Output.Ok.Headers = .init(), - body: Operations.SecretScanningListAlertsForOrg.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-org)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.SecretScanningListAlertsForOrg.Output.Ok) + case ok(Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.SecretScanningListAlertsForOrg.Output.Ok { + public var ok: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok { get throws { switch self { case let .ok(response): @@ -2928,9 +3814,55 @@ public enum Operations { } } } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-org)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -2951,24 +3883,47 @@ public enum Operations { } } } - /// Service unavailable + /// Conflict /// - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-org)/responses/503`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/409`. /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { get throws { switch self { - case let .serviceUnavailable(response): + case let .conflict(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", response: self ) } @@ -2981,11 +3936,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -2996,11 +3954,14 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } @@ -3107,6 +4068,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/is_multi_repo`. public var isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? + /// A boolean value representing whether or not to hide literal secrets in the results. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/hide_secret`. + public var hideSecret: Components.Parameters.SecretScanningAlertHideSecret? /// Creates a new `Query`. /// /// - Parameters: @@ -3122,6 +4087,7 @@ public enum Operations { /// - validity: A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. /// - isPubliclyLeaked: A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. /// - isMultiRepo: A boolean value representing whether or not to filter alerts by the multi-repo tag being present. + /// - hideSecret: A boolean value representing whether or not to hide literal secrets in the results. public init( state: Components.Parameters.SecretScanningAlertState? = nil, secretType: Components.Parameters.SecretScanningAlertSecretType? = nil, @@ -3134,7 +4100,8 @@ public enum Operations { after: Components.Parameters.SecretScanningPaginationAfterOrgRepo? = nil, validity: Components.Parameters.SecretScanningAlertValidity? = nil, isPubliclyLeaked: Components.Parameters.SecretScanningAlertPubliclyLeaked? = nil, - isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? = nil + isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? = nil, + hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil ) { self.state = state self.secretType = secretType @@ -3148,6 +4115,7 @@ public enum Operations { self.validity = validity self.isPubliclyLeaked = isPubliclyLeaked self.isMultiRepo = isMultiRepo + self.hideSecret = hideSecret } } public var query: Operations.SecretScanningListAlertsForRepo.Input.Query @@ -3364,6 +4332,21 @@ public enum Operations { } } public var path: Operations.SecretScanningGetAlert.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/query`. + public struct Query: Sendable, Hashable { + /// A boolean value representing whether or not to hide literal secrets in the results. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/query/hide_secret`. + public var hideSecret: Components.Parameters.SecretScanningAlertHideSecret? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - hideSecret: A boolean value representing whether or not to hide literal secrets in the results. + public init(hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil) { + self.hideSecret = hideSecret + } + } + public var query: Operations.SecretScanningGetAlert.Input.Query /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/header`. public struct Headers: Sendable, Hashable { public var accept: [OpenAPIRuntime.AcceptHeaderContentType] @@ -3380,12 +4363,15 @@ public enum Operations { /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( path: Operations.SecretScanningGetAlert.Input.Path, + query: Operations.SecretScanningGetAlert.Input.Query = .init(), headers: Operations.SecretScanningGetAlert.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @@ -4444,6 +5430,9 @@ public enum Operations { /// /// Lists the latest default incremental and backfill scans by type for a repository. Scans from Copilot Secret Scanning are not included. /// + /// > [!NOTE] + /// > This endpoint requires [GitHub Advanced Security](https://docs.github.com/get-started/learning-about-github/about-github-advanced-security)." + /// /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/scan-history`. diff --git a/Sources/security-advisories/Types.swift b/Sources/security-advisories/Types.swift index 6140331094c..40b470ef716 100644 --- a/Sources/security-advisories/Types.swift +++ b/Sources/security-advisories/Types.swift @@ -1924,6 +1924,35 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/anonymous_access_enabled`. public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? /// Creates a new `Repository`. /// /// - Parameters: @@ -2022,6 +2051,7 @@ public enum Components { /// - masterBranch: /// - starredAt: /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository public init( id: Swift.Int64, nodeId: Swift.String, @@ -2117,7 +2147,8 @@ public enum Components { watchers: Swift.Int, masterBranch: Swift.String? = nil, starredAt: Swift.String? = nil, - anonymousAccessEnabled: Swift.Bool? = nil + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -2214,6 +2245,7 @@ public enum Components { self.masterBranch = masterBranch self.starredAt = starredAt self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus } public enum CodingKeys: String, CodingKey { case id @@ -2311,6 +2343,7 @@ public enum Components { case masterBranch = "master_branch" case starredAt = "starred_at" case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" } } /// A GitHub repository. @@ -2694,6 +2727,11 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -2714,6 +2752,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -2859,7 +2902,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: @@ -2939,6 +2982,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -2955,6 +3017,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -2968,7 +3033,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -2983,6 +3051,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -2998,6 +3069,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -3071,6 +3145,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -3089,6 +3182,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -3104,6 +3200,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -3119,6 +3218,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -3135,6 +3237,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -3489,6 +3594,35 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-repository/anonymous_access_enabled`. public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/nullable-repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.NullableRepository.CodeSearchIndexStatusPayload? /// Creates a new `NullableRepository`. /// /// - Parameters: @@ -3587,6 +3721,7 @@ public enum Components { /// - masterBranch: /// - starredAt: /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository public init( id: Swift.Int64, nodeId: Swift.String, @@ -3682,7 +3817,8 @@ public enum Components { watchers: Swift.Int, masterBranch: Swift.String? = nil, starredAt: Swift.String? = nil, - anonymousAccessEnabled: Swift.Bool? = nil + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.NullableRepository.CodeSearchIndexStatusPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -3779,6 +3915,7 @@ public enum Components { self.masterBranch = masterBranch self.starredAt = starredAt self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus } public enum CodingKeys: String, CodingKey { case id @@ -3876,6 +4013,7 @@ public enum Components { case masterBranch = "master_branch" case starredAt = "starred_at" case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" } } /// Code of Conduct Simple @@ -6250,6 +6388,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/ghsa_id`. public typealias GhsaId = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String /// The account owner of the repository. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/owner`. @@ -6258,10 +6400,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/repo`. public typealias Repo = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} @@ -6596,7 +6734,7 @@ public enum Operations { /// If specified, only return advisories that affect any of `package` or `package@version`. A maximum of 1000 packages can be specified. /// If the query parameter causes the URL to exceed the maximum URL length supported by your client, you must specify fewer packages. /// - /// Example: `affects=package1,package2@1.0.0,package3@^2.0.0` or `affects[]=package1&affects[]=package2@1.0.0` + /// Example: `affects=package1,package2@1.0.0,package3@2.0.0` or `affects[]=package1&affects[]=package2@1.0.0` /// /// - Remark: Generated from `#/paths/advisories/GET/query/affects`. public var affects: Operations.SecurityAdvisoriesListGlobalAdvisories.Input.Query.AffectsPayload? diff --git a/Sources/teams/Types.swift b/Sources/teams/Types.swift index 855c4585213..6ecd3e5bcce 100644 --- a/Sources/teams/Types.swift +++ b/Sources/teams/Types.swift @@ -2611,6 +2611,11 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. public struct SecurityAndAnalysis: Codable, Hashable, Sendable { + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public struct AdvancedSecurityPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. @@ -2631,6 +2636,11 @@ public enum Components { case status } } + /// Enable or disable GitHub Advanced Security for the repository. + /// + /// For standalone Code Scanning or Secret Protection products, this parameter cannot be used. + /// + /// /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security`. public var advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. @@ -2776,7 +2786,7 @@ public enum Components { /// Creates a new `SecurityAndAnalysis`. /// /// - Parameters: - /// - advancedSecurity: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. /// - codeSecurity: /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. /// - secretScanning: @@ -3072,6 +3082,30 @@ public enum Components { public var webCommitSignoffRequired: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/security_and_analysis`. public var securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public struct CustomPropertiesPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `CustomPropertiesPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/custom_properties`. + public var customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? /// Creates a new `MinimalRepository`. /// /// - Parameters: @@ -3162,6 +3196,7 @@ public enum Components { /// - allowForking: /// - webCommitSignoffRequired: /// - securityAndAnalysis: + /// - customProperties: The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. public init( id: Swift.Int64, nodeId: Swift.String, @@ -3249,7 +3284,8 @@ public enum Components { watchers: Swift.Int? = nil, allowForking: Swift.Bool? = nil, webCommitSignoffRequired: Swift.Bool? = nil, - securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil + securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil, + customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? = nil ) { self.id = id self.nodeId = nodeId @@ -3338,6 +3374,7 @@ public enum Components { self.allowForking = allowForking self.webCommitSignoffRequired = webCommitSignoffRequired self.securityAndAnalysis = securityAndAnalysis + self.customProperties = customProperties } public enum CodingKeys: String, CodingKey { case id @@ -3427,6 +3464,7 @@ public enum Components { case allowForking = "allow_forking" case webCommitSignoffRequired = "web_commit_signoff_required" case securityAndAnalysis = "security_and_analysis" + case customProperties = "custom_properties" } } /// Groups of organization members that gives permissions on specified repositories. @@ -3475,6 +3513,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `NullableTeamSimple`. /// /// - Parameters: @@ -3491,6 +3548,9 @@ public enum Components { /// - repositoriesUrl: /// - slug: /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -3504,7 +3564,10 @@ public enum Components { htmlUrl: Swift.String, repositoriesUrl: Swift.String, slug: Swift.String, - ldapDn: Swift.String? = nil + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -3519,6 +3582,9 @@ public enum Components { self.repositoriesUrl = repositoriesUrl self.slug = slug self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -3534,6 +3600,9 @@ public enum Components { case repositoriesUrl = "repositories_url" case slug case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// Groups of organization members that gives permissions on specified repositories. @@ -3607,6 +3676,25 @@ public enum Components { public var membersUrl: Swift.String /// - Remark: Generated from `#/components/schemas/team/repositories_url`. public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? /// - Remark: Generated from `#/components/schemas/team/parent`. public var parent: Components.Schemas.NullableTeamSimple? /// Creates a new `Team`. @@ -3625,6 +3713,9 @@ public enum Components { /// - htmlUrl: /// - membersUrl: /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs /// - parent: public init( id: Swift.Int, @@ -3640,6 +3731,9 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, parent: Components.Schemas.NullableTeamSimple? = nil ) { self.id = id @@ -3655,6 +3749,9 @@ public enum Components { self.htmlUrl = htmlUrl self.membersUrl = membersUrl self.repositoriesUrl = repositoriesUrl + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId self.parent = parent } public enum CodingKeys: String, CodingKey { @@ -3671,6 +3768,9 @@ public enum Components { case htmlUrl = "html_url" case membersUrl = "members_url" case repositoriesUrl = "repositories_url" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" case parent } } @@ -4107,6 +4207,10 @@ public enum Components { case archivedAt = "archived_at" } } + /// The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. + /// + /// - Remark: Generated from `#/components/schemas/ldap-dn`. + public typealias LdapDn = Swift.String /// Groups of organization members that gives permissions on specified repositories. /// /// - Remark: Generated from `#/components/schemas/team-full`. @@ -4173,10 +4277,27 @@ public enum Components { public var updatedAt: Foundation.Date /// - Remark: Generated from `#/components/schemas/team-full/organization`. public var organization: Components.Schemas.TeamOrganization - /// Distinguished Name (DN) that team maps to within LDAP environment - /// /// - Remark: Generated from `#/components/schemas/team-full/ldap_dn`. - public var ldapDn: Swift.String? + public var ldapDn: Components.Schemas.LdapDn? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-full/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team-full/type`. + public var _type: Components.Schemas.TeamFull._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-full/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team-full/enterprise_id`. + public var enterpriseId: Swift.Int? /// Creates a new `TeamFull`. /// /// - Parameters: @@ -4198,7 +4319,10 @@ public enum Components { /// - createdAt: /// - updatedAt: /// - organization: - /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - ldapDn: + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs public init( id: Swift.Int, nodeId: Swift.String, @@ -4218,7 +4342,10 @@ public enum Components { createdAt: Foundation.Date, updatedAt: Foundation.Date, organization: Components.Schemas.TeamOrganization, - ldapDn: Swift.String? = nil + ldapDn: Components.Schemas.LdapDn? = nil, + _type: Components.Schemas.TeamFull._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil ) { self.id = id self.nodeId = nodeId @@ -4239,6 +4366,9 @@ public enum Components { self.updatedAt = updatedAt self.organization = organization self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId } public enum CodingKeys: String, CodingKey { case id @@ -4260,6 +4390,9 @@ public enum Components { case updatedAt = "updated_at" case organization case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" } } /// A team discussion is a persistent record of a free-form conversation within a team. @@ -5327,26 +5460,26 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/owner`. - public typealias Owner = Swift.String - /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// The handle for the GitHub user account. /// - /// - Remark: Generated from `#/components/parameters/repo`. - public typealias Repo = Swift.String + /// - Remark: Generated from `#/components/parameters/username`. + public typealias Username = Swift.String /// The organization name. The name is not case sensitive. /// /// - Remark: Generated from `#/components/parameters/org`. public typealias Org = Swift.String - /// The handle for the GitHub user account. - /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias Username = Swift.String /// The slug of the team name. /// /// - Remark: Generated from `#/components/parameters/team-slug`. public typealias TeamSlug = Swift.String + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/owner`. + public typealias Owner = Swift.String + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/repo`. + public typealias Repo = Swift.String /// The number that identifies the discussion. /// /// - Remark: Generated from `#/components/parameters/discussion-number`. @@ -5717,7 +5850,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/teams/POST/requestBody/json/description`. public var description: Swift.String? - /// List GitHub IDs for organization members who will become team maintainers. + /// List GitHub usernames for organization members who will become team maintainers. /// /// - Remark: Generated from `#/paths/orgs/{org}/teams/POST/requestBody/json/maintainers`. public var maintainers: [Swift.String]? @@ -5787,7 +5920,7 @@ public enum Operations { /// - Parameters: /// - name: The name of the team. /// - description: The description of the team. - /// - maintainers: List GitHub IDs for organization members who will become team maintainers. + /// - maintainers: List GitHub usernames for organization members who will become team maintainers. /// - repoNames: The full name (e.g., "organization-name/repository-name") of repositories to add the team to. /// - privacy: The level of privacy this team should have. The options are: /// - notificationSetting: The notification setting the team has chosen. The options are: diff --git a/Sources/users/Client.swift b/Sources/users/Client.swift index 454dd60f536..a7d262ae137 100644 --- a/Sources/users/Client.swift +++ b/Sources/users/Client.swift @@ -2798,7 +2798,7 @@ public struct Client: APIProtocol { /// /// Adds a public SSH key to the authenticated user's GitHub account. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `write:public_key` scope to use this endpoint. /// /// - Remark: HTTP `POST /user/keys`. /// - Remark: Generated from `#/paths//user/keys/post(users/create-public-ssh-key-for-authenticated-user)`. @@ -4656,6 +4656,339 @@ public struct Client: APIProtocol { } ) } + /// List attestations by bulk subject digests + /// + /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by a user. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /users/{username}/attestations/bulk-list`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/bulk-list/post(users/list-attestations-bulk)`. + public func usersListAttestationsBulk(_ input: Operations.UsersListAttestationsBulk.Input) async throws -> Operations.UsersListAttestationsBulk.Output { + try await client.send( + input: input, + forOperation: Operations.UsersListAttestationsBulk.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/attestations/bulk-list", + parameters: [ + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.UsersListAttestationsBulk.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete attestations in bulk + /// + /// Delete artifact attestations in bulk by either subject digests or unique ID. + /// + /// - Remark: HTTP `POST /users/{username}/attestations/delete-request`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/delete-request/post(users/delete-attestations-bulk)`. + public func usersDeleteAttestationsBulk(_ input: Operations.UsersDeleteAttestationsBulk.Input) async throws -> Operations.UsersDeleteAttestationsBulk.Output { + try await client.send( + input: input, + forOperation: Operations.UsersDeleteAttestationsBulk.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/attestations/delete-request", + parameters: [ + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + return .ok(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete attestations by subject digest + /// + /// Delete an artifact attestation by subject digest. + /// + /// - Remark: HTTP `DELETE /users/{username}/attestations/digest/{subject_digest}`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/digest/{subject_digest}/delete(users/delete-attestations-by-subject-digest)`. + public func usersDeleteAttestationsBySubjectDigest(_ input: Operations.UsersDeleteAttestationsBySubjectDigest.Input) async throws -> Operations.UsersDeleteAttestationsBySubjectDigest.Output { + try await client.send( + input: input, + forOperation: Operations.UsersDeleteAttestationsBySubjectDigest.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/attestations/digest/{}", + parameters: [ + input.path.username, + input.path.subjectDigest + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + return .ok(.init()) + case 204: + return .noContent(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete attestations by ID + /// + /// Delete an artifact attestation by unique ID that is associated with a repository owned by a user. + /// + /// - Remark: HTTP `DELETE /users/{username}/attestations/{attestation_id}`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/{attestation_id}/delete(users/delete-attestations-by-id)`. + public func usersDeleteAttestationsById(_ input: Operations.UsersDeleteAttestationsById.Input) async throws -> Operations.UsersDeleteAttestationsById.Output { + try await client.send( + input: input, + forOperation: Operations.UsersDeleteAttestationsById.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/attestations/{}", + parameters: [ + input.path.username, + input.path.attestationId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + return .ok(.init()) + case 204: + return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// List attestations /// /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user. diff --git a/Sources/users/Types.swift b/Sources/users/Types.swift index 4a484b9249b..4f069d3dc83 100644 --- a/Sources/users/Types.swift +++ b/Sources/users/Types.swift @@ -170,7 +170,7 @@ public protocol APIProtocol: Sendable { /// /// Adds a public SSH key to the authenticated user's GitHub account. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `write:public_key` scope to use this endpoint. /// /// - Remark: HTTP `POST /user/keys`. /// - Remark: Generated from `#/paths//user/keys/post(users/create-public-ssh-key-for-authenticated-user)`. @@ -300,6 +300,38 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /users/{username}`. /// - Remark: Generated from `#/paths//users/{username}/get(users/get-by-username)`. func usersGetByUsername(_ input: Operations.UsersGetByUsername.Input) async throws -> Operations.UsersGetByUsername.Output + /// List attestations by bulk subject digests + /// + /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by a user. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /users/{username}/attestations/bulk-list`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/bulk-list/post(users/list-attestations-bulk)`. + func usersListAttestationsBulk(_ input: Operations.UsersListAttestationsBulk.Input) async throws -> Operations.UsersListAttestationsBulk.Output + /// Delete attestations in bulk + /// + /// Delete artifact attestations in bulk by either subject digests or unique ID. + /// + /// - Remark: HTTP `POST /users/{username}/attestations/delete-request`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/delete-request/post(users/delete-attestations-bulk)`. + func usersDeleteAttestationsBulk(_ input: Operations.UsersDeleteAttestationsBulk.Input) async throws -> Operations.UsersDeleteAttestationsBulk.Output + /// Delete attestations by subject digest + /// + /// Delete an artifact attestation by subject digest. + /// + /// - Remark: HTTP `DELETE /users/{username}/attestations/digest/{subject_digest}`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/digest/{subject_digest}/delete(users/delete-attestations-by-subject-digest)`. + func usersDeleteAttestationsBySubjectDigest(_ input: Operations.UsersDeleteAttestationsBySubjectDigest.Input) async throws -> Operations.UsersDeleteAttestationsBySubjectDigest.Output + /// Delete attestations by ID + /// + /// Delete an artifact attestation by unique ID that is associated with a repository owned by a user. + /// + /// - Remark: HTTP `DELETE /users/{username}/attestations/{attestation_id}`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/{attestation_id}/delete(users/delete-attestations-by-id)`. + func usersDeleteAttestationsById(_ input: Operations.UsersDeleteAttestationsById.Input) async throws -> Operations.UsersDeleteAttestationsById.Output /// List attestations /// /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user. @@ -688,7 +720,7 @@ extension APIProtocol { /// /// Adds a public SSH key to the authenticated user's GitHub account. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `write:public_key` scope to use this endpoint. /// /// - Remark: HTTP `POST /user/keys`. /// - Remark: Generated from `#/paths//user/keys/post(users/create-public-ssh-key-for-authenticated-user)`. @@ -930,6 +962,76 @@ extension APIProtocol { headers: headers )) } + /// List attestations by bulk subject digests + /// + /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by a user. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /users/{username}/attestations/bulk-list`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/bulk-list/post(users/list-attestations-bulk)`. + public func usersListAttestationsBulk( + path: Operations.UsersListAttestationsBulk.Input.Path, + query: Operations.UsersListAttestationsBulk.Input.Query = .init(), + headers: Operations.UsersListAttestationsBulk.Input.Headers = .init(), + body: Operations.UsersListAttestationsBulk.Input.Body + ) async throws -> Operations.UsersListAttestationsBulk.Output { + try await usersListAttestationsBulk(Operations.UsersListAttestationsBulk.Input( + path: path, + query: query, + headers: headers, + body: body + )) + } + /// Delete attestations in bulk + /// + /// Delete artifact attestations in bulk by either subject digests or unique ID. + /// + /// - Remark: HTTP `POST /users/{username}/attestations/delete-request`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/delete-request/post(users/delete-attestations-bulk)`. + public func usersDeleteAttestationsBulk( + path: Operations.UsersDeleteAttestationsBulk.Input.Path, + headers: Operations.UsersDeleteAttestationsBulk.Input.Headers = .init(), + body: Operations.UsersDeleteAttestationsBulk.Input.Body + ) async throws -> Operations.UsersDeleteAttestationsBulk.Output { + try await usersDeleteAttestationsBulk(Operations.UsersDeleteAttestationsBulk.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete attestations by subject digest + /// + /// Delete an artifact attestation by subject digest. + /// + /// - Remark: HTTP `DELETE /users/{username}/attestations/digest/{subject_digest}`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/digest/{subject_digest}/delete(users/delete-attestations-by-subject-digest)`. + public func usersDeleteAttestationsBySubjectDigest( + path: Operations.UsersDeleteAttestationsBySubjectDigest.Input.Path, + headers: Operations.UsersDeleteAttestationsBySubjectDigest.Input.Headers = .init() + ) async throws -> Operations.UsersDeleteAttestationsBySubjectDigest.Output { + try await usersDeleteAttestationsBySubjectDigest(Operations.UsersDeleteAttestationsBySubjectDigest.Input( + path: path, + headers: headers + )) + } + /// Delete attestations by ID + /// + /// Delete an artifact attestation by unique ID that is associated with a repository owned by a user. + /// + /// - Remark: HTTP `DELETE /users/{username}/attestations/{attestation_id}`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/{attestation_id}/delete(users/delete-attestations-by-id)`. + public func usersDeleteAttestationsById( + path: Operations.UsersDeleteAttestationsById.Input.Path, + headers: Operations.UsersDeleteAttestationsById.Input.Headers = .init() + ) async throws -> Operations.UsersDeleteAttestationsById.Output { + try await usersDeleteAttestationsById(Operations.UsersDeleteAttestationsById.Input( + path: path, + headers: headers + )) + } /// List attestations /// /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user. @@ -2529,6 +2631,8 @@ public enum Components { public var verified: Swift.Bool /// - Remark: Generated from `#/components/schemas/key/read_only`. public var readOnly: Swift.Bool + /// - Remark: Generated from `#/components/schemas/key/last_used`. + public var lastUsed: Foundation.Date? /// Creates a new `Key`. /// /// - Parameters: @@ -2539,6 +2643,7 @@ public enum Components { /// - createdAt: /// - verified: /// - readOnly: + /// - lastUsed: public init( key: Swift.String, id: Swift.Int64, @@ -2546,7 +2651,8 @@ public enum Components { title: Swift.String, createdAt: Foundation.Date, verified: Swift.Bool, - readOnly: Swift.Bool + readOnly: Swift.Bool, + lastUsed: Foundation.Date? = nil ) { self.key = key self.id = id @@ -2555,6 +2661,7 @@ public enum Components { self.createdAt = createdAt self.verified = verified self.readOnly = readOnly + self.lastUsed = lastUsed } public enum CodingKeys: String, CodingKey { case key @@ -2564,6 +2671,7 @@ public enum Components { case createdAt = "created_at" case verified case readOnly = "read_only" + case lastUsed = "last_used" } } /// Social media account @@ -2678,21 +2786,33 @@ public enum Components { public var id: Swift.Int /// - Remark: Generated from `#/components/schemas/key-simple/key`. public var key: Swift.String + /// - Remark: Generated from `#/components/schemas/key-simple/created_at`. + public var createdAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/key-simple/last_used`. + public var lastUsed: Foundation.Date? /// Creates a new `KeySimple`. /// /// - Parameters: /// - id: /// - key: + /// - createdAt: + /// - lastUsed: public init( id: Swift.Int, - key: Swift.String + key: Swift.String, + createdAt: Foundation.Date? = nil, + lastUsed: Foundation.Date? = nil ) { self.id = id self.key = key + self.createdAt = createdAt + self.lastUsed = lastUsed } public enum CodingKeys: String, CodingKey { case id case key + case createdAt = "created_at" + case lastUsed = "last_used" } } } @@ -2714,14 +2834,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int - /// account_id parameter - /// - /// - Remark: Generated from `#/components/parameters/account-id`. - public typealias AccountId = Swift.Int /// The handle for the GitHub user account. /// /// - Remark: Generated from `#/components/parameters/username`. public typealias Username = Swift.String + /// account_id parameter + /// + /// - Remark: Generated from `#/components/parameters/account-id`. + public typealias AccountId = Swift.Int /// A user ID. Only return users with an ID greater than this ID. /// /// - Remark: Generated from `#/components/parameters/since-user`. @@ -7946,7 +8066,7 @@ public enum Operations { /// /// Adds a public SSH key to the authenticated user's GitHub account. /// - /// OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need the `write:public_key` scope to use this endpoint. /// /// - Remark: HTTP `POST /user/keys`. /// - Remark: Generated from `#/paths//user/keys/post(users/create-public-ssh-key-for-authenticated-user)`. @@ -11285,6 +11405,1014 @@ public enum Operations { } } } + /// List attestations by bulk subject digests + /// + /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by a user. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /users/{username}/attestations/bulk-list`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/bulk-list/post(users/list-attestations-bulk)`. + public enum UsersListAttestationsBulk { + public static let id: Swift.String = "users/list-attestations-bulk" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/path`. + public struct Path: Sendable, Hashable { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - username: The handle for the GitHub user account. + public init(username: Components.Parameters.Username) { + self.username = username + } + } + public var path: Operations.UsersListAttestationsBulk.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). 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)." + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// 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)." + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// 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)." + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). 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)." + /// - 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)." + /// - 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)." + public init( + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil + ) { + self.perPage = perPage + self.before = before + self.after = after + } + } + public var query: Operations.UsersListAttestationsBulk.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.UsersListAttestationsBulk.Input.Headers + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// List of subject digests to fetch attestations for. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/requestBody/json/subject_digests`. + public var subjectDigests: [Swift.String] + /// Optional filter for fetching attestations with a given predicate type. + /// This option accepts `provenance`, `sbom`, `release`, or freeform text + /// for custom predicate types. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/requestBody/json/predicate_type`. + public var predicateType: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - subjectDigests: List of subject digests to fetch attestations for. + /// - predicateType: Optional filter for fetching attestations with a given predicate type. + public init( + subjectDigests: [Swift.String], + predicateType: Swift.String? = nil + ) { + self.subjectDigests = subjectDigests + self.predicateType = predicateType + } + public enum CodingKeys: String, CodingKey { + case subjectDigests = "subject_digests" + case predicateType = "predicate_type" + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/requestBody/content/application\/json`. + case json(Operations.UsersListAttestationsBulk.Input.Body.JsonPayload) + } + public var body: Operations.UsersListAttestationsBulk.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + /// - body: + public init( + path: Operations.UsersListAttestationsBulk.Input.Path, + query: Operations.UsersListAttestationsBulk.Input.Query = .init(), + headers: Operations.UsersListAttestationsBulk.Input.Headers = .init(), + body: Operations.UsersListAttestationsBulk.Input.Body + ) { + self.path = path + self.query = query + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Mapping of subject digest to bundles. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests`. + public struct AttestationsSubjectDigestsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload`. + public struct AdditionalPropertiesPayloadPayload: Codable, Hashable, Sendable { + /// The bundle of the attestation. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle`. + public struct BundlePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/mediaType`. + public var mediaType: Swift.String? + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/verificationMaterial`. + public struct VerificationMaterialPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `VerificationMaterialPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/verificationMaterial`. + public var verificationMaterial: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.VerificationMaterialPayload? + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/dsseEnvelope`. + public struct DsseEnvelopePayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `DsseEnvelopePayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/dsseEnvelope`. + public var dsseEnvelope: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.DsseEnvelopePayload? + /// Creates a new `BundlePayload`. + /// + /// - Parameters: + /// - mediaType: + /// - verificationMaterial: + /// - dsseEnvelope: + public init( + mediaType: Swift.String? = nil, + verificationMaterial: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.VerificationMaterialPayload? = nil, + dsseEnvelope: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.DsseEnvelopePayload? = nil + ) { + self.mediaType = mediaType + self.verificationMaterial = verificationMaterial + self.dsseEnvelope = dsseEnvelope + } + public enum CodingKeys: String, CodingKey { + case mediaType + case verificationMaterial + case dsseEnvelope + } + } + /// The bundle of the attestation. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle`. + public var bundle: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload? + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/repository_id`. + public var repositoryId: Swift.Int? + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle_url`. + public var bundleUrl: Swift.String? + /// Creates a new `AdditionalPropertiesPayloadPayload`. + /// + /// - Parameters: + /// - bundle: The bundle of the attestation. + /// - repositoryId: + /// - bundleUrl: + public init( + bundle: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload? = nil, + repositoryId: Swift.Int? = nil, + bundleUrl: Swift.String? = nil + ) { + self.bundle = bundle + self.repositoryId = repositoryId + self.bundleUrl = bundleUrl + } + public enum CodingKeys: String, CodingKey { + case bundle + case repositoryId = "repository_id" + case bundleUrl = "bundle_url" + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/additionalProperties`. + public typealias AdditionalPropertiesPayload = [Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload] + /// A container of undocumented properties. + public var additionalProperties: [String: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayload?] + /// Creates a new `AttestationsSubjectDigestsPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: [String: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayload?] = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Mapping of subject digest to bundles. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests`. + public var attestationsSubjectDigests: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload? + /// Information about the current page. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/page_info`. + public struct PageInfoPayload: Codable, Hashable, Sendable { + /// Indicates whether there is a next page. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/page_info/has_next`. + public var hasNext: Swift.Bool? + /// Indicates whether there is a previous page. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/page_info/has_previous`. + public var hasPrevious: Swift.Bool? + /// The cursor to the next page. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/page_info/next`. + public var next: Swift.String? + /// The cursor to the previous page. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/page_info/previous`. + public var previous: Swift.String? + /// Creates a new `PageInfoPayload`. + /// + /// - Parameters: + /// - hasNext: Indicates whether there is a next page. + /// - hasPrevious: Indicates whether there is a previous page. + /// - next: The cursor to the next page. + /// - previous: The cursor to the previous page. + public init( + hasNext: Swift.Bool? = nil, + hasPrevious: Swift.Bool? = nil, + next: Swift.String? = nil, + previous: Swift.String? = nil + ) { + self.hasNext = hasNext + self.hasPrevious = hasPrevious + self.next = next + self.previous = previous + } + public enum CodingKeys: String, CodingKey { + case hasNext = "has_next" + case hasPrevious = "has_previous" + case next + case previous + } + } + /// Information about the current page. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/page_info`. + public var pageInfo: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.PageInfoPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - attestationsSubjectDigests: Mapping of subject digest to bundles. + /// - pageInfo: Information about the current page. + public init( + attestationsSubjectDigests: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload? = nil, + pageInfo: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.PageInfoPayload? = nil + ) { + self.attestationsSubjectDigests = attestationsSubjectDigests + self.pageInfo = pageInfo + } + public enum CodingKeys: String, CodingKey { + case attestationsSubjectDigests = "attestations_subject_digests" + case pageInfo = "page_info" + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/application\/json`. + case json(Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.UsersListAttestationsBulk.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.UsersListAttestationsBulk.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/bulk-list/post(users/list-attestations-bulk)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.UsersListAttestationsBulk.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.UsersListAttestationsBulk.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete attestations in bulk + /// + /// Delete artifact attestations in bulk by either subject digests or unique ID. + /// + /// - Remark: HTTP `POST /users/{username}/attestations/delete-request`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/delete-request/post(users/delete-attestations-bulk)`. + public enum UsersDeleteAttestationsBulk { + public static let id: Swift.String = "users/delete-attestations-bulk" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/delete-request/POST/path`. + public struct Path: Sendable, Hashable { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/delete-request/POST/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - username: The handle for the GitHub user account. + public init(username: Components.Parameters.Username) { + self.username = username + } + } + public var path: Operations.UsersDeleteAttestationsBulk.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/attestations/delete-request/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.UsersDeleteAttestationsBulk.Input.Headers + /// - Remark: Generated from `#/paths/users/{username}/attestations/delete-request/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// The request body must include either `subject_digests` or `attestation_ids`, but not both. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/delete-request/POST/requestBody/json`. + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/delete-request/POST/requestBody/json/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// List of subject digests associated with the artifact attestations to delete. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/delete-request/POST/requestBody/json/case1/subject_digests`. + public var subjectDigests: [Swift.String] + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - subjectDigests: List of subject digests associated with the artifact attestations to delete. + public init(subjectDigests: [Swift.String]) { + self.subjectDigests = subjectDigests + } + public enum CodingKeys: String, CodingKey { + case subjectDigests = "subject_digests" + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/delete-request/POST/requestBody/json/case1`. + case case1(Operations.UsersDeleteAttestationsBulk.Input.Body.JsonPayload.Case1Payload) + /// - Remark: Generated from `#/paths/users/{username}/attestations/delete-request/POST/requestBody/json/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// List of unique IDs associated with the artifact attestations to delete. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/delete-request/POST/requestBody/json/case2/attestation_ids`. + public var attestationIds: [Swift.Int] + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - attestationIds: List of unique IDs associated with the artifact attestations to delete. + public init(attestationIds: [Swift.Int]) { + self.attestationIds = attestationIds + } + public enum CodingKeys: String, CodingKey { + case attestationIds = "attestation_ids" + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/delete-request/POST/requestBody/json/case2`. + case case2(Operations.UsersDeleteAttestationsBulk.Input.Body.JsonPayload.Case2Payload) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/delete-request/POST/requestBody/content/application\/json`. + case json(Operations.UsersDeleteAttestationsBulk.Input.Body.JsonPayload) + } + public var body: Operations.UsersDeleteAttestationsBulk.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.UsersDeleteAttestationsBulk.Input.Path, + headers: Operations.UsersDeleteAttestationsBulk.Input.Headers = .init(), + body: Operations.UsersDeleteAttestationsBulk.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// Creates a new `Ok`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/delete-request/post(users/delete-attestations-bulk)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.UsersDeleteAttestationsBulk.Output.Ok) + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/delete-request/post(users/delete-attestations-bulk)/responses/200`. + /// + /// HTTP response code: `200 ok`. + public static var ok: Self { + .ok(.init()) + } + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.UsersDeleteAttestationsBulk.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/delete-request/post(users/delete-attestations-bulk)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete attestations by subject digest + /// + /// Delete an artifact attestation by subject digest. + /// + /// - Remark: HTTP `DELETE /users/{username}/attestations/digest/{subject_digest}`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/digest/{subject_digest}/delete(users/delete-attestations-by-subject-digest)`. + public enum UsersDeleteAttestationsBySubjectDigest { + public static let id: Swift.String = "users/delete-attestations-by-subject-digest" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/digest/{subject_digest}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/digest/{subject_digest}/DELETE/path/username`. + public var username: Components.Parameters.Username + /// Subject Digest + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/digest/{subject_digest}/DELETE/path/subject_digest`. + public var subjectDigest: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - username: The handle for the GitHub user account. + /// - subjectDigest: Subject Digest + public init( + username: Components.Parameters.Username, + subjectDigest: Swift.String + ) { + self.username = username + self.subjectDigest = subjectDigest + } + } + public var path: Operations.UsersDeleteAttestationsBySubjectDigest.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/attestations/digest/{subject_digest}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.UsersDeleteAttestationsBySubjectDigest.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.UsersDeleteAttestationsBySubjectDigest.Input.Path, + headers: Operations.UsersDeleteAttestationsBySubjectDigest.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// Creates a new `Ok`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/digest/{subject_digest}/delete(users/delete-attestations-by-subject-digest)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.UsersDeleteAttestationsBySubjectDigest.Output.Ok) + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/digest/{subject_digest}/delete(users/delete-attestations-by-subject-digest)/responses/200`. + /// + /// HTTP response code: `200 ok`. + public static var ok: Self { + .ok(.init()) + } + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.UsersDeleteAttestationsBySubjectDigest.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/digest/{subject_digest}/delete(users/delete-attestations-by-subject-digest)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.UsersDeleteAttestationsBySubjectDigest.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/digest/{subject_digest}/delete(users/delete-attestations-by-subject-digest)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.UsersDeleteAttestationsBySubjectDigest.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/digest/{subject_digest}/delete(users/delete-attestations-by-subject-digest)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete attestations by ID + /// + /// Delete an artifact attestation by unique ID that is associated with a repository owned by a user. + /// + /// - Remark: HTTP `DELETE /users/{username}/attestations/{attestation_id}`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/{attestation_id}/delete(users/delete-attestations-by-id)`. + public enum UsersDeleteAttestationsById { + public static let id: Swift.String = "users/delete-attestations-by-id" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/{attestation_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/{attestation_id}/DELETE/path/username`. + public var username: Components.Parameters.Username + /// Attestation ID + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/{attestation_id}/DELETE/path/attestation_id`. + public var attestationId: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - username: The handle for the GitHub user account. + /// - attestationId: Attestation ID + public init( + username: Components.Parameters.Username, + attestationId: Swift.Int + ) { + self.username = username + self.attestationId = attestationId + } + } + public var path: Operations.UsersDeleteAttestationsById.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/attestations/{attestation_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.UsersDeleteAttestationsById.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.UsersDeleteAttestationsById.Input.Path, + headers: Operations.UsersDeleteAttestationsById.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// Creates a new `Ok`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/{attestation_id}/delete(users/delete-attestations-by-id)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.UsersDeleteAttestationsById.Output.Ok) + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/{attestation_id}/delete(users/delete-attestations-by-id)/responses/200`. + /// + /// HTTP response code: `200 ok`. + public static var ok: Self { + .ok(.init()) + } + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.UsersDeleteAttestationsById.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/{attestation_id}/delete(users/delete-attestations-by-id)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.UsersDeleteAttestationsById.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/{attestation_id}/delete(users/delete-attestations-by-id)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.UsersDeleteAttestationsById.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/{attestation_id}/delete(users/delete-attestations-by-id)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/{attestation_id}/delete(users/delete-attestations-by-id)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// List attestations /// /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user. @@ -11337,7 +12465,8 @@ public enum Operations { /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/query/after`. public var after: Components.Parameters.PaginationAfter? /// Optional filter for fetching attestations with a given predicate type. - /// This option accepts `provenance`, `sbom`, or freeform text for custom predicate types. + /// This option accepts `provenance`, `sbom`, `release`, or freeform text + /// for custom predicate types. /// /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/query/predicate_type`. public var predicateType: Swift.String? @@ -11474,25 +12603,31 @@ public enum Operations { public var repositoryId: Swift.Int? /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/bundle_url`. public var bundleUrl: Swift.String? + /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/AttestationsPayload/initiator`. + public var initiator: Swift.String? /// Creates a new `AttestationsPayloadPayload`. /// /// - Parameters: /// - bundle: The attestation's Sigstore Bundle. /// - repositoryId: /// - bundleUrl: + /// - initiator: public init( bundle: Operations.UsersListAttestations.Output.Ok.Body.JsonPayload.AttestationsPayloadPayload.BundlePayload? = nil, repositoryId: Swift.Int? = nil, - bundleUrl: Swift.String? = nil + bundleUrl: Swift.String? = nil, + initiator: Swift.String? = nil ) { self.bundle = bundle self.repositoryId = repositoryId self.bundleUrl = bundleUrl + self.initiator = initiator } public enum CodingKeys: String, CodingKey { case bundle case repositoryId = "repository_id" case bundleUrl = "bundle_url" + case initiator } } /// - Remark: Generated from `#/paths/users/{username}/attestations/{subject_digest}/GET/responses/200/content/json/attestations`. diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index 7291aebf742..ebc1fecbcfb 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit 7291aebf74227b541192db318cb6d5ec7d9388e9 +Subproject commit ebc1fecbcfb4449cc61d45e2608ac765b5b144a0