diff --git a/.spi.yml b/.spi.yml index 44586d6e2b4..f09de7b26b1 100644 --- a/.spi.yml +++ b/.spi.yml @@ -5,6 +5,7 @@ builder: - GitHubRestAPIActions - GitHubRestAPIActivity - GitHubRestAPIAgent_Tasks + - GitHubRestAPIAgents - GitHubRestAPIApps - GitHubRestAPIBilling - GitHubRestAPICampaigns diff --git a/Package.swift b/Package.swift index 3827a2b4163..b7e12eb457a 100644 --- a/Package.swift +++ b/Package.swift @@ -14,6 +14,7 @@ let package = Package( .library(name: "GitHubRestAPIActions", targets: ["GitHubRestAPIActions"]), .library(name: "GitHubRestAPIActivity", targets: ["GitHubRestAPIActivity"]), .library(name: "GitHubRestAPIAgent_Tasks", targets: ["GitHubRestAPIAgent_Tasks"]), + .library(name: "GitHubRestAPIAgents", targets: ["GitHubRestAPIAgents"]), .library(name: "GitHubRestAPIApps", targets: ["GitHubRestAPIApps"]), .library(name: "GitHubRestAPIBilling", targets: ["GitHubRestAPIBilling"]), .library(name: "GitHubRestAPICampaigns", targets: ["GitHubRestAPICampaigns"]), @@ -90,6 +91,14 @@ let package = Package( ], path: "Sources/agent-tasks" ), + .target( + name: "GitHubRestAPIAgents", + dependencies: [ + .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), + .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"), + ], + path: "Sources/agents" + ), .target( name: "GitHubRestAPIApps", dependencies: [ diff --git a/Sources/actions/Client.swift b/Sources/actions/Client.swift index 1aac61c879e..a5a30568fef 100644 --- a/Sources/actions/Client.swift +++ b/Sources/actions/Client.swift @@ -8524,6 +8524,254 @@ public struct Client: APIProtocol { } ) } + /// List concurrency groups for a repository + /// + /// Lists the active concurrency groups for a repository. + /// + /// 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/concurrency_groups`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/concurrency_groups/get(actions/list-concurrency-groups-for-repository)`. + public func actionsListConcurrencyGroupsForRepository(_ input: Operations.ActionsListConcurrencyGroupsForRepository.Input) async throws -> Operations.ActionsListConcurrencyGroupsForRepository.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListConcurrencyGroupsForRepository.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/concurrency_groups", + 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: "after", + value: input.query.after + ) + 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.ActionsListConcurrencyGroupsForRepository.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.ActionsListConcurrencyGroupsForRepository.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.ConcurrencyGroupList.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 + ) + ) + } + } + ) + } + /// Get a concurrency group for a repository + /// + /// Gets a specific concurrency group for a repository, including all instances in the group's queue. + /// Returns 404 if the group is inactive or does not exist. + /// + /// Optionally, pass `ahead_of_run` or `ahead_of_job` to filter the results to only the items + /// ahead of the specified workflow run or job in the queue, plus the specified item itself + /// (returned as the last element). This is useful for determining what is blocking a particular + /// run or job. Returns 422 if the specified run or job is not in this concurrency group. + /// + /// When using `ahead_of_run`, this matches workflow-level concurrency and any reusable-workflow + /// leases held on behalf of that run. Job-level leases within the run are not considered to + /// block the run as a whole. Use `ahead_of_job` to match job-level concurrency and reusable-workflow + /// leases on the job's ancestor paths. + /// + /// 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/concurrency_groups/{concurrency_group_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/concurrency_groups/{concurrency_group_name}/get(actions/get-concurrency-group-for-repository)`. + public func actionsGetConcurrencyGroupForRepository(_ input: Operations.ActionsGetConcurrencyGroupForRepository.Input) async throws -> Operations.ActionsGetConcurrencyGroupForRepository.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsGetConcurrencyGroupForRepository.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/concurrency_groups/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.concurrencyGroupName + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "ahead_of_run", + value: input.query.aheadOfRun + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "ahead_of_job", + value: input.query.aheadOfJob + ) + 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.ActionsGetConcurrencyGroupForRepository.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.ConcurrencyGroup.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 + ) + ) + } + } + ) + } /// Get a job for a workflow run /// /// Gets a specific job in a workflow run. @@ -12327,6 +12575,163 @@ public struct Client: APIProtocol { } ) } + /// List concurrency groups for a workflow run + /// + /// Lists all concurrency groups associated with a workflow run or its jobs. + /// + /// The set of groups is derived from the run's configuration, so a group is + /// included even when the run no longer has any items currently holding or + /// waiting in it. In that case the `group_members` array will be empty. + /// `total_count` reflects the number of groups the run participates in by + /// configuration, not the number with active items. + /// + /// This differs from `GET /repos/{owner}/{repo}/actions/concurrency_groups/{group_name}`, + /// which returns 404 when a group has no active items. That endpoint reports + /// the live state of a group repo-wide, while this endpoint reports the + /// groups associated with a specific run by configuration. + /// + /// Results are sorted by group name and support cursor-based pagination via + /// `before` and `after`. The `after` cursor paginates forward only and does + /// not emit a `rel="prev"` Link; use `before` to page backward from a + /// forward page's `next` cursor. + /// + /// 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/runs/{run_id}/concurrency_groups`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/runs/{run_id}/concurrency_groups/get(actions/list-concurrency-groups-for-workflow-run)`. + public func actionsListConcurrencyGroupsForWorkflowRun(_ input: Operations.ActionsListConcurrencyGroupsForWorkflowRun.Input) async throws -> Operations.ActionsListConcurrencyGroupsForWorkflowRun.Output { + try await client.send( + input: input, + forOperation: Operations.ActionsListConcurrencyGroupsForWorkflowRun.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/actions/runs/{}/concurrency_groups", + parameters: [ + input.path.owner, + input.path.repo, + input.path.runId + ] + ) + 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: "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) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.ActionsListConcurrencyGroupsForWorkflowRun.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.ActionsListConcurrencyGroupsForWorkflowRun.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.ConcurrencyGroupRunList.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)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Review custom deployment protection rules for a workflow run /// /// Approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)." diff --git a/Sources/actions/Types.swift b/Sources/actions/Types.swift index c448308da13..228134e5ead 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -1049,6 +1049,35 @@ public protocol APIProtocol: Sendable { /// - 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)`. func actionsDeleteActionsCacheById(_ input: Operations.ActionsDeleteActionsCacheById.Input) async throws -> Operations.ActionsDeleteActionsCacheById.Output + /// List concurrency groups for a repository + /// + /// Lists the active concurrency groups for a repository. + /// + /// 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/concurrency_groups`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/concurrency_groups/get(actions/list-concurrency-groups-for-repository)`. + func actionsListConcurrencyGroupsForRepository(_ input: Operations.ActionsListConcurrencyGroupsForRepository.Input) async throws -> Operations.ActionsListConcurrencyGroupsForRepository.Output + /// Get a concurrency group for a repository + /// + /// Gets a specific concurrency group for a repository, including all instances in the group's queue. + /// Returns 404 if the group is inactive or does not exist. + /// + /// Optionally, pass `ahead_of_run` or `ahead_of_job` to filter the results to only the items + /// ahead of the specified workflow run or job in the queue, plus the specified item itself + /// (returned as the last element). This is useful for determining what is blocking a particular + /// run or job. Returns 422 if the specified run or job is not in this concurrency group. + /// + /// When using `ahead_of_run`, this matches workflow-level concurrency and any reusable-workflow + /// leases held on behalf of that run. Job-level leases within the run are not considered to + /// block the run as a whole. Use `ahead_of_job` to match job-level concurrency and reusable-workflow + /// leases on the job's ancestor paths. + /// + /// 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/concurrency_groups/{concurrency_group_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/concurrency_groups/{concurrency_group_name}/get(actions/get-concurrency-group-for-repository)`. + func actionsGetConcurrencyGroupForRepository(_ input: Operations.ActionsGetConcurrencyGroupForRepository.Input) async throws -> Operations.ActionsGetConcurrencyGroupForRepository.Output /// Get a job for a workflow run /// /// Gets a specific job in a workflow run. @@ -1514,6 +1543,31 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/runs/{run_id}/cancel/post(actions/cancel-workflow-run)`. func actionsCancelWorkflowRun(_ input: Operations.ActionsCancelWorkflowRun.Input) async throws -> Operations.ActionsCancelWorkflowRun.Output + /// List concurrency groups for a workflow run + /// + /// Lists all concurrency groups associated with a workflow run or its jobs. + /// + /// The set of groups is derived from the run's configuration, so a group is + /// included even when the run no longer has any items currently holding or + /// waiting in it. In that case the `group_members` array will be empty. + /// `total_count` reflects the number of groups the run participates in by + /// configuration, not the number with active items. + /// + /// This differs from `GET /repos/{owner}/{repo}/actions/concurrency_groups/{group_name}`, + /// which returns 404 when a group has no active items. That endpoint reports + /// the live state of a group repo-wide, while this endpoint reports the + /// groups associated with a specific run by configuration. + /// + /// Results are sorted by group name and support cursor-based pagination via + /// `before` and `after`. The `after` cursor paginates forward only and does + /// not emit a `rel="prev"` Link; use `before` to page backward from a + /// forward page's `next` cursor. + /// + /// 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/runs/{run_id}/concurrency_groups`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/runs/{run_id}/concurrency_groups/get(actions/list-concurrency-groups-for-workflow-run)`. + func actionsListConcurrencyGroupsForWorkflowRun(_ input: Operations.ActionsListConcurrencyGroupsForWorkflowRun.Input) async throws -> Operations.ActionsListConcurrencyGroupsForWorkflowRun.Output /// Review custom deployment protection rules for a workflow run /// /// Approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)." @@ -3774,6 +3828,55 @@ extension APIProtocol { public func actionsDeleteActionsCacheById(path: Operations.ActionsDeleteActionsCacheById.Input.Path) async throws -> Operations.ActionsDeleteActionsCacheById.Output { try await actionsDeleteActionsCacheById(Operations.ActionsDeleteActionsCacheById.Input(path: path)) } + /// List concurrency groups for a repository + /// + /// Lists the active concurrency groups for a repository. + /// + /// 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/concurrency_groups`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/concurrency_groups/get(actions/list-concurrency-groups-for-repository)`. + public func actionsListConcurrencyGroupsForRepository( + path: Operations.ActionsListConcurrencyGroupsForRepository.Input.Path, + query: Operations.ActionsListConcurrencyGroupsForRepository.Input.Query = .init(), + headers: Operations.ActionsListConcurrencyGroupsForRepository.Input.Headers = .init() + ) async throws -> Operations.ActionsListConcurrencyGroupsForRepository.Output { + try await actionsListConcurrencyGroupsForRepository(Operations.ActionsListConcurrencyGroupsForRepository.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get a concurrency group for a repository + /// + /// Gets a specific concurrency group for a repository, including all instances in the group's queue. + /// Returns 404 if the group is inactive or does not exist. + /// + /// Optionally, pass `ahead_of_run` or `ahead_of_job` to filter the results to only the items + /// ahead of the specified workflow run or job in the queue, plus the specified item itself + /// (returned as the last element). This is useful for determining what is blocking a particular + /// run or job. Returns 422 if the specified run or job is not in this concurrency group. + /// + /// When using `ahead_of_run`, this matches workflow-level concurrency and any reusable-workflow + /// leases held on behalf of that run. Job-level leases within the run are not considered to + /// block the run as a whole. Use `ahead_of_job` to match job-level concurrency and reusable-workflow + /// leases on the job's ancestor paths. + /// + /// 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/concurrency_groups/{concurrency_group_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/concurrency_groups/{concurrency_group_name}/get(actions/get-concurrency-group-for-repository)`. + public func actionsGetConcurrencyGroupForRepository( + path: Operations.ActionsGetConcurrencyGroupForRepository.Input.Path, + query: Operations.ActionsGetConcurrencyGroupForRepository.Input.Query = .init(), + headers: Operations.ActionsGetConcurrencyGroupForRepository.Input.Headers = .init() + ) async throws -> Operations.ActionsGetConcurrencyGroupForRepository.Output { + try await actionsGetConcurrencyGroupForRepository(Operations.ActionsGetConcurrencyGroupForRepository.Input( + path: path, + query: query, + headers: headers + )) + } /// Get a job for a workflow run /// /// Gets a specific job in a workflow run. @@ -4597,6 +4700,41 @@ extension APIProtocol { headers: headers )) } + /// List concurrency groups for a workflow run + /// + /// Lists all concurrency groups associated with a workflow run or its jobs. + /// + /// The set of groups is derived from the run's configuration, so a group is + /// included even when the run no longer has any items currently holding or + /// waiting in it. In that case the `group_members` array will be empty. + /// `total_count` reflects the number of groups the run participates in by + /// configuration, not the number with active items. + /// + /// This differs from `GET /repos/{owner}/{repo}/actions/concurrency_groups/{group_name}`, + /// which returns 404 when a group has no active items. That endpoint reports + /// the live state of a group repo-wide, while this endpoint reports the + /// groups associated with a specific run by configuration. + /// + /// Results are sorted by group name and support cursor-based pagination via + /// `before` and `after`. The `after` cursor paginates forward only and does + /// not emit a `rel="prev"` Link; use `before` to page backward from a + /// forward page's `next` cursor. + /// + /// 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/runs/{run_id}/concurrency_groups`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/runs/{run_id}/concurrency_groups/get(actions/list-concurrency-groups-for-workflow-run)`. + public func actionsListConcurrencyGroupsForWorkflowRun( + path: Operations.ActionsListConcurrencyGroupsForWorkflowRun.Input.Path, + query: Operations.ActionsListConcurrencyGroupsForWorkflowRun.Input.Query = .init(), + headers: Operations.ActionsListConcurrencyGroupsForWorkflowRun.Input.Headers = .init() + ) async throws -> Operations.ActionsListConcurrencyGroupsForWorkflowRun.Output { + try await actionsListConcurrencyGroupsForWorkflowRun(Operations.ActionsListConcurrencyGroupsForWorkflowRun.Input( + path: path, + query: query, + headers: headers + )) + } /// Review custom deployment protection rules for a workflow run /// /// Approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)." @@ -10307,6 +10445,196 @@ public enum Components { case actionsCaches = "actions_caches" } } + /// A list of active concurrency groups for a repository. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-list`. + public struct ConcurrencyGroupList: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/concurrency-group-list/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/concurrency-group-list/ConcurrencyGroupsPayload`. + public struct ConcurrencyGroupsPayloadPayload: Codable, Hashable, Sendable { + /// The name of the concurrency group. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-list/ConcurrencyGroupsPayload/group_name`. + public var groupName: Swift.String + /// API URL for this concurrency group. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-list/ConcurrencyGroupsPayload/group_url`. + public var groupUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/concurrency-group-list/ConcurrencyGroupsPayload/last_acquired_at`. + public var lastAcquiredAt: Foundation.Date? + /// Creates a new `ConcurrencyGroupsPayloadPayload`. + /// + /// - Parameters: + /// - groupName: The name of the concurrency group. + /// - groupUrl: API URL for this concurrency group. + /// - lastAcquiredAt: + public init( + groupName: Swift.String, + groupUrl: Swift.String, + lastAcquiredAt: Foundation.Date? = nil + ) { + self.groupName = groupName + self.groupUrl = groupUrl + self.lastAcquiredAt = lastAcquiredAt + } + public enum CodingKeys: String, CodingKey { + case groupName = "group_name" + case groupUrl = "group_url" + case lastAcquiredAt = "last_acquired_at" + } + } + /// - Remark: Generated from `#/components/schemas/concurrency-group-list/concurrency_groups`. + public typealias ConcurrencyGroupsPayload = [Components.Schemas.ConcurrencyGroupList.ConcurrencyGroupsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/concurrency-group-list/concurrency_groups`. + public var concurrencyGroups: Components.Schemas.ConcurrencyGroupList.ConcurrencyGroupsPayload + /// Creates a new `ConcurrencyGroupList`. + /// + /// - Parameters: + /// - totalCount: + /// - concurrencyGroups: + public init( + totalCount: Swift.Int, + concurrencyGroups: Components.Schemas.ConcurrencyGroupList.ConcurrencyGroupsPayload + ) { + self.totalCount = totalCount + self.concurrencyGroups = concurrencyGroups + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case concurrencyGroups = "concurrency_groups" + } + } + /// A concurrency group with the workflow runs and jobs that are either currently holding + /// or waiting for the concurrency group lease. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group`. + public struct ConcurrencyGroup: Codable, Hashable, Sendable { + /// The name of the concurrency group. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group/group_name`. + public var groupName: Swift.String + /// API URL for this concurrency group. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group/group_url`. + public var groupUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/concurrency-group/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/concurrency-group/GroupMembersPayload`. + public struct GroupMembersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the workflow run. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group/GroupMembersPayload/run_id`. + public var runId: Swift.Int + /// The name of the workflow run. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group/GroupMembersPayload/run_name`. + public var runName: Swift.String + /// API URL for the workflow run. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group/GroupMembersPayload/run_url`. + public var runUrl: Swift.String? + /// Web URL for the workflow run. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group/GroupMembersPayload/run_html_url`. + public var runHtmlUrl: Swift.String? + /// The ID of the job, when the item represents a job-level or reusable-workflow-level lease. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group/GroupMembersPayload/job_id`. + public var jobId: Swift.Int? + /// The display name of the job, when the item represents a job-level or reusable-workflow-level lease. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group/GroupMembersPayload/job_name`. + public var jobName: Swift.String? + /// API URL for the job. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group/GroupMembersPayload/job_url`. + public var jobUrl: Swift.String? + /// Web URL for the job. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group/GroupMembersPayload/job_html_url`. + public var jobHtmlUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/concurrency-group/GroupMembersPayload/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case inProgress = "in_progress" + case pending = "pending" + } + /// - Remark: Generated from `#/components/schemas/concurrency-group/GroupMembersPayload/status`. + public var status: Components.Schemas.ConcurrencyGroup.GroupMembersPayloadPayload.StatusPayload + /// Creates a new `GroupMembersPayloadPayload`. + /// + /// - Parameters: + /// - runId: The ID of the workflow run. + /// - runName: The name of the workflow run. + /// - runUrl: API URL for the workflow run. + /// - runHtmlUrl: Web URL for the workflow run. + /// - jobId: The ID of the job, when the item represents a job-level or reusable-workflow-level lease. + /// - jobName: The display name of the job, when the item represents a job-level or reusable-workflow-level lease. + /// - jobUrl: API URL for the job. + /// - jobHtmlUrl: Web URL for the job. + /// - status: + public init( + runId: Swift.Int, + runName: Swift.String, + runUrl: Swift.String? = nil, + runHtmlUrl: Swift.String? = nil, + jobId: Swift.Int? = nil, + jobName: Swift.String? = nil, + jobUrl: Swift.String? = nil, + jobHtmlUrl: Swift.String? = nil, + status: Components.Schemas.ConcurrencyGroup.GroupMembersPayloadPayload.StatusPayload + ) { + self.runId = runId + self.runName = runName + self.runUrl = runUrl + self.runHtmlUrl = runHtmlUrl + self.jobId = jobId + self.jobName = jobName + self.jobUrl = jobUrl + self.jobHtmlUrl = jobHtmlUrl + self.status = status + } + public enum CodingKeys: String, CodingKey { + case runId = "run_id" + case runName = "run_name" + case runUrl = "run_url" + case runHtmlUrl = "run_html_url" + case jobId = "job_id" + case jobName = "job_name" + case jobUrl = "job_url" + case jobHtmlUrl = "job_html_url" + case status + } + } + /// - Remark: Generated from `#/components/schemas/concurrency-group/group_members`. + public typealias GroupMembersPayload = [Components.Schemas.ConcurrencyGroup.GroupMembersPayloadPayload] + /// - Remark: Generated from `#/components/schemas/concurrency-group/group_members`. + public var groupMembers: Components.Schemas.ConcurrencyGroup.GroupMembersPayload + /// Creates a new `ConcurrencyGroup`. + /// + /// - Parameters: + /// - groupName: The name of the concurrency group. + /// - groupUrl: API URL for this concurrency group. + /// - totalCount: + /// - groupMembers: + public init( + groupName: Swift.String, + groupUrl: Swift.String, + totalCount: Swift.Int, + groupMembers: Components.Schemas.ConcurrencyGroup.GroupMembersPayload + ) { + self.groupName = groupName + self.groupUrl = groupUrl + self.totalCount = totalCount + self.groupMembers = groupMembers + } + public enum CodingKeys: String, CodingKey { + case groupName = "group_name" + case groupUrl = "group_url" + case totalCount = "total_count" + case groupMembers = "group_members" + } + } /// Information of a job execution in a workflow run /// /// - Remark: Generated from `#/components/schemas/job`. @@ -11314,6 +11642,188 @@ public enum Components { case comment } } + /// A list of concurrency groups associated with a workflow run. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list`. + public struct ConcurrencyGroupRunList: Codable, Hashable, Sendable { + /// The total number of concurrency groups this workflow run participates in, + /// derived from the run's configuration. This count is not filtered by + /// whether the run currently holds or is waiting in each group, so it can + /// include groups whose `group_members` array is empty (for example, when + /// the run has already released its lease in that group). + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload`. + public struct ConcurrencyGroupsPayloadPayload: Codable, Hashable, Sendable { + /// The name of the concurrency group. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/group_name`. + public var groupName: Swift.String + /// API URL for this concurrency group. May return 404 if the group + /// has no active items at the time it is requested, since the + /// get-by-name endpoint reports the live repo-wide state of a group + /// while this endpoint lists groups associated with a run by + /// configuration. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/group_url`. + public var groupUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/GroupMembersPayload`. + public struct GroupMembersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the workflow run. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/GroupMembersPayload/run_id`. + public var runId: Swift.Int + /// The name of the workflow run. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/GroupMembersPayload/run_name`. + public var runName: Swift.String + /// API URL for the workflow run. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/GroupMembersPayload/run_url`. + public var runUrl: Swift.String? + /// Web URL for the workflow run. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/GroupMembersPayload/run_html_url`. + public var runHtmlUrl: Swift.String? + /// Queue position. 0 means the item holds the concurrency lease (in_progress), 1 or higher means queued (pending). + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/GroupMembersPayload/position`. + public var position: Swift.Int + /// API URL to get items ahead of this item in the concurrency group. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/GroupMembersPayload/position_url`. + public var positionUrl: Swift.String + /// The ID of the job, when the item represents a job-level or reusable-workflow-level lease. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/GroupMembersPayload/job_id`. + public var jobId: Swift.Int? + /// The display name of the job, when the item represents a job-level or reusable-workflow-level lease. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/GroupMembersPayload/job_name`. + public var jobName: Swift.String? + /// API URL for the job. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/GroupMembersPayload/job_url`. + public var jobUrl: Swift.String? + /// Web URL for the job. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/GroupMembersPayload/job_html_url`. + public var jobHtmlUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/GroupMembersPayload/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case inProgress = "in_progress" + case pending = "pending" + } + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/GroupMembersPayload/status`. + public var status: Components.Schemas.ConcurrencyGroupRunList.ConcurrencyGroupsPayloadPayload.GroupMembersPayloadPayload.StatusPayload + /// Creates a new `GroupMembersPayloadPayload`. + /// + /// - Parameters: + /// - runId: The ID of the workflow run. + /// - runName: The name of the workflow run. + /// - runUrl: API URL for the workflow run. + /// - runHtmlUrl: Web URL for the workflow run. + /// - position: Queue position. 0 means the item holds the concurrency lease (in_progress), 1 or higher means queued (pending). + /// - positionUrl: API URL to get items ahead of this item in the concurrency group. + /// - jobId: The ID of the job, when the item represents a job-level or reusable-workflow-level lease. + /// - jobName: The display name of the job, when the item represents a job-level or reusable-workflow-level lease. + /// - jobUrl: API URL for the job. + /// - jobHtmlUrl: Web URL for the job. + /// - status: + public init( + runId: Swift.Int, + runName: Swift.String, + runUrl: Swift.String? = nil, + runHtmlUrl: Swift.String? = nil, + position: Swift.Int, + positionUrl: Swift.String, + jobId: Swift.Int? = nil, + jobName: Swift.String? = nil, + jobUrl: Swift.String? = nil, + jobHtmlUrl: Swift.String? = nil, + status: Components.Schemas.ConcurrencyGroupRunList.ConcurrencyGroupsPayloadPayload.GroupMembersPayloadPayload.StatusPayload + ) { + self.runId = runId + self.runName = runName + self.runUrl = runUrl + self.runHtmlUrl = runHtmlUrl + self.position = position + self.positionUrl = positionUrl + self.jobId = jobId + self.jobName = jobName + self.jobUrl = jobUrl + self.jobHtmlUrl = jobHtmlUrl + self.status = status + } + public enum CodingKeys: String, CodingKey { + case runId = "run_id" + case runName = "run_name" + case runUrl = "run_url" + case runHtmlUrl = "run_html_url" + case position + case positionUrl = "position_url" + case jobId = "job_id" + case jobName = "job_name" + case jobUrl = "job_url" + case jobHtmlUrl = "job_html_url" + case status + } + } + /// Items belonging to this workflow run that are either currently holding or + /// waiting for the concurrency group lease. May be empty if the run no + /// longer has any active or queued items in this group. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/group_members`. + public typealias GroupMembersPayload = [Components.Schemas.ConcurrencyGroupRunList.ConcurrencyGroupsPayloadPayload.GroupMembersPayloadPayload] + /// Items belonging to this workflow run that are either currently holding or + /// waiting for the concurrency group lease. May be empty if the run no + /// longer has any active or queued items in this group. + /// + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/ConcurrencyGroupsPayload/group_members`. + public var groupMembers: Components.Schemas.ConcurrencyGroupRunList.ConcurrencyGroupsPayloadPayload.GroupMembersPayload + /// Creates a new `ConcurrencyGroupsPayloadPayload`. + /// + /// - Parameters: + /// - groupName: The name of the concurrency group. + /// - groupUrl: API URL for this concurrency group. May return 404 if the group + /// - groupMembers: Items belonging to this workflow run that are either currently holding or + public init( + groupName: Swift.String, + groupUrl: Swift.String, + groupMembers: Components.Schemas.ConcurrencyGroupRunList.ConcurrencyGroupsPayloadPayload.GroupMembersPayload + ) { + self.groupName = groupName + self.groupUrl = groupUrl + self.groupMembers = groupMembers + } + public enum CodingKeys: String, CodingKey { + case groupName = "group_name" + case groupUrl = "group_url" + case groupMembers = "group_members" + } + } + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/concurrency_groups`. + public typealias ConcurrencyGroupsPayload = [Components.Schemas.ConcurrencyGroupRunList.ConcurrencyGroupsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/concurrency-group-run-list/concurrency_groups`. + public var concurrencyGroups: Components.Schemas.ConcurrencyGroupRunList.ConcurrencyGroupsPayload + /// Creates a new `ConcurrencyGroupRunList`. + /// + /// - Parameters: + /// - totalCount: The total number of concurrency groups this workflow run participates in, + /// - concurrencyGroups: + public init( + totalCount: Swift.Int, + concurrencyGroups: Components.Schemas.ConcurrencyGroupRunList.ConcurrencyGroupsPayload + ) { + self.totalCount = totalCount + self.concurrencyGroups = concurrencyGroups + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case concurrencyGroups = "concurrency_groups" + } + } /// - Remark: Generated from `#/components/schemas/review-custom-gates-comment-required`. public struct ReviewCustomGatesCommentRequired: Codable, Hashable, Sendable { /// The name of the environment to approve or reject. @@ -12178,6 +12688,14 @@ 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`. @@ -12285,6 +12803,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/cache-id`. public typealias CacheId = Swift.Int + /// The name of the concurrency group. + /// + /// - Remark: Generated from `#/components/parameters/concurrency-group-name`. + public typealias ConcurrencyGroupName = Swift.String /// The unique identifier of the job. /// /// - Remark: Generated from `#/components/parameters/job-id`. @@ -29697,98 +30219,548 @@ public enum Operations { } } } - /// 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 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/{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/{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/{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, - cacheId: Components.Parameters.CacheId - ) { - self.owner = owner - self.repo = repo - self.cacheId = cacheId - } - } - 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 - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } + /// 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 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/{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/{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/{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, + cacheId: Components.Parameters.CacheId + ) { + self.owner = owner + self.repo = repo + self.cacheId = cacheId + } + } + 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 + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// List concurrency groups for a repository + /// + /// Lists the active concurrency groups for a repository. + /// + /// 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/concurrency_groups`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/concurrency_groups/get(actions/list-concurrency-groups-for-repository)`. + public enum ActionsListConcurrencyGroupsForRepository { + public static let id: Swift.String = "actions/list-concurrency-groups-for-repository" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/concurrency_groups/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/concurrency_groups/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/concurrency_groups/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.ActionsListConcurrencyGroupsForRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/concurrency_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/repos/{owner}/{repo}/actions/concurrency_groups/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 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/repos/{owner}/{repo}/actions/concurrency_groups/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)." + /// - 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, + after: Components.Parameters.PaginationAfter? = nil + ) { + self.perPage = perPage + self.after = after + } + } + public var query: Operations.ActionsListConcurrencyGroupsForRepository.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/concurrency_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()) { + self.accept = accept + } + } + public var headers: Operations.ActionsListConcurrencyGroupsForRepository.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ActionsListConcurrencyGroupsForRepository.Input.Path, + query: Operations.ActionsListConcurrencyGroupsForRepository.Input.Query = .init(), + headers: Operations.ActionsListConcurrencyGroupsForRepository.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/concurrency_groups/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/concurrency_groups/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.ActionsListConcurrencyGroupsForRepository.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/concurrency_groups/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/concurrency_groups/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ConcurrencyGroupList) + /// 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.ConcurrencyGroupList { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListConcurrencyGroupsForRepository.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ActionsListConcurrencyGroupsForRepository.Output.Ok.Headers = .init(), + body: Operations.ActionsListConcurrencyGroupsForRepository.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/concurrency_groups/get(actions/list-concurrency-groups-for-repository)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListConcurrencyGroupsForRepository.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.ActionsListConcurrencyGroupsForRepository.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//repos/{owner}/{repo}/actions/concurrency_groups/get(actions/list-concurrency-groups-for-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 a concurrency group for a repository + /// + /// Gets a specific concurrency group for a repository, including all instances in the group's queue. + /// Returns 404 if the group is inactive or does not exist. + /// + /// Optionally, pass `ahead_of_run` or `ahead_of_job` to filter the results to only the items + /// ahead of the specified workflow run or job in the queue, plus the specified item itself + /// (returned as the last element). This is useful for determining what is blocking a particular + /// run or job. Returns 422 if the specified run or job is not in this concurrency group. + /// + /// When using `ahead_of_run`, this matches workflow-level concurrency and any reusable-workflow + /// leases held on behalf of that run. Job-level leases within the run are not considered to + /// block the run as a whole. Use `ahead_of_job` to match job-level concurrency and reusable-workflow + /// leases on the job's ancestor paths. + /// + /// 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/concurrency_groups/{concurrency_group_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/concurrency_groups/{concurrency_group_name}/get(actions/get-concurrency-group-for-repository)`. + public enum ActionsGetConcurrencyGroupForRepository { + public static let id: Swift.String = "actions/get-concurrency-group-for-repository" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/concurrency_groups/{concurrency_group_name}/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/concurrency_groups/{concurrency_group_name}/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/concurrency_groups/{concurrency_group_name}/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The name of the concurrency group. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/concurrency_groups/{concurrency_group_name}/GET/path/concurrency_group_name`. + public var concurrencyGroupName: Components.Parameters.ConcurrencyGroupName + /// 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. + /// - concurrencyGroupName: The name of the concurrency group. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + concurrencyGroupName: Components.Parameters.ConcurrencyGroupName + ) { + self.owner = owner + self.repo = repo + self.concurrencyGroupName = concurrencyGroupName + } + } + public var path: Operations.ActionsGetConcurrencyGroupForRepository.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/concurrency_groups/{concurrency_group_name}/GET/query`. + public struct Query: Sendable, Hashable { + /// Filter to items ahead of this workflow run ID in the queue, plus the run itself. + /// Matches workflow-level concurrency and reusable-workflow leases held on behalf of + /// the run. Mutually exclusive with `ahead_of_job`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/concurrency_groups/{concurrency_group_name}/GET/query/ahead_of_run`. + public var aheadOfRun: Swift.Int? + /// Filter to items ahead of this job ID in the queue, plus the job itself. + /// Matches job-level concurrency and reusable-workflow leases on the job's + /// ancestor paths. Mutually exclusive with `ahead_of_run`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/concurrency_groups/{concurrency_group_name}/GET/query/ahead_of_job`. + public var aheadOfJob: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - aheadOfRun: Filter to items ahead of this workflow run ID in the queue, plus the run itself. + /// - aheadOfJob: Filter to items ahead of this job ID in the queue, plus the job itself. + public init( + aheadOfRun: Swift.Int? = nil, + aheadOfJob: Swift.Int? = nil + ) { + self.aheadOfRun = aheadOfRun + self.aheadOfJob = aheadOfJob + } + } + public var query: Operations.ActionsGetConcurrencyGroupForRepository.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/concurrency_groups/{concurrency_group_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.ActionsGetConcurrencyGroupForRepository.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ActionsGetConcurrencyGroupForRepository.Input.Path, + query: Operations.ActionsGetConcurrencyGroupForRepository.Input.Query = .init(), + headers: Operations.ActionsGetConcurrencyGroupForRepository.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/concurrency_groups/{concurrency_group_name}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/concurrency_groups/{concurrency_group_name}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ConcurrencyGroup) + /// 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.ConcurrencyGroup { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsGetConcurrencyGroupForRepository.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ActionsGetConcurrencyGroupForRepository.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/concurrency_groups/{concurrency_group_name}/get(actions/get-concurrency-group-for-repository)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsGetConcurrencyGroupForRepository.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.ActionsGetConcurrencyGroupForRepository.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/concurrency_groups/{concurrency_group_name}/get(actions/get-concurrency-group-for-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/concurrency_groups/{concurrency_group_name}/get(actions/get-concurrency-group-for-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 a job for a workflow run /// /// Gets a specific job in a workflow run. @@ -30109,15 +31081,25 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody/json/enable_debug_logging`. public var enableDebugLogging: Swift.Bool? + /// Whether to enable the debugger for the re-run of this job. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody/json/enable_debugger`. + public var enableDebugger: Swift.Bool? /// Creates a new `JsonPayload`. /// /// - Parameters: /// - enableDebugLogging: Whether to enable debug logging for the re-run. - public init(enableDebugLogging: Swift.Bool? = nil) { + /// - enableDebugger: Whether to enable the debugger for the re-run of this job. + public init( + enableDebugLogging: Swift.Bool? = nil, + enableDebugger: Swift.Bool? = nil + ) { self.enableDebugLogging = enableDebugLogging + self.enableDebugger = enableDebugger } public enum CodingKeys: String, CodingKey { case enableDebugLogging = "enable_debug_logging" + case enableDebugger = "enable_debugger" } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun/POST/requestBody/content/application\/json`. @@ -37169,6 +38151,271 @@ public enum Operations { } } } + /// List concurrency groups for a workflow run + /// + /// Lists all concurrency groups associated with a workflow run or its jobs. + /// + /// The set of groups is derived from the run's configuration, so a group is + /// included even when the run no longer has any items currently holding or + /// waiting in it. In that case the `group_members` array will be empty. + /// `total_count` reflects the number of groups the run participates in by + /// configuration, not the number with active items. + /// + /// This differs from `GET /repos/{owner}/{repo}/actions/concurrency_groups/{group_name}`, + /// which returns 404 when a group has no active items. That endpoint reports + /// the live state of a group repo-wide, while this endpoint reports the + /// groups associated with a specific run by configuration. + /// + /// Results are sorted by group name and support cursor-based pagination via + /// `before` and `after`. The `after` cursor paginates forward only and does + /// not emit a `rel="prev"` Link; use `before` to page backward from a + /// forward page's `next` cursor. + /// + /// 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/runs/{run_id}/concurrency_groups`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/runs/{run_id}/concurrency_groups/get(actions/list-concurrency-groups-for-workflow-run)`. + public enum ActionsListConcurrencyGroupsForWorkflowRun { + public static let id: Swift.String = "actions/list-concurrency-groups-for-workflow-run" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/runs/{run_id}/concurrency_groups/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/runs/{run_id}/concurrency_groups/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/runs/{run_id}/concurrency_groups/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the workflow run. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/runs/{run_id}/concurrency_groups/GET/path/run_id`. + public var runId: Components.Parameters.RunId + /// 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. + /// - runId: The unique identifier of the workflow run. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + runId: Components.Parameters.RunId + ) { + self.owner = owner + self.repo = repo + self.runId = runId + } + } + public var path: Operations.ActionsListConcurrencyGroupsForWorkflowRun.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/runs/{run_id}/concurrency_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/repos/{owner}/{repo}/actions/runs/{run_id}/concurrency_groups/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/repos/{owner}/{repo}/actions/runs/{run_id}/concurrency_groups/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/repos/{owner}/{repo}/actions/runs/{run_id}/concurrency_groups/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.ActionsListConcurrencyGroupsForWorkflowRun.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/runs/{run_id}/concurrency_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()) { + self.accept = accept + } + } + public var headers: Operations.ActionsListConcurrencyGroupsForWorkflowRun.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ActionsListConcurrencyGroupsForWorkflowRun.Input.Path, + query: Operations.ActionsListConcurrencyGroupsForWorkflowRun.Input.Query = .init(), + headers: Operations.ActionsListConcurrencyGroupsForWorkflowRun.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/runs/{run_id}/concurrency_groups/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/runs/{run_id}/concurrency_groups/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.ActionsListConcurrencyGroupsForWorkflowRun.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/runs/{run_id}/concurrency_groups/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/actions/runs/{run_id}/concurrency_groups/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ConcurrencyGroupRunList) + /// 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.ConcurrencyGroupRunList { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ActionsListConcurrencyGroupsForWorkflowRun.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.ActionsListConcurrencyGroupsForWorkflowRun.Output.Ok.Headers = .init(), + body: Operations.ActionsListConcurrencyGroupsForWorkflowRun.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/actions/runs/{run_id}/concurrency_groups/get(actions/list-concurrency-groups-for-workflow-run)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ActionsListConcurrencyGroupsForWorkflowRun.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.ActionsListConcurrencyGroupsForWorkflowRun.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/runs/{run_id}/concurrency_groups/get(actions/list-concurrency-groups-for-workflow-run)/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/runs/{run_id}/concurrency_groups/get(actions/list-concurrency-groups-for-workflow-run)/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 + ] + } + } + } /// Review custom deployment protection rules for a workflow run /// /// Approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)." diff --git a/Sources/agent-tasks/Client.swift b/Sources/agent-tasks/Client.swift index 87202523ac7..332c6212d13 100644 --- a/Sources/agent-tasks/Client.swift +++ b/Sources/agent-tasks/Client.swift @@ -38,4 +38,1049 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } + /// List tasks for repository + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for a specific repository + /// + /// **Fine-grained access tokens for "List tasks for repository"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)`. + public func agentTasksListTasksForRepo(_ input: Operations.AgentTasksListTasksForRepo.Input) async throws -> Operations.AgentTasksListTasksForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.AgentTasksListTasksForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/agents/repos/{}/{}/tasks", + 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: "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: "state", + value: input.query.state + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "is_archived", + value: input.query.isArchived + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "since", + value: input.query.since + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "creator_id", + value: input.query.creatorId + ) + 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.AgentTasksListTasksForRepo.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Swift.String.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasksForRepo.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasksForRepo.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 + )) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(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: Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body.JsonPayload.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: Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasksForRepo.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 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasksForRepo.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasksForRepo.Output.NotFound.Body.JsonPayload.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: Operations.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasksForRepo.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 + ) + ) + } + } + ) + } + /// Start a task + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Starts a new Copilot cloud agent task for a repository. + /// + /// This endpoint is only available to users with a Copilot Business or Copilot Enterprise subscription. + /// + /// **Fine-grained access tokens for "Start a task"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read and write) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `POST /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task-in-repo)`. + public func agentTasksCreateTaskInRepo(_ input: Operations.AgentTasksCreateTaskInRepo.Input) async throws -> Operations.AgentTasksCreateTaskInRepo.Output { + try await client.send( + input: input, + forOperation: Operations.AgentTasksCreateTaskInRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/agents/repos/{}/{}/tasks", + 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.AgentTasksCreateTaskInRepo.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksCreateTaskInRepo.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 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksCreateTaskInRepo.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksCreateTaskInRepo.Output.BadRequest.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(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: Operations.AgentTasksCreateTaskInRepo.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksCreateTaskInRepo.Output.Unauthorized.Body.JsonPayload.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: Operations.AgentTasksCreateTaskInRepo.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksCreateTaskInRepo.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 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksCreateTaskInRepo.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksCreateTaskInRepo.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 + ) + ) + } + } + ) + } + /// Get a task by repo + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID scoped to an owner/repo path + /// + /// **Fine-grained access tokens for "Get a task by repo"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)`. + public func agentTasksGetTaskByRepoAndId(_ input: Operations.AgentTasksGetTaskByRepoAndId.Input) async throws -> Operations.AgentTasksGetTaskByRepoAndId.Output { + try await client.send( + input: input, + forOperation: Operations.AgentTasksGetTaskByRepoAndId.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/agents/repos/{}/{}/tasks/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.taskId + ] + ) + 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.AgentTasksGetTaskByRepoAndId.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskByRepoAndId.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 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(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: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body.JsonPayload.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: Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskByRepoAndId.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 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body.JsonPayload.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: Operations.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskByRepoAndId.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 tasks + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for the authenticated user + /// + /// **Fine-grained access tokens for "List tasks"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/tasks`. + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)`. + public func agentTasksListTasks(_ input: Operations.AgentTasksListTasks.Input) async throws -> Operations.AgentTasksListTasks.Output { + try await client.send( + input: input, + forOperation: Operations.AgentTasksListTasks.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/agents/tasks", + parameters: [] + ) + 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: "state", + value: input.query.state + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "is_archived", + value: input.query.isArchived + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "since", + value: input.query.since + ) + 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.AgentTasksListTasks.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Swift.String.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasks.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasks.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 + )) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasks.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasks.Output.BadRequest.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(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: Operations.AgentTasksListTasks.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasks.Output.Unauthorized.Body.JsonPayload.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: Operations.AgentTasksListTasks.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasks.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 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasks.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasks.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 + ) + ) + } + } + ) + } + /// Get a task by ID + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID with its associated sessions + /// + /// **Fine-grained access tokens for "Get a task by ID"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)`. + public func agentTasksGetTaskById(_ input: Operations.AgentTasksGetTaskById.Input) async throws -> Operations.AgentTasksGetTaskById.Output { + try await client.send( + input: input, + forOperation: Operations.AgentTasksGetTaskById.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/agents/tasks/{}", + parameters: [ + input.path.taskId + ] + ) + 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.AgentTasksGetTaskById.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskById.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 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksGetTaskById.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskById.Output.BadRequest.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(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: Operations.AgentTasksGetTaskById.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskById.Output.Unauthorized.Body.JsonPayload.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: Operations.AgentTasksGetTaskById.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskById.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 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksGetTaskById.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskById.Output.NotFound.Body.JsonPayload.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: Operations.AgentTasksGetTaskById.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskById.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 + ) + ) + } + } + ) + } } diff --git a/Sources/agent-tasks/Types.swift b/Sources/agent-tasks/Types.swift index c3d1209ecf5..18bb50b8cb2 100644 --- a/Sources/agent-tasks/Types.swift +++ b/Sources/agent-tasks/Types.swift @@ -10,10 +10,299 @@ 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 tasks for repository + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for a specific repository + /// + /// **Fine-grained access tokens for "List tasks for repository"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)`. + func agentTasksListTasksForRepo(_ input: Operations.AgentTasksListTasksForRepo.Input) async throws -> Operations.AgentTasksListTasksForRepo.Output + /// Start a task + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Starts a new Copilot cloud agent task for a repository. + /// + /// This endpoint is only available to users with a Copilot Business or Copilot Enterprise subscription. + /// + /// **Fine-grained access tokens for "Start a task"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read and write) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `POST /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task-in-repo)`. + func agentTasksCreateTaskInRepo(_ input: Operations.AgentTasksCreateTaskInRepo.Input) async throws -> Operations.AgentTasksCreateTaskInRepo.Output + /// Get a task by repo + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID scoped to an owner/repo path + /// + /// **Fine-grained access tokens for "Get a task by repo"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)`. + func agentTasksGetTaskByRepoAndId(_ input: Operations.AgentTasksGetTaskByRepoAndId.Input) async throws -> Operations.AgentTasksGetTaskByRepoAndId.Output + /// List tasks + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for the authenticated user + /// + /// **Fine-grained access tokens for "List tasks"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/tasks`. + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)`. + func agentTasksListTasks(_ input: Operations.AgentTasksListTasks.Input) async throws -> Operations.AgentTasksListTasks.Output + /// Get a task by ID + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID with its associated sessions + /// + /// **Fine-grained access tokens for "Get a task by ID"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)`. + func agentTasksGetTaskById(_ input: Operations.AgentTasksGetTaskById.Input) async throws -> Operations.AgentTasksGetTaskById.Output +} /// Convenience overloads for operation inputs. extension APIProtocol { + /// List tasks for repository + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for a specific repository + /// + /// **Fine-grained access tokens for "List tasks for repository"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)`. + public func agentTasksListTasksForRepo( + path: Operations.AgentTasksListTasksForRepo.Input.Path, + query: Operations.AgentTasksListTasksForRepo.Input.Query = .init(), + headers: Operations.AgentTasksListTasksForRepo.Input.Headers = .init() + ) async throws -> Operations.AgentTasksListTasksForRepo.Output { + try await agentTasksListTasksForRepo(Operations.AgentTasksListTasksForRepo.Input( + path: path, + query: query, + headers: headers + )) + } + /// Start a task + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Starts a new Copilot cloud agent task for a repository. + /// + /// This endpoint is only available to users with a Copilot Business or Copilot Enterprise subscription. + /// + /// **Fine-grained access tokens for "Start a task"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read and write) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `POST /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task-in-repo)`. + public func agentTasksCreateTaskInRepo( + path: Operations.AgentTasksCreateTaskInRepo.Input.Path, + headers: Operations.AgentTasksCreateTaskInRepo.Input.Headers = .init(), + body: Operations.AgentTasksCreateTaskInRepo.Input.Body + ) async throws -> Operations.AgentTasksCreateTaskInRepo.Output { + try await agentTasksCreateTaskInRepo(Operations.AgentTasksCreateTaskInRepo.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get a task by repo + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID scoped to an owner/repo path + /// + /// **Fine-grained access tokens for "Get a task by repo"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)`. + public func agentTasksGetTaskByRepoAndId( + path: Operations.AgentTasksGetTaskByRepoAndId.Input.Path, + headers: Operations.AgentTasksGetTaskByRepoAndId.Input.Headers = .init() + ) async throws -> Operations.AgentTasksGetTaskByRepoAndId.Output { + try await agentTasksGetTaskByRepoAndId(Operations.AgentTasksGetTaskByRepoAndId.Input( + path: path, + headers: headers + )) + } + /// List tasks + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for the authenticated user + /// + /// **Fine-grained access tokens for "List tasks"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/tasks`. + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)`. + public func agentTasksListTasks( + query: Operations.AgentTasksListTasks.Input.Query = .init(), + headers: Operations.AgentTasksListTasks.Input.Headers = .init() + ) async throws -> Operations.AgentTasksListTasks.Output { + try await agentTasksListTasks(Operations.AgentTasksListTasks.Input( + query: query, + headers: headers + )) + } + /// Get a task by ID + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID with its associated sessions + /// + /// **Fine-grained access tokens for "Get a task by ID"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)`. + public func agentTasksGetTaskById( + path: Operations.AgentTasksGetTaskById.Input.Path, + headers: Operations.AgentTasksGetTaskById.Input.Headers = .init() + ) async throws -> Operations.AgentTasksGetTaskById.Output { + try await agentTasksGetTaskById(Operations.AgentTasksGetTaskById.Input( + path: path, + headers: headers + )) + } } /// Server URLs defined in the OpenAPI document. @@ -50,4 +339,6821 @@ public enum Components { } /// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations {} +public enum Operations { + /// List tasks for repository + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for a specific repository + /// + /// **Fine-grained access tokens for "List tasks for repository"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)`. + public enum AgentTasksListTasksForRepo { + public static let id: Swift.String = "agent-tasks/list-tasks-for-repo" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/path/owner`. + public var owner: Swift.String + /// The name of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/path/repo`. + public var repo: 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. The name is not case sensitive. + public init( + owner: Swift.String, + repo: Swift.String + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.AgentTasksListTasksForRepo.Input.Path + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/per_page`. + public var perPage: Swift.Int? + /// The page number of the results to fetch. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/page`. + public var page: Swift.Int? + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/sort`. + @frozen public enum SortPayload: String, Codable, Hashable, Sendable, CaseIterable { + case updatedAt = "updated_at" + case createdAt = "created_at" + } + /// The field to sort results by. Can be `updated_at` or `created_at`. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/sort`. + public var sort: Operations.AgentTasksListTasksForRepo.Input.Query.SortPayload? + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/direction`. + @frozen public enum DirectionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort results. Can be `asc` or `desc`. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/direction`. + public var direction: Operations.AgentTasksListTasksForRepo.Input.Query.DirectionPayload? + /// Comma-separated list of task states to filter by. Can be any combination of: `queued`, `in_progress`, `completed`, `failed`, `idle`, `waiting_for_user`, `timed_out`, `cancelled`. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/state`. + public var state: Swift.String? + /// Filter by archived status. When `true`, returns only archived tasks. When `false` or omitted, returns only non-archived tasks. Defaults to `false`. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/is_archived`. + public var isArchived: Swift.Bool? + /// Only show tasks updated at or after this time (ISO 8601 timestamp) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/since`. + public var since: Foundation.Date? + /// Filter tasks by creator user ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/creator_id`. + public var creatorId: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). + /// - page: The page number of the results to fetch. + /// - sort: The field to sort results by. Can be `updated_at` or `created_at`. + /// - direction: The direction to sort results. Can be `asc` or `desc`. + /// - state: Comma-separated list of task states to filter by. Can be any combination of: `queued`, `in_progress`, `completed`, `failed`, `idle`, `waiting_for_user`, `timed_out`, `cancelled`. + /// - isArchived: Filter by archived status. When `true`, returns only archived tasks. When `false` or omitted, returns only non-archived tasks. Defaults to `false`. + /// - since: Only show tasks updated at or after this time (ISO 8601 timestamp) + /// - creatorId: Filter tasks by creator user ID + public init( + perPage: Swift.Int? = nil, + page: Swift.Int? = nil, + sort: Operations.AgentTasksListTasksForRepo.Input.Query.SortPayload? = nil, + direction: Operations.AgentTasksListTasksForRepo.Input.Query.DirectionPayload? = nil, + state: Swift.String? = nil, + isArchived: Swift.Bool? = nil, + since: Foundation.Date? = nil, + creatorId: Swift.Int? = nil + ) { + self.perPage = perPage + self.page = page + self.sort = sort + self.direction = direction + self.state = state + self.isArchived = isArchived + self.since = since + self.creatorId = creatorId + } + } + public var query: Operations.AgentTasksListTasksForRepo.Input.Query + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/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.AgentTasksListTasksForRepo.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.AgentTasksListTasksForRepo.Input.Path, + query: Operations.AgentTasksListTasksForRepo.Input.Query = .init(), + headers: Operations.AgentTasksListTasksForRepo.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/agents/repos/{owner}/{repo}/tasks/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// Pagination links. Contains rel="first" (always), + /// rel="prev" (when current page > 1), + /// rel="next" (when more pages exist), and rel="last" (when on the final page). + /// + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/headers/Link`. + public var link: Swift.String? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: Pagination links. Contains rel="first" (always), + public init(link: Swift.String? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.AgentTasksListTasksForRepo.Output.Ok.Headers + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload`. + public struct TasksPayloadPayload: Codable, Hashable, Sendable { + /// Unique task identifier + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/id`. + public var id: Swift.String + /// API URL for this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/url`. + public var url: Swift.String? + /// Web URL for this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/html_url`. + public var htmlUrl: Swift.String? + /// Human-readable name derived from the task prompt + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/name`. + public var name: Swift.String? + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/creator`. + @frozen public enum CreatorPayload: Codable, Hashable, Sendable { + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/creator/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/creator/case1/id`. + public var id: Swift.Int64? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/creator/case1`. + case case1(Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorPayload.Case1Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(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 Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + } + } + } + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/creator`. + public var creator: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorPayload? + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/creator_type`. + @frozen public enum CreatorTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case user = "user" + case organization = "organization" + } + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/creator_type`. + public var creatorType: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorTypePayload? + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/UserCollaboratorsPayload`. + public struct UserCollaboratorsPayloadPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/UserCollaboratorsPayload/id`. + public var id: Swift.Int64? + /// Creates a new `UserCollaboratorsPayloadPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/user_collaborators`. + public typealias UserCollaboratorsPayload = [Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.UserCollaboratorsPayloadPayload] + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/user_collaborators`. + @available(*, deprecated) + public var userCollaborators: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.UserCollaboratorsPayload? + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/owner`. + public struct OwnerPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/owner/id`. + public var id: Swift.Int64? + /// Creates a new `OwnerPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/owner`. + public var owner: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.OwnerPayload? + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/repository`. + public struct RepositoryPayload: Codable, Hashable, Sendable { + /// The unique identifier of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/repository/id`. + public var id: Swift.Int64? + /// Creates a new `RepositoryPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the repository + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/repository`. + public var repository: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.RepositoryPayload? + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case queued = "queued" + case inProgress = "in_progress" + case completed = "completed" + case failed = "failed" + case idle = "idle" + case waitingForUser = "waiting_for_user" + case timedOut = "timed_out" + case cancelled = "cancelled" + } + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/state`. + public var state: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.StatePayload + /// Number of sessions in this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/session_count`. + public var sessionCount: Swift.Int32? + /// A resource generated by the task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload`. + public struct ArtifactsPayloadPayload: Codable, Hashable, Sendable { + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/provider`. + @frozen public enum ProviderPayload: String, Codable, Hashable, Sendable, CaseIterable { + case github = "github" + } + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/provider`. + public var provider: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.ProviderPayload + /// Type of artifact. Available Values: `pull`, `branch`. + /// + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case pull = "pull" + case branch = "branch" + } + /// Type of artifact. Available Values: `pull`, `branch`. + /// + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/type`. + public var _type: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload._TypePayload + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data`. + @frozen public enum DataPayload: Codable, Hashable, Sendable { + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// GitHub resource ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1/id`. + public var id: Swift.Int64 + /// GraphQL global ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1/global_id`. + public var globalId: Swift.String? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: GitHub resource ID + /// - globalId: GraphQL global ID + public init( + id: Swift.Int64, + globalId: Swift.String? = nil + ) { + self.id = id + self.globalId = globalId + } + public enum CodingKeys: String, CodingKey { + case id + case globalId = "global_id" + } + } + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1`. + case case1(Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload.Case1Payload) + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// Head branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2/head_ref`. + public var headRef: Swift.String + /// Base branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2/base_ref`. + public var baseRef: Swift.String + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - headRef: Head branch name + /// - baseRef: Base branch name + public init( + headRef: Swift.String, + baseRef: Swift.String + ) { + self.headRef = headRef + self.baseRef = baseRef + } + public enum CodingKeys: String, CodingKey { + case headRef = "head_ref" + case baseRef = "base_ref" + } + } + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2`. + case case2(Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload.Case2Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.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 Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data`. + public var data: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload + /// Creates a new `ArtifactsPayloadPayload`. + /// + /// - Parameters: + /// - provider: Provider namespace + /// - _type: Type of artifact. Available Values: `pull`, `branch`. + /// - data: Resource data (shape depends on type) + public init( + provider: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.ProviderPayload, + _type: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload._TypePayload, + data: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload + ) { + self.provider = provider + self._type = _type + self.data = data + } + public enum CodingKeys: String, CodingKey { + case provider + case _type = "type" + case data + } + } + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/artifacts`. + public typealias ArtifactsPayload = [Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload] + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/artifacts`. + public var artifacts: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayload? + /// Timestamp when the task was archived, null if not archived + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/archived_at`. + public var archivedAt: Foundation.Date? + /// Timestamp of the most recent update + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/updated_at`. + public var updatedAt: Foundation.Date? + /// Timestamp when the task was created + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/created_at`. + public var createdAt: Foundation.Date + /// Creates a new `TasksPayloadPayload`. + /// + /// - Parameters: + /// - id: Unique task identifier + /// - url: API URL for this task + /// - htmlUrl: Web URL for this task + /// - name: Human-readable name derived from the task prompt + /// - creator: The entity who created this task + /// - creatorType: Type of the task creator + /// - userCollaborators: User objects of collaborators on this task + /// - owner: The owner of the repository + /// - repository: The repository this task belongs to + /// - state: Current state of the task, derived from its most recent session + /// - sessionCount: Number of sessions in this task + /// - artifacts: Resources created by this task (PRs, branches, etc.) + /// - archivedAt: Timestamp when the task was archived, null if not archived + /// - updatedAt: Timestamp of the most recent update + /// - createdAt: Timestamp when the task was created + public init( + id: Swift.String, + url: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + name: Swift.String? = nil, + creator: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorPayload? = nil, + creatorType: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorTypePayload? = nil, + userCollaborators: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.UserCollaboratorsPayload? = nil, + owner: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.OwnerPayload? = nil, + repository: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.RepositoryPayload? = nil, + state: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.StatePayload, + sessionCount: Swift.Int32? = nil, + artifacts: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayload? = nil, + archivedAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + createdAt: Foundation.Date + ) { + self.id = id + self.url = url + self.htmlUrl = htmlUrl + self.name = name + self.creator = creator + self.creatorType = creatorType + self.userCollaborators = userCollaborators + self.owner = owner + self.repository = repository + self.state = state + self.sessionCount = sessionCount + self.artifacts = artifacts + self.archivedAt = archivedAt + self.updatedAt = updatedAt + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey { + case id + case url + case htmlUrl = "html_url" + case name + case creator + case creatorType = "creator_type" + case userCollaborators = "user_collaborators" + case owner + case repository + case state + case sessionCount = "session_count" + case artifacts + case archivedAt = "archived_at" + case updatedAt = "updated_at" + case createdAt = "created_at" + } + } + /// List of tasks + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/tasks`. + public typealias TasksPayload = [Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload] + /// List of tasks + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/tasks`. + public var tasks: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayload + /// Total count of active (non-archived) tasks + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/total_active_count`. + public var totalActiveCount: Swift.Int32? + /// Total count of archived tasks + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/total_archived_count`. + public var totalArchivedCount: Swift.Int32? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - tasks: List of tasks + /// - totalActiveCount: Total count of active (non-archived) tasks + /// - totalArchivedCount: Total count of archived tasks + public init( + tasks: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayload, + totalActiveCount: Swift.Int32? = nil, + totalArchivedCount: Swift.Int32? = nil + ) { + self.tasks = tasks + self.totalActiveCount = totalActiveCount + self.totalArchivedCount = totalArchivedCount + } + public enum CodingKeys: String, CodingKey { + case tasks + case totalActiveCount = "total_active_count" + case totalArchivedCount = "total_archived_count" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/application\/json`. + case json(Operations.AgentTasksListTasksForRepo.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.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasksForRepo.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.AgentTasksListTasksForRepo.Output.Ok.Headers = .init(), + body: Operations.AgentTasksListTasksForRepo.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Tasks retrieved successfully + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentTasksListTasksForRepo.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.AgentTasksListTasksForRepo.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/errors`. + public var errors: Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/application\/json`. + case json(Operations.AgentTasksListTasksForRepo.Output.BadRequest.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.AgentTasksListTasksForRepo.Output.BadRequest.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body) { + self.body = body + } + } + /// Bad request + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.AgentTasksListTasksForRepo.Output.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: Operations.AgentTasksListTasksForRepo.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/errors`. + public var errors: Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/application\/json`. + case json(Operations.AgentTasksListTasksForRepo.Output.Unauthorized.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.AgentTasksListTasksForRepo.Output.Unauthorized.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body) { + self.body = body + } + } + /// Authentication required + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.AgentTasksListTasksForRepo.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.AgentTasksListTasksForRepo.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/errors`. + public var errors: Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/application\/json`. + case json(Operations.AgentTasksListTasksForRepo.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.AgentTasksListTasksForRepo.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body) { + self.body = body + } + } + /// Insufficient permissions + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.AgentTasksListTasksForRepo.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.AgentTasksListTasksForRepo.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasksForRepo.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasksForRepo.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasksForRepo.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/errors`. + public var errors: Operations.AgentTasksListTasksForRepo.Output.NotFound.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasksForRepo.Output.NotFound.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/application\/json`. + case json(Operations.AgentTasksListTasksForRepo.Output.NotFound.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.AgentTasksListTasksForRepo.Output.NotFound.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasksForRepo.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasksForRepo.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.AgentTasksListTasksForRepo.Output.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.AgentTasksListTasksForRepo.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/errors`. + public var errors: Operations.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/application\/json`. + case json(Operations.AgentTasksListTasksForRepo.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.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation Failed + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.AgentTasksListTasksForRepo.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.AgentTasksListTasksForRepo.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) + } + @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 + ] + } + } + } + /// Start a task + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Starts a new Copilot cloud agent task for a repository. + /// + /// This endpoint is only available to users with a Copilot Business or Copilot Enterprise subscription. + /// + /// **Fine-grained access tokens for "Start a task"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read and write) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `POST /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task-in-repo)`. + public enum AgentTasksCreateTaskInRepo { + public static let id: Swift.String = "agent-tasks/create-task-in-repo" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/path/owner`. + public var owner: Swift.String + /// The name of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/path/repo`. + public var repo: 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. The name is not case sensitive. + public init( + owner: Swift.String, + repo: Swift.String + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.AgentTasksCreateTaskInRepo.Input.Path + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/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.AgentTasksCreateTaskInRepo.Input.Headers + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The user's prompt for the agent + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/json/prompt`. + public var prompt: Swift.String + /// The model to use for this task. The allowed models may change over time and depend on the user's GitHub Copilot plan and organization policies. Currently supported values: `claude-sonnet-4.6`, `claude-opus-4.6`, `gpt-5.2-codex`, `gpt-5.3-codex`, `gpt-5.4`, `claude-sonnet-4.5`, `claude-opus-4.5` + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/json/model`. + public var model: Swift.String? + /// Whether to create a PR. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/json/create_pull_request`. + public var createPullRequest: Swift.Bool? + /// Base ref for new branch/PR + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/json/base_ref`. + public var baseRef: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - prompt: The user's prompt for the agent + /// - model: The model to use for this task. The allowed models may change over time and depend on the user's GitHub Copilot plan and organization policies. Currently supported values: `claude-sonnet-4.6`, `claude-opus-4.6`, `gpt-5.2-codex`, `gpt-5.3-codex`, `gpt-5.4`, `claude-sonnet-4.5`, `claude-opus-4.5` + /// - createPullRequest: Whether to create a PR. + /// - baseRef: Base ref for new branch/PR + public init( + prompt: Swift.String, + model: Swift.String? = nil, + createPullRequest: Swift.Bool? = nil, + baseRef: Swift.String? = nil + ) { + self.prompt = prompt + self.model = model + self.createPullRequest = createPullRequest + self.baseRef = baseRef + } + public enum CodingKeys: String, CodingKey { + case prompt + case model + case createPullRequest = "create_pull_request" + case baseRef = "base_ref" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/content/application\/json`. + case json(Operations.AgentTasksCreateTaskInRepo.Input.Body.JsonPayload) + } + public var body: Operations.AgentTasksCreateTaskInRepo.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.AgentTasksCreateTaskInRepo.Input.Path, + headers: Operations.AgentTasksCreateTaskInRepo.Input.Headers = .init(), + body: Operations.AgentTasksCreateTaskInRepo.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/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Unique task identifier + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/id`. + public var id: Swift.String + /// API URL for this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/url`. + public var url: Swift.String? + /// Web URL for this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/html_url`. + public var htmlUrl: Swift.String? + /// Human-readable name derived from the task prompt + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/name`. + public var name: Swift.String? + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/creator`. + @frozen public enum CreatorPayload: Codable, Hashable, Sendable { + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/creator/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/creator/case1/id`. + public var id: Swift.Int64? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/creator/case1`. + case case1(Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.CreatorPayload.Case1Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(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 Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + } + } + } + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/creator`. + public var creator: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.CreatorPayload? + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/creator_type`. + @frozen public enum CreatorTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case user = "user" + case organization = "organization" + } + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/creator_type`. + public var creatorType: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.CreatorTypePayload? + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/UserCollaboratorsPayload`. + public struct UserCollaboratorsPayloadPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/UserCollaboratorsPayload/id`. + public var id: Swift.Int64? + /// Creates a new `UserCollaboratorsPayloadPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/user_collaborators`. + public typealias UserCollaboratorsPayload = [Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.UserCollaboratorsPayloadPayload] + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/user_collaborators`. + @available(*, deprecated) + public var userCollaborators: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.UserCollaboratorsPayload? + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/owner`. + public struct OwnerPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/owner/id`. + public var id: Swift.Int64? + /// Creates a new `OwnerPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/owner`. + public var owner: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.OwnerPayload? + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/repository`. + public struct RepositoryPayload: Codable, Hashable, Sendable { + /// The unique identifier of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/repository/id`. + public var id: Swift.Int64? + /// Creates a new `RepositoryPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the repository + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/repository`. + public var repository: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.RepositoryPayload? + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case queued = "queued" + case inProgress = "in_progress" + case completed = "completed" + case failed = "failed" + case idle = "idle" + case waitingForUser = "waiting_for_user" + case timedOut = "timed_out" + case cancelled = "cancelled" + } + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/state`. + public var state: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.StatePayload + /// Number of sessions in this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/session_count`. + public var sessionCount: Swift.Int32? + /// A resource generated by the task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload`. + public struct ArtifactsPayloadPayload: Codable, Hashable, Sendable { + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/provider`. + @frozen public enum ProviderPayload: String, Codable, Hashable, Sendable, CaseIterable { + case github = "github" + } + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/provider`. + public var provider: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload.ProviderPayload + /// Type of artifact. Available Values: `pull`, `branch`. + /// + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case pull = "pull" + case branch = "branch" + } + /// Type of artifact. Available Values: `pull`, `branch`. + /// + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/type`. + public var _type: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload._TypePayload + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data`. + @frozen public enum DataPayload: Codable, Hashable, Sendable { + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// GitHub resource ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case1/id`. + public var id: Swift.Int64 + /// GraphQL global ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case1/global_id`. + public var globalId: Swift.String? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: GitHub resource ID + /// - globalId: GraphQL global ID + public init( + id: Swift.Int64, + globalId: Swift.String? = nil + ) { + self.id = id + self.globalId = globalId + } + public enum CodingKeys: String, CodingKey { + case id + case globalId = "global_id" + } + } + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case1`. + case case1(Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload.DataPayload.Case1Payload) + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// Head branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case2/head_ref`. + public var headRef: Swift.String + /// Base branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case2/base_ref`. + public var baseRef: Swift.String + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - headRef: Head branch name + /// - baseRef: Base branch name + public init( + headRef: Swift.String, + baseRef: Swift.String + ) { + self.headRef = headRef + self.baseRef = baseRef + } + public enum CodingKeys: String, CodingKey { + case headRef = "head_ref" + case baseRef = "base_ref" + } + } + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case2`. + case case2(Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload.DataPayload.Case2Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.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 Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data`. + public var data: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload.DataPayload + /// Creates a new `ArtifactsPayloadPayload`. + /// + /// - Parameters: + /// - provider: Provider namespace + /// - _type: Type of artifact. Available Values: `pull`, `branch`. + /// - data: Resource data (shape depends on type) + public init( + provider: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload.ProviderPayload, + _type: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload._TypePayload, + data: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload.DataPayload + ) { + self.provider = provider + self._type = _type + self.data = data + } + public enum CodingKeys: String, CodingKey { + case provider + case _type = "type" + case data + } + } + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/artifacts`. + public typealias ArtifactsPayload = [Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload] + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/artifacts`. + public var artifacts: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.ArtifactsPayload? + /// Timestamp when the task was archived, null if not archived + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/archived_at`. + public var archivedAt: Foundation.Date? + /// Timestamp of the most recent update + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/updated_at`. + public var updatedAt: Foundation.Date? + /// Timestamp when the task was created + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/created_at`. + public var createdAt: Foundation.Date + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - id: Unique task identifier + /// - url: API URL for this task + /// - htmlUrl: Web URL for this task + /// - name: Human-readable name derived from the task prompt + /// - creator: The entity who created this task + /// - creatorType: Type of the task creator + /// - userCollaborators: User objects of collaborators on this task + /// - owner: The owner of the repository + /// - repository: The repository this task belongs to + /// - state: Current state of the task, derived from its most recent session + /// - sessionCount: Number of sessions in this task + /// - artifacts: Resources created by this task (PRs, branches, etc.) + /// - archivedAt: Timestamp when the task was archived, null if not archived + /// - updatedAt: Timestamp of the most recent update + /// - createdAt: Timestamp when the task was created + public init( + id: Swift.String, + url: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + name: Swift.String? = nil, + creator: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.CreatorPayload? = nil, + creatorType: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.CreatorTypePayload? = nil, + userCollaborators: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.UserCollaboratorsPayload? = nil, + owner: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.OwnerPayload? = nil, + repository: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.RepositoryPayload? = nil, + state: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.StatePayload, + sessionCount: Swift.Int32? = nil, + artifacts: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.ArtifactsPayload? = nil, + archivedAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + createdAt: Foundation.Date + ) { + self.id = id + self.url = url + self.htmlUrl = htmlUrl + self.name = name + self.creator = creator + self.creatorType = creatorType + self.userCollaborators = userCollaborators + self.owner = owner + self.repository = repository + self.state = state + self.sessionCount = sessionCount + self.artifacts = artifacts + self.archivedAt = archivedAt + self.updatedAt = updatedAt + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey { + case id + case url + case htmlUrl = "html_url" + case name + case creator + case creatorType = "creator_type" + case userCollaborators = "user_collaborators" + case owner + case repository + case state + case sessionCount = "session_count" + case artifacts + case archivedAt = "archived_at" + case updatedAt = "updated_at" + case createdAt = "created_at" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/application\/json`. + case json(Operations.AgentTasksCreateTaskInRepo.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.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body) { + self.body = body + } + } + /// Task created successfully + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task-in-repo)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.AgentTasksCreateTaskInRepo.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.AgentTasksCreateTaskInRepo.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksCreateTaskInRepo.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksCreateTaskInRepo.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksCreateTaskInRepo.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/errors`. + public var errors: Operations.AgentTasksCreateTaskInRepo.Output.BadRequest.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksCreateTaskInRepo.Output.BadRequest.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/application\/json`. + case json(Operations.AgentTasksCreateTaskInRepo.Output.BadRequest.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.AgentTasksCreateTaskInRepo.Output.BadRequest.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksCreateTaskInRepo.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksCreateTaskInRepo.Output.BadRequest.Body) { + self.body = body + } + } + /// Problems parsing JSON + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task-in-repo)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.AgentTasksCreateTaskInRepo.Output.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: Operations.AgentTasksCreateTaskInRepo.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksCreateTaskInRepo.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksCreateTaskInRepo.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksCreateTaskInRepo.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/errors`. + public var errors: Operations.AgentTasksCreateTaskInRepo.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksCreateTaskInRepo.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/application\/json`. + case json(Operations.AgentTasksCreateTaskInRepo.Output.Unauthorized.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.AgentTasksCreateTaskInRepo.Output.Unauthorized.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksCreateTaskInRepo.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksCreateTaskInRepo.Output.Unauthorized.Body) { + self.body = body + } + } + /// Authentication required + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task-in-repo)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.AgentTasksCreateTaskInRepo.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.AgentTasksCreateTaskInRepo.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksCreateTaskInRepo.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksCreateTaskInRepo.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksCreateTaskInRepo.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/errors`. + public var errors: Operations.AgentTasksCreateTaskInRepo.Output.Forbidden.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksCreateTaskInRepo.Output.Forbidden.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/application\/json`. + case json(Operations.AgentTasksCreateTaskInRepo.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.AgentTasksCreateTaskInRepo.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksCreateTaskInRepo.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksCreateTaskInRepo.Output.Forbidden.Body) { + self.body = body + } + } + /// Insufficient permissions + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task-in-repo)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.AgentTasksCreateTaskInRepo.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.AgentTasksCreateTaskInRepo.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksCreateTaskInRepo.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksCreateTaskInRepo.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksCreateTaskInRepo.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/errors`. + public var errors: Operations.AgentTasksCreateTaskInRepo.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksCreateTaskInRepo.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/application\/json`. + case json(Operations.AgentTasksCreateTaskInRepo.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.AgentTasksCreateTaskInRepo.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksCreateTaskInRepo.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksCreateTaskInRepo.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation Failed + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task-in-repo)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.AgentTasksCreateTaskInRepo.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.AgentTasksCreateTaskInRepo.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) + } + @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 task by repo + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID scoped to an owner/repo path + /// + /// **Fine-grained access tokens for "Get a task by repo"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)`. + public enum AgentTasksGetTaskByRepoAndId { + public static let id: Swift.String = "agent-tasks/get-task-by-repo-and-id" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/path/owner`. + public var owner: Swift.String + /// The name of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/path/repo`. + public var repo: Swift.String + /// The unique identifier of the task. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/path/task_id`. + public var taskId: 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. The name is not case sensitive. + /// - taskId: The unique identifier of the task. + public init( + owner: Swift.String, + repo: Swift.String, + taskId: Swift.String + ) { + self.owner = owner + self.repo = repo + self.taskId = taskId + } + } + public var path: Operations.AgentTasksGetTaskByRepoAndId.Input.Path + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_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.AgentTasksGetTaskByRepoAndId.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.AgentTasksGetTaskByRepoAndId.Input.Path, + headers: Operations.AgentTasksGetTaskByRepoAndId.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1`. + public struct Value1Payload: Codable, Hashable, Sendable { + /// Unique task identifier + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/id`. + public var id: Swift.String + /// API URL for this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/url`. + public var url: Swift.String? + /// Web URL for this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/html_url`. + public var htmlUrl: Swift.String? + /// Human-readable name derived from the task prompt + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/name`. + public var name: Swift.String? + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/creator`. + @frozen public enum CreatorPayload: Codable, Hashable, Sendable { + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/creator/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/creator/case1/id`. + public var id: Swift.Int64? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/creator/case1`. + case case1(Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.CreatorPayload.Case1Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(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 Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + } + } + } + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/creator`. + public var creator: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.CreatorPayload? + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/creator_type`. + @frozen public enum CreatorTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case user = "user" + case organization = "organization" + } + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/creator_type`. + public var creatorType: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.CreatorTypePayload? + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/UserCollaboratorsPayload`. + public struct UserCollaboratorsPayloadPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/UserCollaboratorsPayload/id`. + public var id: Swift.Int64? + /// Creates a new `UserCollaboratorsPayloadPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/user_collaborators`. + public typealias UserCollaboratorsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.UserCollaboratorsPayloadPayload] + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/user_collaborators`. + @available(*, deprecated) + public var userCollaborators: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.UserCollaboratorsPayload? + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/owner`. + public struct OwnerPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/owner/id`. + public var id: Swift.Int64? + /// Creates a new `OwnerPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/owner`. + public var owner: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.OwnerPayload? + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/repository`. + public struct RepositoryPayload: Codable, Hashable, Sendable { + /// The unique identifier of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/repository/id`. + public var id: Swift.Int64? + /// Creates a new `RepositoryPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the repository + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/repository`. + public var repository: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.RepositoryPayload? + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case queued = "queued" + case inProgress = "in_progress" + case completed = "completed" + case failed = "failed" + case idle = "idle" + case waitingForUser = "waiting_for_user" + case timedOut = "timed_out" + case cancelled = "cancelled" + } + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/state`. + public var state: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.StatePayload + /// Number of sessions in this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/session_count`. + public var sessionCount: Swift.Int32? + /// A resource generated by the task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload`. + public struct ArtifactsPayloadPayload: Codable, Hashable, Sendable { + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/provider`. + @frozen public enum ProviderPayload: String, Codable, Hashable, Sendable, CaseIterable { + case github = "github" + } + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/provider`. + public var provider: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.ProviderPayload + /// Type of artifact. Available Values: `pull`, `branch`. + /// + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case pull = "pull" + case branch = "branch" + } + /// Type of artifact. Available Values: `pull`, `branch`. + /// + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/type`. + public var _type: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload._TypePayload + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data`. + @frozen public enum DataPayload: Codable, Hashable, Sendable { + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// GitHub resource ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1/id`. + public var id: Swift.Int64 + /// GraphQL global ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1/global_id`. + public var globalId: Swift.String? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: GitHub resource ID + /// - globalId: GraphQL global ID + public init( + id: Swift.Int64, + globalId: Swift.String? = nil + ) { + self.id = id + self.globalId = globalId + } + public enum CodingKeys: String, CodingKey { + case id + case globalId = "global_id" + } + } + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1`. + case case1(Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload.Case1Payload) + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// Head branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2/head_ref`. + public var headRef: Swift.String + /// Base branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2/base_ref`. + public var baseRef: Swift.String + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - headRef: Head branch name + /// - baseRef: Base branch name + public init( + headRef: Swift.String, + baseRef: Swift.String + ) { + self.headRef = headRef + self.baseRef = baseRef + } + public enum CodingKeys: String, CodingKey { + case headRef = "head_ref" + case baseRef = "base_ref" + } + } + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2`. + case case2(Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload.Case2Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.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 Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data`. + public var data: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload + /// Creates a new `ArtifactsPayloadPayload`. + /// + /// - Parameters: + /// - provider: Provider namespace + /// - _type: Type of artifact. Available Values: `pull`, `branch`. + /// - data: Resource data (shape depends on type) + public init( + provider: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.ProviderPayload, + _type: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload._TypePayload, + data: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload + ) { + self.provider = provider + self._type = _type + self.data = data + } + public enum CodingKeys: String, CodingKey { + case provider + case _type = "type" + case data + } + } + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/artifacts`. + public typealias ArtifactsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload] + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/artifacts`. + public var artifacts: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayload? + /// Timestamp when the task was archived, null if not archived + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/archived_at`. + public var archivedAt: Foundation.Date? + /// Timestamp of the most recent update + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/updated_at`. + public var updatedAt: Foundation.Date? + /// Timestamp when the task was created + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/created_at`. + public var createdAt: Foundation.Date + /// Creates a new `Value1Payload`. + /// + /// - Parameters: + /// - id: Unique task identifier + /// - url: API URL for this task + /// - htmlUrl: Web URL for this task + /// - name: Human-readable name derived from the task prompt + /// - creator: The entity who created this task + /// - creatorType: Type of the task creator + /// - userCollaborators: User objects of collaborators on this task + /// - owner: The owner of the repository + /// - repository: The repository this task belongs to + /// - state: Current state of the task, derived from its most recent session + /// - sessionCount: Number of sessions in this task + /// - artifacts: Resources created by this task (PRs, branches, etc.) + /// - archivedAt: Timestamp when the task was archived, null if not archived + /// - updatedAt: Timestamp of the most recent update + /// - createdAt: Timestamp when the task was created + public init( + id: Swift.String, + url: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + name: Swift.String? = nil, + creator: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.CreatorPayload? = nil, + creatorType: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.CreatorTypePayload? = nil, + userCollaborators: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.UserCollaboratorsPayload? = nil, + owner: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.OwnerPayload? = nil, + repository: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.RepositoryPayload? = nil, + state: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.StatePayload, + sessionCount: Swift.Int32? = nil, + artifacts: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayload? = nil, + archivedAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + createdAt: Foundation.Date + ) { + self.id = id + self.url = url + self.htmlUrl = htmlUrl + self.name = name + self.creator = creator + self.creatorType = creatorType + self.userCollaborators = userCollaborators + self.owner = owner + self.repository = repository + self.state = state + self.sessionCount = sessionCount + self.artifacts = artifacts + self.archivedAt = archivedAt + self.updatedAt = updatedAt + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey { + case id + case url + case htmlUrl = "html_url" + case name + case creator + case creatorType = "creator_type" + case userCollaborators = "user_collaborators" + case owner + case repository + case state + case sessionCount = "session_count" + case artifacts + case archivedAt = "archived_at" + case updatedAt = "updated_at" + case createdAt = "created_at" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1`. + public var value1: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// Full session details within a task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload`. + public struct SessionsPayloadPayload: Codable, Hashable, Sendable { + /// Session ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/id`. + public var id: Swift.String + /// Session name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/name`. + public var name: Swift.String? + /// The user who created this session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/user`. + public struct UserPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/user/id`. + public var id: Swift.Int64? + /// Creates a new `UserPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The user who created this session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/user`. + public var user: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UserPayload? + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/owner`. + public struct OwnerPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/owner/id`. + public var id: Swift.Int64? + /// Creates a new `OwnerPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/owner`. + public var owner: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.OwnerPayload? + /// The repository this session belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/repository`. + public struct RepositoryPayload: Codable, Hashable, Sendable { + /// The unique identifier of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/repository/id`. + public var id: Swift.Int64? + /// Creates a new `RepositoryPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the repository + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The repository this session belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/repository`. + public var repository: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.RepositoryPayload? + /// Task ID this session belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/task_id`. + public var taskId: Swift.String? + /// Current state of a session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case queued = "queued" + case inProgress = "in_progress" + case completed = "completed" + case failed = "failed" + case idle = "idle" + case waitingForUser = "waiting_for_user" + case timedOut = "timed_out" + case cancelled = "cancelled" + } + /// Current state of a session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/state`. + public var state: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.StatePayload + /// Creation timestamp + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/created_at`. + public var createdAt: Foundation.Date + /// Last update timestamp + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/updated_at`. + public var updatedAt: Foundation.Date? + /// Completion timestamp + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/completed_at`. + public var completedAt: Foundation.Date? + /// Content of the triggering event + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/prompt`. + public var prompt: Swift.String? + /// Head branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/head_ref`. + public var headRef: Swift.String? + /// Base branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/base_ref`. + public var baseRef: Swift.String? + /// Model used for this session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/model`. + public var model: Swift.String? + /// Error details for a failed session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/error`. + public struct _ErrorPayload: Codable, Hashable, Sendable { + /// Error message + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/error/message`. + public var message: Swift.String? + /// Creates a new `_ErrorPayload`. + /// + /// - Parameters: + /// - message: Error message + public init(message: Swift.String? = nil) { + self.message = message + } + public enum CodingKeys: String, CodingKey { + case message + } + } + /// Error details for a failed session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/error`. + public var error: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload._ErrorPayload? + /// Creates a new `SessionsPayloadPayload`. + /// + /// - Parameters: + /// - id: Session ID + /// - name: Session name + /// - user: The user who created this session + /// - owner: The owner of the repository + /// - repository: The repository this session belongs to + /// - taskId: Task ID this session belongs to + /// - state: Current state of a session + /// - createdAt: Creation timestamp + /// - updatedAt: Last update timestamp + /// - completedAt: Completion timestamp + /// - prompt: Content of the triggering event + /// - headRef: Head branch name + /// - baseRef: Base branch name + /// - model: Model used for this session + /// - error: Error details for a failed session + public init( + id: Swift.String, + name: Swift.String? = nil, + user: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UserPayload? = nil, + owner: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.OwnerPayload? = nil, + repository: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.RepositoryPayload? = nil, + taskId: Swift.String? = nil, + state: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.StatePayload, + createdAt: Foundation.Date, + updatedAt: Foundation.Date? = nil, + completedAt: Foundation.Date? = nil, + prompt: Swift.String? = nil, + headRef: Swift.String? = nil, + baseRef: Swift.String? = nil, + model: Swift.String? = nil, + error: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload._ErrorPayload? = nil + ) { + self.id = id + self.name = name + self.user = user + self.owner = owner + self.repository = repository + self.taskId = taskId + self.state = state + self.createdAt = createdAt + self.updatedAt = updatedAt + self.completedAt = completedAt + self.prompt = prompt + self.headRef = headRef + self.baseRef = baseRef + self.model = model + self.error = error + } + public enum CodingKeys: String, CodingKey { + case id + case name + case user + case owner + case repository + case taskId = "task_id" + case state + case createdAt = "created_at" + case updatedAt = "updated_at" + case completedAt = "completed_at" + case prompt + case headRef = "head_ref" + case baseRef = "base_ref" + case model + case error + } + } + /// Sessions associated with this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/sessions`. + public typealias SessionsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload] + /// Sessions associated with this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/sessions`. + public var sessions: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayload? + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - sessions: Sessions associated with this task + public init(sessions: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayload? = nil) { + self.sessions = sessions + } + public enum CodingKeys: String, CodingKey { + case sessions + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2`. + public var value2: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload, + value2: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Swift.Decoder) throws { + self.value1 = try .init(from: decoder) + self.value2 = try .init(from: decoder) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1.encode(to: encoder) + try self.value2.encode(to: encoder) + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/application\/json`. + case json(Operations.AgentTasksGetTaskByRepoAndId.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.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body) { + self.body = body + } + } + /// Task retrieved successfully + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentTasksGetTaskByRepoAndId.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.AgentTasksGetTaskByRepoAndId.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/application\/json`. + case json(Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.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.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body) { + self.body = body + } + } + /// Bad request + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.AgentTasksGetTaskByRepoAndId.Output.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: Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/application\/json`. + case json(Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.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.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body) { + self.body = body + } + } + /// Authentication required + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/application\/json`. + case json(Operations.AgentTasksGetTaskByRepoAndId.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.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body) { + self.body = body + } + } + /// Insufficient permissions + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.AgentTasksGetTaskByRepoAndId.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.AgentTasksGetTaskByRepoAndId.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/application\/json`. + case json(Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.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.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.AgentTasksGetTaskByRepoAndId.Output.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.AgentTasksGetTaskByRepoAndId.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/application\/json`. + case json(Operations.AgentTasksGetTaskByRepoAndId.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.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation Failed + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.AgentTasksGetTaskByRepoAndId.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.AgentTasksGetTaskByRepoAndId.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) + } + @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 tasks + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for the authenticated user + /// + /// **Fine-grained access tokens for "List tasks"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/tasks`. + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)`. + public enum AgentTasksListTasks { + public static let id: Swift.String = "agent-tasks/list-tasks" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/per_page`. + public var perPage: Swift.Int? + /// The page number of the results to fetch. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/page`. + public var page: Swift.Int? + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/sort`. + @frozen public enum SortPayload: String, Codable, Hashable, Sendable, CaseIterable { + case updatedAt = "updated_at" + case createdAt = "created_at" + } + /// The field to sort results by. Can be `updated_at` or `created_at`. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/sort`. + public var sort: Operations.AgentTasksListTasks.Input.Query.SortPayload? + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/direction`. + @frozen public enum DirectionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort results. Can be `asc` or `desc`. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/direction`. + public var direction: Operations.AgentTasksListTasks.Input.Query.DirectionPayload? + /// Comma-separated list of task states to filter by. Can be any combination of: `queued`, `in_progress`, `completed`, `failed`, `idle`, `waiting_for_user`, `timed_out`, `cancelled`. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/state`. + public var state: Swift.String? + /// Filter by archived status. When `true`, returns only archived tasks. When `false` or omitted, returns only non-archived tasks. Defaults to `false`. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/is_archived`. + public var isArchived: Swift.Bool? + /// Only show tasks updated at or after this time (ISO 8601 timestamp) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/since`. + public var since: Foundation.Date? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). + /// - page: The page number of the results to fetch. + /// - sort: The field to sort results by. Can be `updated_at` or `created_at`. + /// - direction: The direction to sort results. Can be `asc` or `desc`. + /// - state: Comma-separated list of task states to filter by. Can be any combination of: `queued`, `in_progress`, `completed`, `failed`, `idle`, `waiting_for_user`, `timed_out`, `cancelled`. + /// - isArchived: Filter by archived status. When `true`, returns only archived tasks. When `false` or omitted, returns only non-archived tasks. Defaults to `false`. + /// - since: Only show tasks updated at or after this time (ISO 8601 timestamp) + public init( + perPage: Swift.Int? = nil, + page: Swift.Int? = nil, + sort: Operations.AgentTasksListTasks.Input.Query.SortPayload? = nil, + direction: Operations.AgentTasksListTasks.Input.Query.DirectionPayload? = nil, + state: Swift.String? = nil, + isArchived: Swift.Bool? = nil, + since: Foundation.Date? = nil + ) { + self.perPage = perPage + self.page = page + self.sort = sort + self.direction = direction + self.state = state + self.isArchived = isArchived + self.since = since + } + } + public var query: Operations.AgentTasksListTasks.Input.Query + /// - Remark: Generated from `#/paths/agents/tasks/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.AgentTasksListTasks.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - query: + /// - headers: + public init( + query: Operations.AgentTasksListTasks.Input.Query = .init(), + headers: Operations.AgentTasksListTasks.Input.Headers = .init() + ) { + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// Pagination links. Contains rel="first" (always), + /// rel="next" (when more pages exist), and rel="last" (when on the final page). + /// + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/headers/Link`. + public var link: Swift.String? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: Pagination links. Contains rel="first" (always), + public init(link: Swift.String? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.AgentTasksListTasks.Output.Ok.Headers + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload`. + public struct TasksPayloadPayload: Codable, Hashable, Sendable { + /// Unique task identifier + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/id`. + public var id: Swift.String + /// API URL for this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/url`. + public var url: Swift.String? + /// Web URL for this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/html_url`. + public var htmlUrl: Swift.String? + /// Human-readable name derived from the task prompt + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/name`. + public var name: Swift.String? + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/creator`. + @frozen public enum CreatorPayload: Codable, Hashable, Sendable { + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/creator/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/creator/case1/id`. + public var id: Swift.Int64? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/creator/case1`. + case case1(Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorPayload.Case1Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(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 Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + } + } + } + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/creator`. + public var creator: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorPayload? + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/creator_type`. + @frozen public enum CreatorTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case user = "user" + case organization = "organization" + } + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/creator_type`. + public var creatorType: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorTypePayload? + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/UserCollaboratorsPayload`. + public struct UserCollaboratorsPayloadPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/UserCollaboratorsPayload/id`. + public var id: Swift.Int64? + /// Creates a new `UserCollaboratorsPayloadPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/user_collaborators`. + public typealias UserCollaboratorsPayload = [Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.UserCollaboratorsPayloadPayload] + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/user_collaborators`. + @available(*, deprecated) + public var userCollaborators: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.UserCollaboratorsPayload? + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/owner`. + public struct OwnerPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/owner/id`. + public var id: Swift.Int64? + /// Creates a new `OwnerPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/owner`. + public var owner: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.OwnerPayload? + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/repository`. + public struct RepositoryPayload: Codable, Hashable, Sendable { + /// The unique identifier of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/repository/id`. + public var id: Swift.Int64? + /// Creates a new `RepositoryPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the repository + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/repository`. + public var repository: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.RepositoryPayload? + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case queued = "queued" + case inProgress = "in_progress" + case completed = "completed" + case failed = "failed" + case idle = "idle" + case waitingForUser = "waiting_for_user" + case timedOut = "timed_out" + case cancelled = "cancelled" + } + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/state`. + public var state: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.StatePayload + /// Number of sessions in this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/session_count`. + public var sessionCount: Swift.Int32? + /// A resource generated by the task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload`. + public struct ArtifactsPayloadPayload: Codable, Hashable, Sendable { + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/provider`. + @frozen public enum ProviderPayload: String, Codable, Hashable, Sendable, CaseIterable { + case github = "github" + } + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/provider`. + public var provider: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.ProviderPayload + /// Type of artifact. Available Values: `pull`, `branch`. + /// + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case pull = "pull" + case branch = "branch" + } + /// Type of artifact. Available Values: `pull`, `branch`. + /// + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/type`. + public var _type: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload._TypePayload + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data`. + @frozen public enum DataPayload: Codable, Hashable, Sendable { + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// GitHub resource ID + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1/id`. + public var id: Swift.Int64 + /// GraphQL global ID + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1/global_id`. + public var globalId: Swift.String? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: GitHub resource ID + /// - globalId: GraphQL global ID + public init( + id: Swift.Int64, + globalId: Swift.String? = nil + ) { + self.id = id + self.globalId = globalId + } + public enum CodingKeys: String, CodingKey { + case id + case globalId = "global_id" + } + } + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1`. + case case1(Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload.Case1Payload) + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// Head branch name + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2/head_ref`. + public var headRef: Swift.String + /// Base branch name + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2/base_ref`. + public var baseRef: Swift.String + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - headRef: Head branch name + /// - baseRef: Base branch name + public init( + headRef: Swift.String, + baseRef: Swift.String + ) { + self.headRef = headRef + self.baseRef = baseRef + } + public enum CodingKeys: String, CodingKey { + case headRef = "head_ref" + case baseRef = "base_ref" + } + } + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2`. + case case2(Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload.Case2Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.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 Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data`. + public var data: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload + /// Creates a new `ArtifactsPayloadPayload`. + /// + /// - Parameters: + /// - provider: Provider namespace + /// - _type: Type of artifact. Available Values: `pull`, `branch`. + /// - data: Resource data (shape depends on type) + public init( + provider: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.ProviderPayload, + _type: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload._TypePayload, + data: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload + ) { + self.provider = provider + self._type = _type + self.data = data + } + public enum CodingKeys: String, CodingKey { + case provider + case _type = "type" + case data + } + } + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/artifacts`. + public typealias ArtifactsPayload = [Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload] + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/artifacts`. + public var artifacts: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayload? + /// Timestamp when the task was archived, null if not archived + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/archived_at`. + public var archivedAt: Foundation.Date? + /// Timestamp of the most recent update + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/updated_at`. + public var updatedAt: Foundation.Date? + /// Timestamp when the task was created + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/created_at`. + public var createdAt: Foundation.Date + /// Creates a new `TasksPayloadPayload`. + /// + /// - Parameters: + /// - id: Unique task identifier + /// - url: API URL for this task + /// - htmlUrl: Web URL for this task + /// - name: Human-readable name derived from the task prompt + /// - creator: The entity who created this task + /// - creatorType: Type of the task creator + /// - userCollaborators: User objects of collaborators on this task + /// - owner: The owner of the repository + /// - repository: The repository this task belongs to + /// - state: Current state of the task, derived from its most recent session + /// - sessionCount: Number of sessions in this task + /// - artifacts: Resources created by this task (PRs, branches, etc.) + /// - archivedAt: Timestamp when the task was archived, null if not archived + /// - updatedAt: Timestamp of the most recent update + /// - createdAt: Timestamp when the task was created + public init( + id: Swift.String, + url: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + name: Swift.String? = nil, + creator: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorPayload? = nil, + creatorType: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorTypePayload? = nil, + userCollaborators: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.UserCollaboratorsPayload? = nil, + owner: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.OwnerPayload? = nil, + repository: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.RepositoryPayload? = nil, + state: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.StatePayload, + sessionCount: Swift.Int32? = nil, + artifacts: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayload? = nil, + archivedAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + createdAt: Foundation.Date + ) { + self.id = id + self.url = url + self.htmlUrl = htmlUrl + self.name = name + self.creator = creator + self.creatorType = creatorType + self.userCollaborators = userCollaborators + self.owner = owner + self.repository = repository + self.state = state + self.sessionCount = sessionCount + self.artifacts = artifacts + self.archivedAt = archivedAt + self.updatedAt = updatedAt + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey { + case id + case url + case htmlUrl = "html_url" + case name + case creator + case creatorType = "creator_type" + case userCollaborators = "user_collaborators" + case owner + case repository + case state + case sessionCount = "session_count" + case artifacts + case archivedAt = "archived_at" + case updatedAt = "updated_at" + case createdAt = "created_at" + } + } + /// List of tasks + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/tasks`. + public typealias TasksPayload = [Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload] + /// List of tasks + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/tasks`. + public var tasks: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayload + /// Total count of active (non-archived) tasks + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/total_active_count`. + public var totalActiveCount: Swift.Int32? + /// Total count of archived tasks + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/total_archived_count`. + public var totalArchivedCount: Swift.Int32? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - tasks: List of tasks + /// - totalActiveCount: Total count of active (non-archived) tasks + /// - totalArchivedCount: Total count of archived tasks + public init( + tasks: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayload, + totalActiveCount: Swift.Int32? = nil, + totalArchivedCount: Swift.Int32? = nil + ) { + self.tasks = tasks + self.totalActiveCount = totalActiveCount + self.totalArchivedCount = totalArchivedCount + } + public enum CodingKeys: String, CodingKey { + case tasks + case totalActiveCount = "total_active_count" + case totalArchivedCount = "total_archived_count" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/application\/json`. + case json(Operations.AgentTasksListTasks.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.AgentTasksListTasks.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasks.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.AgentTasksListTasks.Output.Ok.Headers = .init(), + body: Operations.AgentTasksListTasks.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Tasks retrieved successfully + /// + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentTasksListTasks.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.AgentTasksListTasks.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasks.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasks.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasks.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/errors`. + public var errors: Operations.AgentTasksListTasks.Output.BadRequest.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasks.Output.BadRequest.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/application\/json`. + case json(Operations.AgentTasksListTasks.Output.BadRequest.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.AgentTasksListTasks.Output.BadRequest.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasks.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasks.Output.BadRequest.Body) { + self.body = body + } + } + /// Bad request + /// + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.AgentTasksListTasks.Output.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: Operations.AgentTasksListTasks.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasks.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasks.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasks.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/errors`. + public var errors: Operations.AgentTasksListTasks.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasks.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/application\/json`. + case json(Operations.AgentTasksListTasks.Output.Unauthorized.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.AgentTasksListTasks.Output.Unauthorized.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasks.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasks.Output.Unauthorized.Body) { + self.body = body + } + } + /// Authentication required + /// + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.AgentTasksListTasks.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.AgentTasksListTasks.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasks.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasks.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasks.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/errors`. + public var errors: Operations.AgentTasksListTasks.Output.Forbidden.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasks.Output.Forbidden.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/application\/json`. + case json(Operations.AgentTasksListTasks.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.AgentTasksListTasks.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasks.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasks.Output.Forbidden.Body) { + self.body = body + } + } + /// Insufficient permissions + /// + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.AgentTasksListTasks.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.AgentTasksListTasks.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasks.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasks.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasks.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/errors`. + public var errors: Operations.AgentTasksListTasks.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasks.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/application\/json`. + case json(Operations.AgentTasksListTasks.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.AgentTasksListTasks.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasks.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasks.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation Failed + /// + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.AgentTasksListTasks.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.AgentTasksListTasks.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) + } + @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 task by ID + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID with its associated sessions + /// + /// **Fine-grained access tokens for "Get a task by ID"** + /// + /// This endpoint works with the following fine-grained token types: + /// + /// * [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) + /// * [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) + /// + /// The fine-grained token must have the following permission set: + /// + /// * "Agent tasks" repository permissions (read) + /// + /// GitHub App installation access tokens are not supported for this endpoint. + /// + /// + /// - Remark: HTTP `GET /agents/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)`. + public enum AgentTasksGetTaskById { + public static let id: Swift.String = "agent-tasks/get-task-by-id" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the task. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/path/task_id`. + public var taskId: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - taskId: The unique identifier of the task. + public init(taskId: Swift.String) { + self.taskId = taskId + } + } + public var path: Operations.AgentTasksGetTaskById.Input.Path + /// - Remark: Generated from `#/paths/agents/tasks/{task_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.AgentTasksGetTaskById.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.AgentTasksGetTaskById.Input.Path, + headers: Operations.AgentTasksGetTaskById.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1`. + public struct Value1Payload: Codable, Hashable, Sendable { + /// Unique task identifier + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/id`. + public var id: Swift.String + /// API URL for this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/url`. + public var url: Swift.String? + /// Web URL for this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/html_url`. + public var htmlUrl: Swift.String? + /// Human-readable name derived from the task prompt + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/name`. + public var name: Swift.String? + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/creator`. + @frozen public enum CreatorPayload: Codable, Hashable, Sendable { + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/creator/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/creator/case1/id`. + public var id: Swift.Int64? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/creator/case1`. + case case1(Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.CreatorPayload.Case1Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(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 Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + } + } + } + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/creator`. + public var creator: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.CreatorPayload? + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/creator_type`. + @frozen public enum CreatorTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case user = "user" + case organization = "organization" + } + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/creator_type`. + public var creatorType: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.CreatorTypePayload? + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/UserCollaboratorsPayload`. + public struct UserCollaboratorsPayloadPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/UserCollaboratorsPayload/id`. + public var id: Swift.Int64? + /// Creates a new `UserCollaboratorsPayloadPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/user_collaborators`. + public typealias UserCollaboratorsPayload = [Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.UserCollaboratorsPayloadPayload] + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/user_collaborators`. + @available(*, deprecated) + public var userCollaborators: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.UserCollaboratorsPayload? + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/owner`. + public struct OwnerPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/owner/id`. + public var id: Swift.Int64? + /// Creates a new `OwnerPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/owner`. + public var owner: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.OwnerPayload? + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/repository`. + public struct RepositoryPayload: Codable, Hashable, Sendable { + /// The unique identifier of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/repository/id`. + public var id: Swift.Int64? + /// Creates a new `RepositoryPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the repository + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/repository`. + public var repository: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.RepositoryPayload? + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case queued = "queued" + case inProgress = "in_progress" + case completed = "completed" + case failed = "failed" + case idle = "idle" + case waitingForUser = "waiting_for_user" + case timedOut = "timed_out" + case cancelled = "cancelled" + } + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/state`. + public var state: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.StatePayload + /// Number of sessions in this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/session_count`. + public var sessionCount: Swift.Int32? + /// A resource generated by the task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload`. + public struct ArtifactsPayloadPayload: Codable, Hashable, Sendable { + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/provider`. + @frozen public enum ProviderPayload: String, Codable, Hashable, Sendable, CaseIterable { + case github = "github" + } + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/provider`. + public var provider: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.ProviderPayload + /// Type of artifact. Available Values: `pull`, `branch`. + /// + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case pull = "pull" + case branch = "branch" + } + /// Type of artifact. Available Values: `pull`, `branch`. + /// + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/type`. + public var _type: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload._TypePayload + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data`. + @frozen public enum DataPayload: Codable, Hashable, Sendable { + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// GitHub resource ID + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1/id`. + public var id: Swift.Int64 + /// GraphQL global ID + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1/global_id`. + public var globalId: Swift.String? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: GitHub resource ID + /// - globalId: GraphQL global ID + public init( + id: Swift.Int64, + globalId: Swift.String? = nil + ) { + self.id = id + self.globalId = globalId + } + public enum CodingKeys: String, CodingKey { + case id + case globalId = "global_id" + } + } + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1`. + case case1(Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload.Case1Payload) + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// Head branch name + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2/head_ref`. + public var headRef: Swift.String + /// Base branch name + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2/base_ref`. + public var baseRef: Swift.String + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - headRef: Head branch name + /// - baseRef: Base branch name + public init( + headRef: Swift.String, + baseRef: Swift.String + ) { + self.headRef = headRef + self.baseRef = baseRef + } + public enum CodingKeys: String, CodingKey { + case headRef = "head_ref" + case baseRef = "base_ref" + } + } + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2`. + case case2(Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload.Case2Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.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 Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data`. + public var data: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload + /// Creates a new `ArtifactsPayloadPayload`. + /// + /// - Parameters: + /// - provider: Provider namespace + /// - _type: Type of artifact. Available Values: `pull`, `branch`. + /// - data: Resource data (shape depends on type) + public init( + provider: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.ProviderPayload, + _type: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload._TypePayload, + data: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload + ) { + self.provider = provider + self._type = _type + self.data = data + } + public enum CodingKeys: String, CodingKey { + case provider + case _type = "type" + case data + } + } + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/artifacts`. + public typealias ArtifactsPayload = [Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload] + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/artifacts`. + public var artifacts: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayload? + /// Timestamp when the task was archived, null if not archived + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/archived_at`. + public var archivedAt: Foundation.Date? + /// Timestamp of the most recent update + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/updated_at`. + public var updatedAt: Foundation.Date? + /// Timestamp when the task was created + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/created_at`. + public var createdAt: Foundation.Date + /// Creates a new `Value1Payload`. + /// + /// - Parameters: + /// - id: Unique task identifier + /// - url: API URL for this task + /// - htmlUrl: Web URL for this task + /// - name: Human-readable name derived from the task prompt + /// - creator: The entity who created this task + /// - creatorType: Type of the task creator + /// - userCollaborators: User objects of collaborators on this task + /// - owner: The owner of the repository + /// - repository: The repository this task belongs to + /// - state: Current state of the task, derived from its most recent session + /// - sessionCount: Number of sessions in this task + /// - artifacts: Resources created by this task (PRs, branches, etc.) + /// - archivedAt: Timestamp when the task was archived, null if not archived + /// - updatedAt: Timestamp of the most recent update + /// - createdAt: Timestamp when the task was created + public init( + id: Swift.String, + url: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + name: Swift.String? = nil, + creator: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.CreatorPayload? = nil, + creatorType: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.CreatorTypePayload? = nil, + userCollaborators: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.UserCollaboratorsPayload? = nil, + owner: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.OwnerPayload? = nil, + repository: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.RepositoryPayload? = nil, + state: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.StatePayload, + sessionCount: Swift.Int32? = nil, + artifacts: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayload? = nil, + archivedAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + createdAt: Foundation.Date + ) { + self.id = id + self.url = url + self.htmlUrl = htmlUrl + self.name = name + self.creator = creator + self.creatorType = creatorType + self.userCollaborators = userCollaborators + self.owner = owner + self.repository = repository + self.state = state + self.sessionCount = sessionCount + self.artifacts = artifacts + self.archivedAt = archivedAt + self.updatedAt = updatedAt + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey { + case id + case url + case htmlUrl = "html_url" + case name + case creator + case creatorType = "creator_type" + case userCollaborators = "user_collaborators" + case owner + case repository + case state + case sessionCount = "session_count" + case artifacts + case archivedAt = "archived_at" + case updatedAt = "updated_at" + case createdAt = "created_at" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1`. + public var value1: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// Full session details within a task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload`. + public struct SessionsPayloadPayload: Codable, Hashable, Sendable { + /// Session ID + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/id`. + public var id: Swift.String + /// Session name + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/name`. + public var name: Swift.String? + /// The user who created this session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/user`. + public struct UserPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/user/id`. + public var id: Swift.Int64? + /// Creates a new `UserPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The user who created this session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/user`. + public var user: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UserPayload? + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/owner`. + public struct OwnerPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/owner/id`. + public var id: Swift.Int64? + /// Creates a new `OwnerPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/owner`. + public var owner: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.OwnerPayload? + /// The repository this session belongs to + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/repository`. + public struct RepositoryPayload: Codable, Hashable, Sendable { + /// The unique identifier of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/repository/id`. + public var id: Swift.Int64? + /// Creates a new `RepositoryPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the repository + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The repository this session belongs to + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/repository`. + public var repository: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.RepositoryPayload? + /// Task ID this session belongs to + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/task_id`. + public var taskId: Swift.String? + /// Current state of a session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case queued = "queued" + case inProgress = "in_progress" + case completed = "completed" + case failed = "failed" + case idle = "idle" + case waitingForUser = "waiting_for_user" + case timedOut = "timed_out" + case cancelled = "cancelled" + } + /// Current state of a session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/state`. + public var state: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.StatePayload + /// Creation timestamp + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/created_at`. + public var createdAt: Foundation.Date + /// Last update timestamp + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/updated_at`. + public var updatedAt: Foundation.Date? + /// Completion timestamp + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/completed_at`. + public var completedAt: Foundation.Date? + /// Content of the triggering event + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/prompt`. + public var prompt: Swift.String? + /// Head branch name + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/head_ref`. + public var headRef: Swift.String? + /// Base branch name + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/base_ref`. + public var baseRef: Swift.String? + /// Model used for this session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/model`. + public var model: Swift.String? + /// Error details for a failed session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/error`. + public struct _ErrorPayload: Codable, Hashable, Sendable { + /// Error message + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/error/message`. + public var message: Swift.String? + /// Creates a new `_ErrorPayload`. + /// + /// - Parameters: + /// - message: Error message + public init(message: Swift.String? = nil) { + self.message = message + } + public enum CodingKeys: String, CodingKey { + case message + } + } + /// Error details for a failed session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/error`. + public var error: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload._ErrorPayload? + /// Creates a new `SessionsPayloadPayload`. + /// + /// - Parameters: + /// - id: Session ID + /// - name: Session name + /// - user: The user who created this session + /// - owner: The owner of the repository + /// - repository: The repository this session belongs to + /// - taskId: Task ID this session belongs to + /// - state: Current state of a session + /// - createdAt: Creation timestamp + /// - updatedAt: Last update timestamp + /// - completedAt: Completion timestamp + /// - prompt: Content of the triggering event + /// - headRef: Head branch name + /// - baseRef: Base branch name + /// - model: Model used for this session + /// - error: Error details for a failed session + public init( + id: Swift.String, + name: Swift.String? = nil, + user: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UserPayload? = nil, + owner: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.OwnerPayload? = nil, + repository: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.RepositoryPayload? = nil, + taskId: Swift.String? = nil, + state: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.StatePayload, + createdAt: Foundation.Date, + updatedAt: Foundation.Date? = nil, + completedAt: Foundation.Date? = nil, + prompt: Swift.String? = nil, + headRef: Swift.String? = nil, + baseRef: Swift.String? = nil, + model: Swift.String? = nil, + error: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload._ErrorPayload? = nil + ) { + self.id = id + self.name = name + self.user = user + self.owner = owner + self.repository = repository + self.taskId = taskId + self.state = state + self.createdAt = createdAt + self.updatedAt = updatedAt + self.completedAt = completedAt + self.prompt = prompt + self.headRef = headRef + self.baseRef = baseRef + self.model = model + self.error = error + } + public enum CodingKeys: String, CodingKey { + case id + case name + case user + case owner + case repository + case taskId = "task_id" + case state + case createdAt = "created_at" + case updatedAt = "updated_at" + case completedAt = "completed_at" + case prompt + case headRef = "head_ref" + case baseRef = "base_ref" + case model + case error + } + } + /// Sessions associated with this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/sessions`. + public typealias SessionsPayload = [Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload] + /// Sessions associated with this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/sessions`. + public var sessions: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayload? + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - sessions: Sessions associated with this task + public init(sessions: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayload? = nil) { + self.sessions = sessions + } + public enum CodingKeys: String, CodingKey { + case sessions + } + } + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2`. + public var value2: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload, + value2: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Swift.Decoder) throws { + self.value1 = try .init(from: decoder) + self.value2 = try .init(from: decoder) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1.encode(to: encoder) + try self.value2.encode(to: encoder) + } + } + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/application\/json`. + case json(Operations.AgentTasksGetTaskById.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.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskById.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskById.Output.Ok.Body) { + self.body = body + } + } + /// Task retrieved successfully + /// + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentTasksGetTaskById.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.AgentTasksGetTaskById.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskById.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskById.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskById.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskById.Output.BadRequest.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskById.Output.BadRequest.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/application\/json`. + case json(Operations.AgentTasksGetTaskById.Output.BadRequest.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.AgentTasksGetTaskById.Output.BadRequest.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskById.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskById.Output.BadRequest.Body) { + self.body = body + } + } + /// Problems parsing request + /// + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.AgentTasksGetTaskById.Output.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: Operations.AgentTasksGetTaskById.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskById.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskById.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskById.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskById.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskById.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/application\/json`. + case json(Operations.AgentTasksGetTaskById.Output.Unauthorized.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.AgentTasksGetTaskById.Output.Unauthorized.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskById.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskById.Output.Unauthorized.Body) { + self.body = body + } + } + /// Authentication required + /// + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.AgentTasksGetTaskById.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.AgentTasksGetTaskById.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskById.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskById.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskById.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskById.Output.Forbidden.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskById.Output.Forbidden.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/application\/json`. + case json(Operations.AgentTasksGetTaskById.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.AgentTasksGetTaskById.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskById.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskById.Output.Forbidden.Body) { + self.body = body + } + } + /// Insufficient permissions + /// + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.AgentTasksGetTaskById.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.AgentTasksGetTaskById.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskById.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskById.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskById.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskById.Output.NotFound.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskById.Output.NotFound.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/application\/json`. + case json(Operations.AgentTasksGetTaskById.Output.NotFound.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.AgentTasksGetTaskById.Output.NotFound.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskById.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskById.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.AgentTasksGetTaskById.Output.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.AgentTasksGetTaskById.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskById.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskById.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskById.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskById.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskById.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/application\/json`. + case json(Operations.AgentTasksGetTaskById.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.AgentTasksGetTaskById.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskById.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskById.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation Failed + /// + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.AgentTasksGetTaskById.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.AgentTasksGetTaskById.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) + } + @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/agents/Client.swift b/Sources/agents/Client.swift new file mode 100644 index 00000000000..00a71f250ff --- /dev/null +++ b/Sources/agents/Client.swift @@ -0,0 +1,2098 @@ +// 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 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}/agents/secrets`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/get(agents/list-org-secrets)`. + public func agentsListOrgSecrets(_ input: Operations.AgentsListOrgSecrets.Input) async throws -> Operations.AgentsListOrgSecrets.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsListOrgSecrets.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/secrets", + 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.AgentsListOrgSecrets.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.AgentsListOrgSecrets.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentsListOrgSecrets.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 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. + /// + /// 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}/agents/secrets/public-key`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/public-key/get(agents/get-org-public-key)`. + public func agentsGetOrgPublicKey(_ input: Operations.AgentsGetOrgPublicKey.Input) async throws -> Operations.AgentsGetOrgPublicKey.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsGetOrgPublicKey.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/secrets/public-key", + 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.AgentsGetOrgPublicKey.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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/get(agents/get-org-secret)`. + public func agentsGetOrgSecret(_ input: Operations.AgentsGetOrgSecret.Input) async throws -> Operations.AgentsGetOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsGetOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/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) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentsGetOrgSecret.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)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// 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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/put(agents/create-or-update-org-secret)`. + public func agentsCreateOrUpdateOrgSecret(_ input: Operations.AgentsCreateOrUpdateOrgSecret.Input) async throws -> Operations.AgentsCreateOrUpdateOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsCreateOrUpdateOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/secrets/{}", + parameters: [ + 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.AgentsCreateOrUpdateOrgSecret.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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/delete(agents/delete-org-secret)`. + public func agentsDeleteOrgSecret(_ input: Operations.AgentsDeleteOrgSecret.Input) async throws -> Operations.AgentsDeleteOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsDeleteOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/secrets/{}", + parameters: [ + input.path.org, + input.path.secretName + ] + ) + 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 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}/agents/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/get(agents/list-selected-repos-for-org-secret)`. + public func agentsListSelectedReposForOrgSecret(_ input: Operations.AgentsListSelectedReposForOrgSecret.Input) async throws -> Operations.AgentsListSelectedReposForOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsListSelectedReposForOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/secrets/{}/repositories", + parameters: [ + input.path.org, + input.path.secretName + ] + ) + 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.AgentsListSelectedReposForOrgSecret.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentsListSelectedReposForOrgSecret.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/agents/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}/agents/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/put(agents/set-selected-repos-for-org-secret)`. + public func agentsSetSelectedReposForOrgSecret(_ input: Operations.AgentsSetSelectedReposForOrgSecret.Input) async throws -> Operations.AgentsSetSelectedReposForOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsSetSelectedReposForOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/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/agents/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}/agents/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/{repository_id}/put(agents/add-selected-repo-to-org-secret)`. + public func agentsAddSelectedRepoToOrgSecret(_ input: Operations.AgentsAddSelectedRepoToOrgSecret.Input) async throws -> Operations.AgentsAddSelectedRepoToOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsAddSelectedRepoToOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/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/agents/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}/agents/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/{repository_id}/delete(agents/remove-selected-repo-from-org-secret)`. + public func agentsRemoveSelectedRepoFromOrgSecret(_ input: Operations.AgentsRemoveSelectedRepoFromOrgSecret.Input) async throws -> Operations.AgentsRemoveSelectedRepoFromOrgSecret.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsRemoveSelectedRepoFromOrgSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/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 agent variables available in an organization. + /// Returned variables include their values. + /// + /// 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}/agents/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/get(agents/list-org-variables)`. + public func agentsListOrgVariables(_ input: Operations.AgentsListOrgVariables.Input) async throws -> Operations.AgentsListOrgVariables.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsListOrgVariables.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/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.AgentsListOrgVariables.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.AgentsListOrgVariables.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentsListOrgVariables.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 agent 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}/agents/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/post(agents/create-org-variable)`. + public func agentsCreateOrgVariable(_ input: Operations.AgentsCreateOrgVariable.Input) async throws -> Operations.AgentsCreateOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsCreateOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/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.AgentsCreateOrgVariable.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 agent 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/get(agents/get-org-variable)`. + public func agentsGetOrgVariable(_ input: Operations.AgentsGetOrgVariable.Input) async throws -> Operations.AgentsGetOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsGetOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/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.AgentsGetOrgVariable.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 agent 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/patch(agents/update-org-variable)`. + public func agentsUpdateOrgVariable(_ input: Operations.AgentsUpdateOrgVariable.Input) async throws -> Operations.AgentsUpdateOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsUpdateOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/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 agent 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/delete(agents/delete-org-variable)`. + public func agentsDeleteOrgVariable(_ input: Operations.AgentsDeleteOrgVariable.Input) async throws -> Operations.AgentsDeleteOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsDeleteOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/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 agent 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}/agents/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/get(agents/list-selected-repos-for-org-variable)`. + public func agentsListSelectedReposForOrgVariable(_ input: Operations.AgentsListSelectedReposForOrgVariable.Input) async throws -> Operations.AgentsListSelectedReposForOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsListSelectedReposForOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/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.AgentsListSelectedReposForOrgVariable.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentsListSelectedReposForOrgVariable.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 agent 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}/agents/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/put(agents/set-selected-repos-for-org-variable)`. + public func agentsSetSelectedReposForOrgVariable(_ input: Operations.AgentsSetSelectedReposForOrgVariable.Input) async throws -> Operations.AgentsSetSelectedReposForOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsSetSelectedReposForOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/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 agent 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 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}/agents/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/{repository_id}/put(agents/add-selected-repo-to-org-variable)`. + public func agentsAddSelectedRepoToOrgVariable(_ input: Operations.AgentsAddSelectedRepoToOrgVariable.Input) async throws -> Operations.AgentsAddSelectedRepoToOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsAddSelectedRepoToOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/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 agent 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}/agents/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/{repository_id}/delete(agents/remove-selected-repo-from-org-variable)`. + public func agentsRemoveSelectedRepoFromOrgVariable(_ input: Operations.AgentsRemoveSelectedRepoFromOrgVariable.Input) async throws -> Operations.AgentsRemoveSelectedRepoFromOrgVariable.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsRemoveSelectedRepoFromOrgVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/agents/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 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}/agents/organization-secrets`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/organization-secrets/get(agents/list-repo-organization-secrets)`. + public func agentsListRepoOrganizationSecrets(_ input: Operations.AgentsListRepoOrganizationSecrets.Input) async throws -> Operations.AgentsListRepoOrganizationSecrets.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsListRepoOrganizationSecrets.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/agents/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 + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.AgentsListRepoOrganizationSecrets.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.AgentsListRepoOrganizationSecrets.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentsListRepoOrganizationSecrets.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 + ) + ) + } + } + ) + } + /// List repository organization variables + /// + /// Lists all organization variables shared with a repository. + /// + /// 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/agents/organization-variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/organization-variables/get(agents/list-repo-organization-variables)`. + public func agentsListRepoOrganizationVariables(_ input: Operations.AgentsListRepoOrganizationVariables.Input) async throws -> Operations.AgentsListRepoOrganizationVariables.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsListRepoOrganizationVariables.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/agents/organization-variables", + 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 + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.AgentsListRepoOrganizationVariables.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.AgentsListRepoOrganizationVariables.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentsListRepoOrganizationVariables.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 + ) + ) + } + } + ) + } + /// List repository secrets + /// + /// Lists all secrets available in 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}/agents/secrets`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/get(agents/list-repo-secrets)`. + public func agentsListRepoSecrets(_ input: Operations.AgentsListRepoSecrets.Input) async throws -> Operations.AgentsListRepoSecrets.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsListRepoSecrets.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/agents/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 + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.AgentsListRepoSecrets.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.AgentsListRepoSecrets.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentsListRepoSecrets.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 a repository 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. + /// + /// 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}/agents/secrets/public-key`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/public-key/get(agents/get-repo-public-key)`. + public func agentsGetRepoPublicKey(_ input: Operations.AgentsGetRepoPublicKey.Input) async throws -> Operations.AgentsGetRepoPublicKey.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsGetRepoPublicKey.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/agents/secrets/public-key", + 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.AgentsGetRepoPublicKey.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 a repository secret + /// + /// Gets a single repository secret without revealing its encrypted value. + /// + /// The authenticated user must have collaborator access to the repository 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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/get(agents/get-repo-secret)`. + public func agentsGetRepoSecret(_ input: Operations.AgentsGetRepoSecret.Input) async throws -> Operations.AgentsGetRepoSecret.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsGetRepoSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/agents/secrets/{}", + parameters: [ + input.path.owner, + input.path.repo, + 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) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentsGetRepoSecret.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.ActionsSecret.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 + ) + ) + } + } + ) + } + /// Create or update a repository secret + /// + /// Creates or updates a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/put(agents/create-or-update-repo-secret)`. + public func agentsCreateOrUpdateRepoSecret(_ input: Operations.AgentsCreateOrUpdateRepoSecret.Input) async throws -> Operations.AgentsCreateOrUpdateRepoSecret.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsCreateOrUpdateRepoSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/agents/secrets/{}", + parameters: [ + input.path.owner, + input.path.repo, + 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.AgentsCreateOrUpdateRepoSecret.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 a repository secret + /// + /// Deletes a secret in a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/delete(agents/delete-repo-secret)`. + public func agentsDeleteRepoSecret(_ input: Operations.AgentsDeleteRepoSecret.Input) async throws -> Operations.AgentsDeleteRepoSecret.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsDeleteRepoSecret.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/agents/secrets/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.secretName + ] + ) + 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 repository variables + /// + /// Lists all repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/agents/variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/get(agents/list-repo-variables)`. + public func agentsListRepoVariables(_ input: Operations.AgentsListRepoVariables.Input) async throws -> Operations.AgentsListRepoVariables.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsListRepoVariables.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/agents/variables", + 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 + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.AgentsListRepoVariables.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.AgentsListRepoVariables.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentsListRepoVariables.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 a repository variable + /// + /// Creates a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/agents/variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/post(agents/create-repo-variable)`. + public func agentsCreateRepoVariable(_ input: Operations.AgentsCreateRepoVariable.Input) async throws -> Operations.AgentsCreateRepoVariable.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsCreateRepoVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/agents/variables", + 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.AgentsCreateRepoVariable.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 a repository variable + /// + /// Gets a specific variable in a repository. + /// + /// The authenticated user must have collaborator access to the repository 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/{name}/get(agents/get-repo-variable)`. + public func agentsGetRepoVariable(_ input: Operations.AgentsGetRepoVariable.Input) async throws -> Operations.AgentsGetRepoVariable.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsGetRepoVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/agents/variables/{}", + parameters: [ + input.path.owner, + input.path.repo, + 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.AgentsGetRepoVariable.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.ActionsVariable.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 a repository variable + /// + /// Updates a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/{name}/patch(agents/update-repo-variable)`. + public func agentsUpdateRepoVariable(_ input: Operations.AgentsUpdateRepoVariable.Input) async throws -> Operations.AgentsUpdateRepoVariable.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsUpdateRepoVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/agents/variables/{}", + parameters: [ + input.path.owner, + input.path.repo, + 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 a repository variable + /// + /// Deletes a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/{name}/delete(agents/delete-repo-variable)`. + public func agentsDeleteRepoVariable(_ input: Operations.AgentsDeleteRepoVariable.Input) async throws -> Operations.AgentsDeleteRepoVariable.Output { + try await client.send( + input: input, + forOperation: Operations.AgentsDeleteRepoVariable.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/agents/variables/{}", + parameters: [ + input.path.owner, + input.path.repo, + 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 + ) + ) + } + } + ) + } +} diff --git a/Sources/agents/Types.swift b/Sources/agents/Types.swift new file mode 100644 index 00000000000..04ab7dddfc0 --- /dev/null +++ b/Sources/agents/Types.swift @@ -0,0 +1,7309 @@ +// 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 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}/agents/secrets`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/get(agents/list-org-secrets)`. + func agentsListOrgSecrets(_ input: Operations.AgentsListOrgSecrets.Input) async throws -> Operations.AgentsListOrgSecrets.Output + /// 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. + /// + /// 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}/agents/secrets/public-key`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/public-key/get(agents/get-org-public-key)`. + func agentsGetOrgPublicKey(_ input: Operations.AgentsGetOrgPublicKey.Input) async throws -> Operations.AgentsGetOrgPublicKey.Output + /// 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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/get(agents/get-org-secret)`. + func agentsGetOrgSecret(_ input: Operations.AgentsGetOrgSecret.Input) async throws -> Operations.AgentsGetOrgSecret.Output + /// 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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/put(agents/create-or-update-org-secret)`. + func agentsCreateOrUpdateOrgSecret(_ input: Operations.AgentsCreateOrUpdateOrgSecret.Input) async throws -> Operations.AgentsCreateOrUpdateOrgSecret.Output + /// 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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/delete(agents/delete-org-secret)`. + func agentsDeleteOrgSecret(_ input: Operations.AgentsDeleteOrgSecret.Input) async throws -> Operations.AgentsDeleteOrgSecret.Output + /// 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}/agents/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/get(agents/list-selected-repos-for-org-secret)`. + func agentsListSelectedReposForOrgSecret(_ input: Operations.AgentsListSelectedReposForOrgSecret.Input) async throws -> Operations.AgentsListSelectedReposForOrgSecret.Output + /// 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/agents/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}/agents/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/put(agents/set-selected-repos-for-org-secret)`. + func agentsSetSelectedReposForOrgSecret(_ input: Operations.AgentsSetSelectedReposForOrgSecret.Input) async throws -> Operations.AgentsSetSelectedReposForOrgSecret.Output + /// 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/agents/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}/agents/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/{repository_id}/put(agents/add-selected-repo-to-org-secret)`. + func agentsAddSelectedRepoToOrgSecret(_ input: Operations.AgentsAddSelectedRepoToOrgSecret.Input) async throws -> Operations.AgentsAddSelectedRepoToOrgSecret.Output + /// 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/agents/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}/agents/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/{repository_id}/delete(agents/remove-selected-repo-from-org-secret)`. + func agentsRemoveSelectedRepoFromOrgSecret(_ input: Operations.AgentsRemoveSelectedRepoFromOrgSecret.Input) async throws -> Operations.AgentsRemoveSelectedRepoFromOrgSecret.Output + /// List organization variables + /// + /// Lists all agent variables available in an organization. + /// Returned variables include their values. + /// + /// 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}/agents/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/get(agents/list-org-variables)`. + func agentsListOrgVariables(_ input: Operations.AgentsListOrgVariables.Input) async throws -> Operations.AgentsListOrgVariables.Output + /// Create an organization variable + /// + /// Creates an organization agent 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}/agents/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/post(agents/create-org-variable)`. + func agentsCreateOrgVariable(_ input: Operations.AgentsCreateOrgVariable.Input) async throws -> Operations.AgentsCreateOrgVariable.Output + /// Get an organization variable + /// + /// Gets a specific agent 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/get(agents/get-org-variable)`. + func agentsGetOrgVariable(_ input: Operations.AgentsGetOrgVariable.Input) async throws -> Operations.AgentsGetOrgVariable.Output + /// Update an organization variable + /// + /// Updates an organization agent 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/patch(agents/update-org-variable)`. + func agentsUpdateOrgVariable(_ input: Operations.AgentsUpdateOrgVariable.Input) async throws -> Operations.AgentsUpdateOrgVariable.Output + /// Delete an organization variable + /// + /// Deletes an organization agent 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/delete(agents/delete-org-variable)`. + func agentsDeleteOrgVariable(_ input: Operations.AgentsDeleteOrgVariable.Input) async throws -> Operations.AgentsDeleteOrgVariable.Output + /// List selected repositories for an organization variable + /// + /// Lists all repositories that can access an organization agent 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}/agents/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/get(agents/list-selected-repos-for-org-variable)`. + func agentsListSelectedReposForOrgVariable(_ input: Operations.AgentsListSelectedReposForOrgVariable.Input) async throws -> Operations.AgentsListSelectedReposForOrgVariable.Output + /// Set selected repositories for an organization variable + /// + /// Replaces all repositories for an organization agent 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}/agents/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/put(agents/set-selected-repos-for-org-variable)`. + func agentsSetSelectedReposForOrgVariable(_ input: Operations.AgentsSetSelectedReposForOrgVariable.Input) async throws -> Operations.AgentsSetSelectedReposForOrgVariable.Output + /// Add selected repository to an organization variable + /// + /// Adds a repository to an organization agent 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 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}/agents/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/{repository_id}/put(agents/add-selected-repo-to-org-variable)`. + func agentsAddSelectedRepoToOrgVariable(_ input: Operations.AgentsAddSelectedRepoToOrgVariable.Input) async throws -> Operations.AgentsAddSelectedRepoToOrgVariable.Output + /// Remove selected repository from an organization variable + /// + /// Removes a repository from an organization agent 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}/agents/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/{repository_id}/delete(agents/remove-selected-repo-from-org-variable)`. + func agentsRemoveSelectedRepoFromOrgVariable(_ input: Operations.AgentsRemoveSelectedRepoFromOrgVariable.Input) async throws -> Operations.AgentsRemoveSelectedRepoFromOrgVariable.Output + /// 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}/agents/organization-secrets`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/organization-secrets/get(agents/list-repo-organization-secrets)`. + func agentsListRepoOrganizationSecrets(_ input: Operations.AgentsListRepoOrganizationSecrets.Input) async throws -> Operations.AgentsListRepoOrganizationSecrets.Output + /// List repository organization variables + /// + /// Lists all organization variables shared with a repository. + /// + /// 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/agents/organization-variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/organization-variables/get(agents/list-repo-organization-variables)`. + func agentsListRepoOrganizationVariables(_ input: Operations.AgentsListRepoOrganizationVariables.Input) async throws -> Operations.AgentsListRepoOrganizationVariables.Output + /// List repository secrets + /// + /// Lists all secrets available in 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}/agents/secrets`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/get(agents/list-repo-secrets)`. + func agentsListRepoSecrets(_ input: Operations.AgentsListRepoSecrets.Input) async throws -> Operations.AgentsListRepoSecrets.Output + /// Get a repository 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. + /// + /// 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}/agents/secrets/public-key`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/public-key/get(agents/get-repo-public-key)`. + func agentsGetRepoPublicKey(_ input: Operations.AgentsGetRepoPublicKey.Input) async throws -> Operations.AgentsGetRepoPublicKey.Output + /// Get a repository secret + /// + /// Gets a single repository secret without revealing its encrypted value. + /// + /// The authenticated user must have collaborator access to the repository 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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/get(agents/get-repo-secret)`. + func agentsGetRepoSecret(_ input: Operations.AgentsGetRepoSecret.Input) async throws -> Operations.AgentsGetRepoSecret.Output + /// Create or update a repository secret + /// + /// Creates or updates a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/put(agents/create-or-update-repo-secret)`. + func agentsCreateOrUpdateRepoSecret(_ input: Operations.AgentsCreateOrUpdateRepoSecret.Input) async throws -> Operations.AgentsCreateOrUpdateRepoSecret.Output + /// Delete a repository secret + /// + /// Deletes a secret in a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/delete(agents/delete-repo-secret)`. + func agentsDeleteRepoSecret(_ input: Operations.AgentsDeleteRepoSecret.Input) async throws -> Operations.AgentsDeleteRepoSecret.Output + /// List repository variables + /// + /// Lists all repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/agents/variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/get(agents/list-repo-variables)`. + func agentsListRepoVariables(_ input: Operations.AgentsListRepoVariables.Input) async throws -> Operations.AgentsListRepoVariables.Output + /// Create a repository variable + /// + /// Creates a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/agents/variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/post(agents/create-repo-variable)`. + func agentsCreateRepoVariable(_ input: Operations.AgentsCreateRepoVariable.Input) async throws -> Operations.AgentsCreateRepoVariable.Output + /// Get a repository variable + /// + /// Gets a specific variable in a repository. + /// + /// The authenticated user must have collaborator access to the repository 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/{name}/get(agents/get-repo-variable)`. + func agentsGetRepoVariable(_ input: Operations.AgentsGetRepoVariable.Input) async throws -> Operations.AgentsGetRepoVariable.Output + /// Update a repository variable + /// + /// Updates a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/{name}/patch(agents/update-repo-variable)`. + func agentsUpdateRepoVariable(_ input: Operations.AgentsUpdateRepoVariable.Input) async throws -> Operations.AgentsUpdateRepoVariable.Output + /// Delete a repository variable + /// + /// Deletes a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/{name}/delete(agents/delete-repo-variable)`. + func agentsDeleteRepoVariable(_ input: Operations.AgentsDeleteRepoVariable.Input) async throws -> Operations.AgentsDeleteRepoVariable.Output +} + +/// Convenience overloads for operation inputs. +extension APIProtocol { + /// 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}/agents/secrets`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/get(agents/list-org-secrets)`. + public func agentsListOrgSecrets( + path: Operations.AgentsListOrgSecrets.Input.Path, + query: Operations.AgentsListOrgSecrets.Input.Query = .init(), + headers: Operations.AgentsListOrgSecrets.Input.Headers = .init() + ) async throws -> Operations.AgentsListOrgSecrets.Output { + try await agentsListOrgSecrets(Operations.AgentsListOrgSecrets.Input( + path: path, + query: query, + headers: headers + )) + } + /// 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. + /// + /// 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}/agents/secrets/public-key`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/public-key/get(agents/get-org-public-key)`. + public func agentsGetOrgPublicKey( + path: Operations.AgentsGetOrgPublicKey.Input.Path, + headers: Operations.AgentsGetOrgPublicKey.Input.Headers = .init() + ) async throws -> Operations.AgentsGetOrgPublicKey.Output { + try await agentsGetOrgPublicKey(Operations.AgentsGetOrgPublicKey.Input( + path: path, + headers: headers + )) + } + /// 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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/get(agents/get-org-secret)`. + public func agentsGetOrgSecret( + path: Operations.AgentsGetOrgSecret.Input.Path, + headers: Operations.AgentsGetOrgSecret.Input.Headers = .init() + ) async throws -> Operations.AgentsGetOrgSecret.Output { + try await agentsGetOrgSecret(Operations.AgentsGetOrgSecret.Input( + path: path, + headers: headers + )) + } + /// 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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/put(agents/create-or-update-org-secret)`. + public func agentsCreateOrUpdateOrgSecret( + path: Operations.AgentsCreateOrUpdateOrgSecret.Input.Path, + headers: Operations.AgentsCreateOrUpdateOrgSecret.Input.Headers = .init(), + body: Operations.AgentsCreateOrUpdateOrgSecret.Input.Body + ) async throws -> Operations.AgentsCreateOrUpdateOrgSecret.Output { + try await agentsCreateOrUpdateOrgSecret(Operations.AgentsCreateOrUpdateOrgSecret.Input( + path: path, + headers: headers, + body: body + )) + } + /// 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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/delete(agents/delete-org-secret)`. + public func agentsDeleteOrgSecret(path: Operations.AgentsDeleteOrgSecret.Input.Path) async throws -> Operations.AgentsDeleteOrgSecret.Output { + try await agentsDeleteOrgSecret(Operations.AgentsDeleteOrgSecret.Input(path: path)) + } + /// 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}/agents/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/get(agents/list-selected-repos-for-org-secret)`. + public func agentsListSelectedReposForOrgSecret( + path: Operations.AgentsListSelectedReposForOrgSecret.Input.Path, + query: Operations.AgentsListSelectedReposForOrgSecret.Input.Query = .init(), + headers: Operations.AgentsListSelectedReposForOrgSecret.Input.Headers = .init() + ) async throws -> Operations.AgentsListSelectedReposForOrgSecret.Output { + try await agentsListSelectedReposForOrgSecret(Operations.AgentsListSelectedReposForOrgSecret.Input( + path: path, + query: query, + headers: headers + )) + } + /// 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/agents/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}/agents/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/put(agents/set-selected-repos-for-org-secret)`. + public func agentsSetSelectedReposForOrgSecret( + path: Operations.AgentsSetSelectedReposForOrgSecret.Input.Path, + body: Operations.AgentsSetSelectedReposForOrgSecret.Input.Body + ) async throws -> Operations.AgentsSetSelectedReposForOrgSecret.Output { + try await agentsSetSelectedReposForOrgSecret(Operations.AgentsSetSelectedReposForOrgSecret.Input( + path: path, + body: body + )) + } + /// 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/agents/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}/agents/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/{repository_id}/put(agents/add-selected-repo-to-org-secret)`. + public func agentsAddSelectedRepoToOrgSecret(path: Operations.AgentsAddSelectedRepoToOrgSecret.Input.Path) async throws -> Operations.AgentsAddSelectedRepoToOrgSecret.Output { + try await agentsAddSelectedRepoToOrgSecret(Operations.AgentsAddSelectedRepoToOrgSecret.Input(path: path)) + } + /// 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/agents/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}/agents/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/{repository_id}/delete(agents/remove-selected-repo-from-org-secret)`. + public func agentsRemoveSelectedRepoFromOrgSecret(path: Operations.AgentsRemoveSelectedRepoFromOrgSecret.Input.Path) async throws -> Operations.AgentsRemoveSelectedRepoFromOrgSecret.Output { + try await agentsRemoveSelectedRepoFromOrgSecret(Operations.AgentsRemoveSelectedRepoFromOrgSecret.Input(path: path)) + } + /// List organization variables + /// + /// Lists all agent variables available in an organization. + /// Returned variables include their values. + /// + /// 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}/agents/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/get(agents/list-org-variables)`. + public func agentsListOrgVariables( + path: Operations.AgentsListOrgVariables.Input.Path, + query: Operations.AgentsListOrgVariables.Input.Query = .init(), + headers: Operations.AgentsListOrgVariables.Input.Headers = .init() + ) async throws -> Operations.AgentsListOrgVariables.Output { + try await agentsListOrgVariables(Operations.AgentsListOrgVariables.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create an organization variable + /// + /// Creates an organization agent 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}/agents/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/post(agents/create-org-variable)`. + public func agentsCreateOrgVariable( + path: Operations.AgentsCreateOrgVariable.Input.Path, + headers: Operations.AgentsCreateOrgVariable.Input.Headers = .init(), + body: Operations.AgentsCreateOrgVariable.Input.Body + ) async throws -> Operations.AgentsCreateOrgVariable.Output { + try await agentsCreateOrgVariable(Operations.AgentsCreateOrgVariable.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get an organization variable + /// + /// Gets a specific agent 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/get(agents/get-org-variable)`. + public func agentsGetOrgVariable( + path: Operations.AgentsGetOrgVariable.Input.Path, + headers: Operations.AgentsGetOrgVariable.Input.Headers = .init() + ) async throws -> Operations.AgentsGetOrgVariable.Output { + try await agentsGetOrgVariable(Operations.AgentsGetOrgVariable.Input( + path: path, + headers: headers + )) + } + /// Update an organization variable + /// + /// Updates an organization agent 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/patch(agents/update-org-variable)`. + public func agentsUpdateOrgVariable( + path: Operations.AgentsUpdateOrgVariable.Input.Path, + body: Operations.AgentsUpdateOrgVariable.Input.Body + ) async throws -> Operations.AgentsUpdateOrgVariable.Output { + try await agentsUpdateOrgVariable(Operations.AgentsUpdateOrgVariable.Input( + path: path, + body: body + )) + } + /// Delete an organization variable + /// + /// Deletes an organization agent 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/delete(agents/delete-org-variable)`. + public func agentsDeleteOrgVariable(path: Operations.AgentsDeleteOrgVariable.Input.Path) async throws -> Operations.AgentsDeleteOrgVariable.Output { + try await agentsDeleteOrgVariable(Operations.AgentsDeleteOrgVariable.Input(path: path)) + } + /// List selected repositories for an organization variable + /// + /// Lists all repositories that can access an organization agent 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}/agents/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/get(agents/list-selected-repos-for-org-variable)`. + public func agentsListSelectedReposForOrgVariable( + path: Operations.AgentsListSelectedReposForOrgVariable.Input.Path, + query: Operations.AgentsListSelectedReposForOrgVariable.Input.Query = .init(), + headers: Operations.AgentsListSelectedReposForOrgVariable.Input.Headers = .init() + ) async throws -> Operations.AgentsListSelectedReposForOrgVariable.Output { + try await agentsListSelectedReposForOrgVariable(Operations.AgentsListSelectedReposForOrgVariable.Input( + path: path, + query: query, + headers: headers + )) + } + /// Set selected repositories for an organization variable + /// + /// Replaces all repositories for an organization agent 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}/agents/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/put(agents/set-selected-repos-for-org-variable)`. + public func agentsSetSelectedReposForOrgVariable( + path: Operations.AgentsSetSelectedReposForOrgVariable.Input.Path, + body: Operations.AgentsSetSelectedReposForOrgVariable.Input.Body + ) async throws -> Operations.AgentsSetSelectedReposForOrgVariable.Output { + try await agentsSetSelectedReposForOrgVariable(Operations.AgentsSetSelectedReposForOrgVariable.Input( + path: path, + body: body + )) + } + /// Add selected repository to an organization variable + /// + /// Adds a repository to an organization agent 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 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}/agents/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/{repository_id}/put(agents/add-selected-repo-to-org-variable)`. + public func agentsAddSelectedRepoToOrgVariable(path: Operations.AgentsAddSelectedRepoToOrgVariable.Input.Path) async throws -> Operations.AgentsAddSelectedRepoToOrgVariable.Output { + try await agentsAddSelectedRepoToOrgVariable(Operations.AgentsAddSelectedRepoToOrgVariable.Input(path: path)) + } + /// Remove selected repository from an organization variable + /// + /// Removes a repository from an organization agent 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}/agents/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/{repository_id}/delete(agents/remove-selected-repo-from-org-variable)`. + public func agentsRemoveSelectedRepoFromOrgVariable(path: Operations.AgentsRemoveSelectedRepoFromOrgVariable.Input.Path) async throws -> Operations.AgentsRemoveSelectedRepoFromOrgVariable.Output { + try await agentsRemoveSelectedRepoFromOrgVariable(Operations.AgentsRemoveSelectedRepoFromOrgVariable.Input(path: path)) + } + /// 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}/agents/organization-secrets`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/organization-secrets/get(agents/list-repo-organization-secrets)`. + public func agentsListRepoOrganizationSecrets( + path: Operations.AgentsListRepoOrganizationSecrets.Input.Path, + query: Operations.AgentsListRepoOrganizationSecrets.Input.Query = .init(), + headers: Operations.AgentsListRepoOrganizationSecrets.Input.Headers = .init() + ) async throws -> Operations.AgentsListRepoOrganizationSecrets.Output { + try await agentsListRepoOrganizationSecrets(Operations.AgentsListRepoOrganizationSecrets.Input( + path: path, + query: query, + headers: headers + )) + } + /// List repository organization variables + /// + /// Lists all organization variables shared with a repository. + /// + /// 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/agents/organization-variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/organization-variables/get(agents/list-repo-organization-variables)`. + public func agentsListRepoOrganizationVariables( + path: Operations.AgentsListRepoOrganizationVariables.Input.Path, + query: Operations.AgentsListRepoOrganizationVariables.Input.Query = .init(), + headers: Operations.AgentsListRepoOrganizationVariables.Input.Headers = .init() + ) async throws -> Operations.AgentsListRepoOrganizationVariables.Output { + try await agentsListRepoOrganizationVariables(Operations.AgentsListRepoOrganizationVariables.Input( + path: path, + query: query, + headers: headers + )) + } + /// List repository secrets + /// + /// Lists all secrets available in 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}/agents/secrets`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/get(agents/list-repo-secrets)`. + public func agentsListRepoSecrets( + path: Operations.AgentsListRepoSecrets.Input.Path, + query: Operations.AgentsListRepoSecrets.Input.Query = .init(), + headers: Operations.AgentsListRepoSecrets.Input.Headers = .init() + ) async throws -> Operations.AgentsListRepoSecrets.Output { + try await agentsListRepoSecrets(Operations.AgentsListRepoSecrets.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get a repository 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. + /// + /// 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}/agents/secrets/public-key`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/public-key/get(agents/get-repo-public-key)`. + public func agentsGetRepoPublicKey( + path: Operations.AgentsGetRepoPublicKey.Input.Path, + headers: Operations.AgentsGetRepoPublicKey.Input.Headers = .init() + ) async throws -> Operations.AgentsGetRepoPublicKey.Output { + try await agentsGetRepoPublicKey(Operations.AgentsGetRepoPublicKey.Input( + path: path, + headers: headers + )) + } + /// Get a repository secret + /// + /// Gets a single repository secret without revealing its encrypted value. + /// + /// The authenticated user must have collaborator access to the repository 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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/get(agents/get-repo-secret)`. + public func agentsGetRepoSecret( + path: Operations.AgentsGetRepoSecret.Input.Path, + headers: Operations.AgentsGetRepoSecret.Input.Headers = .init() + ) async throws -> Operations.AgentsGetRepoSecret.Output { + try await agentsGetRepoSecret(Operations.AgentsGetRepoSecret.Input( + path: path, + headers: headers + )) + } + /// Create or update a repository secret + /// + /// Creates or updates a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/put(agents/create-or-update-repo-secret)`. + public func agentsCreateOrUpdateRepoSecret( + path: Operations.AgentsCreateOrUpdateRepoSecret.Input.Path, + headers: Operations.AgentsCreateOrUpdateRepoSecret.Input.Headers = .init(), + body: Operations.AgentsCreateOrUpdateRepoSecret.Input.Body + ) async throws -> Operations.AgentsCreateOrUpdateRepoSecret.Output { + try await agentsCreateOrUpdateRepoSecret(Operations.AgentsCreateOrUpdateRepoSecret.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete a repository secret + /// + /// Deletes a secret in a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/delete(agents/delete-repo-secret)`. + public func agentsDeleteRepoSecret(path: Operations.AgentsDeleteRepoSecret.Input.Path) async throws -> Operations.AgentsDeleteRepoSecret.Output { + try await agentsDeleteRepoSecret(Operations.AgentsDeleteRepoSecret.Input(path: path)) + } + /// List repository variables + /// + /// Lists all repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/agents/variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/get(agents/list-repo-variables)`. + public func agentsListRepoVariables( + path: Operations.AgentsListRepoVariables.Input.Path, + query: Operations.AgentsListRepoVariables.Input.Query = .init(), + headers: Operations.AgentsListRepoVariables.Input.Headers = .init() + ) async throws -> Operations.AgentsListRepoVariables.Output { + try await agentsListRepoVariables(Operations.AgentsListRepoVariables.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create a repository variable + /// + /// Creates a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/agents/variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/post(agents/create-repo-variable)`. + public func agentsCreateRepoVariable( + path: Operations.AgentsCreateRepoVariable.Input.Path, + headers: Operations.AgentsCreateRepoVariable.Input.Headers = .init(), + body: Operations.AgentsCreateRepoVariable.Input.Body + ) async throws -> Operations.AgentsCreateRepoVariable.Output { + try await agentsCreateRepoVariable(Operations.AgentsCreateRepoVariable.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get a repository variable + /// + /// Gets a specific variable in a repository. + /// + /// The authenticated user must have collaborator access to the repository 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/{name}/get(agents/get-repo-variable)`. + public func agentsGetRepoVariable( + path: Operations.AgentsGetRepoVariable.Input.Path, + headers: Operations.AgentsGetRepoVariable.Input.Headers = .init() + ) async throws -> Operations.AgentsGetRepoVariable.Output { + try await agentsGetRepoVariable(Operations.AgentsGetRepoVariable.Input( + path: path, + headers: headers + )) + } + /// Update a repository variable + /// + /// Updates a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/{name}/patch(agents/update-repo-variable)`. + public func agentsUpdateRepoVariable( + path: Operations.AgentsUpdateRepoVariable.Input.Path, + body: Operations.AgentsUpdateRepoVariable.Input.Body + ) async throws -> Operations.AgentsUpdateRepoVariable.Output { + try await agentsUpdateRepoVariable(Operations.AgentsUpdateRepoVariable.Input( + path: path, + body: body + )) + } + /// Delete a repository variable + /// + /// Deletes a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/{name}/delete(agents/delete-repo-variable)`. + public func agentsDeleteRepoVariable(path: Operations.AgentsDeleteRepoVariable.Input.Path) async throws -> Operations.AgentsDeleteRepoVariable.Output { + try await agentsDeleteRepoVariable(Operations.AgentsDeleteRepoVariable.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 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" + } + } + /// Code Of Conduct + /// + /// - Remark: Generated from `#/components/schemas/code-of-conduct`. + public struct CodeOfConduct: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/code-of-conduct/key`. + public var key: Swift.String + /// - Remark: Generated from `#/components/schemas/code-of-conduct/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/code-of-conduct/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/code-of-conduct/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/code-of-conduct/html_url`. + public var htmlUrl: Swift.String? + /// Creates a new `CodeOfConduct`. + /// + /// - Parameters: + /// - key: + /// - name: + /// - url: + /// - body: + /// - htmlUrl: + public init( + key: Swift.String, + name: Swift.String, + url: Swift.String, + body: Swift.String? = nil, + htmlUrl: Swift.String? = nil + ) { + self.key = key + self.name = name + self.url = url + self.body = body + self.htmlUrl = htmlUrl + } + public enum CodingKeys: String, CodingKey { + case key + case name + case url + case body + case htmlUrl = "html_url" + } + } + /// - 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`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/advanced_security/status`. + public var status: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload.StatusPayload? + /// Creates a new `AdvancedSecurityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + 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`. + public struct CodeSecurityPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security/status`. + public var status: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload.StatusPayload? + /// Creates a new `CodeSecurityPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/code_security`. + public var codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? + /// Enable or disable Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. + public struct DependabotSecurityUpdatesPayload: Codable, Hashable, Sendable { + /// The enablement status of Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// The enablement status of Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates/status`. + public var status: Components.Schemas.SecurityAndAnalysis.DependabotSecurityUpdatesPayload.StatusPayload? + /// Creates a new `DependabotSecurityUpdatesPayload`. + /// + /// - Parameters: + /// - status: The enablement status of Dependabot security updates for the repository. + public init(status: Components.Schemas.SecurityAndAnalysis.DependabotSecurityUpdatesPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// Enable or disable Dependabot security updates for the repository. + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/dependabot_security_updates`. + public var dependabotSecurityUpdates: Components.Schemas.SecurityAndAnalysis.DependabotSecurityUpdatesPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. + public struct SecretScanningPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload.StatusPayload? + /// Creates a new `SecretScanningPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning`. + public var secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. + public struct SecretScanningPushProtectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload.StatusPayload? + /// Creates a new `SecretScanningPushProtectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_push_protection`. + public var secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. + public struct SecretScanningNonProviderPatternsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload.StatusPayload? + /// Creates a new `SecretScanningNonProviderPatternsPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_non_provider_patterns`. + public var secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public struct SecretScanningAiDetectionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload.StatusPayload? + /// Creates a new `SecretScanningAiDetectionPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_ai_detection`. + public var secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public struct SecretScanningDelegatedAlertDismissalPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedAlertDismissalPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_alert_dismissal`. + public var secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public struct SecretScanningDelegatedBypassPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass/status`. + public var status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? + /// Creates a new `SecretScanningDelegatedBypassPayload`. + /// + /// - Parameters: + /// - status: + public init(status: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload.StatusPayload? = nil) { + self.status = status + } + public enum CodingKeys: String, CodingKey { + case status + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass`. + public var secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public struct SecretScanningDelegatedBypassOptionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload`. + public struct ReviewersPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the team or role selected as a bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_id`. + public var reviewerId: Swift.Int + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + @frozen public enum ReviewerTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case team = "TEAM" + case role = "ROLE" + } + /// The type of the bypass reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/reviewer_type`. + public var reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload + /// The bypass mode for the reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/mode`. + @frozen public enum ModePayload: String, Codable, Hashable, Sendable, CaseIterable { + case always = "ALWAYS" + case exempt = "EXEMPT" + } + /// The bypass mode for the reviewer + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/ReviewersPayload/mode`. + public var mode: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ModePayload? + /// Creates a new `ReviewersPayloadPayload`. + /// + /// - Parameters: + /// - reviewerId: The ID of the team or role selected as a bypass reviewer + /// - reviewerType: The type of the bypass reviewer + /// - mode: The bypass mode for the reviewer + public init( + reviewerId: Swift.Int, + reviewerType: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ReviewerTypePayload, + mode: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload.ModePayload? = nil + ) { + self.reviewerId = reviewerId + self.reviewerType = reviewerType + self.mode = mode + } + public enum CodingKeys: String, CodingKey { + case reviewerId = "reviewer_id" + case reviewerType = "reviewer_type" + case mode + } + } + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public typealias ReviewersPayload = [Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayloadPayload] + /// The bypass reviewers for secret scanning delegated bypass + /// + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options/reviewers`. + public var reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? + /// Creates a new `SecretScanningDelegatedBypassOptionsPayload`. + /// + /// - Parameters: + /// - reviewers: The bypass reviewers for secret scanning delegated bypass + public init(reviewers: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload.ReviewersPayload? = nil) { + self.reviewers = reviewers + } + public enum CodingKeys: String, CodingKey { + case reviewers + } + } + /// - Remark: Generated from `#/components/schemas/security-and-analysis/secret_scanning_delegated_bypass_options`. + public var secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? + /// Creates a new `SecurityAndAnalysis`. + /// + /// - Parameters: + /// - advancedSecurity: Enable or disable GitHub Advanced Security for the repository. + /// - codeSecurity: + /// - dependabotSecurityUpdates: Enable or disable Dependabot security updates for the repository. + /// - secretScanning: + /// - secretScanningPushProtection: + /// - secretScanningNonProviderPatterns: + /// - secretScanningAiDetection: + /// - secretScanningDelegatedAlertDismissal: + /// - secretScanningDelegatedBypass: + /// - secretScanningDelegatedBypassOptions: + public init( + advancedSecurity: Components.Schemas.SecurityAndAnalysis.AdvancedSecurityPayload? = nil, + codeSecurity: Components.Schemas.SecurityAndAnalysis.CodeSecurityPayload? = nil, + dependabotSecurityUpdates: Components.Schemas.SecurityAndAnalysis.DependabotSecurityUpdatesPayload? = nil, + secretScanning: Components.Schemas.SecurityAndAnalysis.SecretScanningPayload? = nil, + secretScanningPushProtection: Components.Schemas.SecurityAndAnalysis.SecretScanningPushProtectionPayload? = nil, + secretScanningNonProviderPatterns: Components.Schemas.SecurityAndAnalysis.SecretScanningNonProviderPatternsPayload? = nil, + secretScanningAiDetection: Components.Schemas.SecurityAndAnalysis.SecretScanningAiDetectionPayload? = nil, + secretScanningDelegatedAlertDismissal: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedAlertDismissalPayload? = nil, + secretScanningDelegatedBypass: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassPayload? = nil, + secretScanningDelegatedBypassOptions: Components.Schemas.SecurityAndAnalysis.SecretScanningDelegatedBypassOptionsPayload? = nil + ) { + self.advancedSecurity = advancedSecurity + self.codeSecurity = codeSecurity + self.dependabotSecurityUpdates = dependabotSecurityUpdates + self.secretScanning = secretScanning + self.secretScanningPushProtection = secretScanningPushProtection + self.secretScanningNonProviderPatterns = secretScanningNonProviderPatterns + self.secretScanningAiDetection = secretScanningAiDetection + self.secretScanningDelegatedAlertDismissal = secretScanningDelegatedAlertDismissal + self.secretScanningDelegatedBypass = secretScanningDelegatedBypass + self.secretScanningDelegatedBypassOptions = secretScanningDelegatedBypassOptions + } + public enum CodingKeys: String, CodingKey { + case advancedSecurity = "advanced_security" + case codeSecurity = "code_security" + case dependabotSecurityUpdates = "dependabot_security_updates" + case secretScanning = "secret_scanning" + case secretScanningPushProtection = "secret_scanning_push_protection" + case secretScanningNonProviderPatterns = "secret_scanning_non_provider_patterns" + case secretScanningAiDetection = "secret_scanning_ai_detection" + case secretScanningDelegatedAlertDismissal = "secret_scanning_delegated_alert_dismissal" + case secretScanningDelegatedBypass = "secret_scanning_delegated_bypass" + case secretScanningDelegatedBypassOptions = "secret_scanning_delegated_bypass_options" + } + } + /// Minimal Repository + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository`. + public struct MinimalRepository: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/minimal-repository/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/minimal-repository/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/full_name`. + public var fullName: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/owner`. + public var owner: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/minimal-repository/private`. + public var _private: Swift.Bool + /// - Remark: Generated from `#/components/schemas/minimal-repository/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/fork`. + public var fork: Swift.Bool + /// - Remark: Generated from `#/components/schemas/minimal-repository/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/archive_url`. + public var archiveUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/assignees_url`. + public var assigneesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/blobs_url`. + public var blobsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/branches_url`. + public var branchesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/collaborators_url`. + public var collaboratorsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/commits_url`. + public var commitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/compare_url`. + public var compareUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/contents_url`. + public var contentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/contributors_url`. + public var contributorsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/deployments_url`. + public var deploymentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/downloads_url`. + public var downloadsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/forks_url`. + public var forksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/git_commits_url`. + public var gitCommitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/git_refs_url`. + public var gitRefsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/git_tags_url`. + public var gitTagsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/git_url`. + public var gitUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/issue_comment_url`. + public var issueCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/issue_events_url`. + public var issueEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/issues_url`. + public var issuesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/keys_url`. + public var keysUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/labels_url`. + public var labelsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/languages_url`. + public var languagesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/merges_url`. + public var mergesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/milestones_url`. + public var milestonesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/notifications_url`. + public var notificationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/pulls_url`. + public var pullsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/releases_url`. + public var releasesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/ssh_url`. + public var sshUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/stargazers_url`. + public var stargazersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/subscribers_url`. + public var subscribersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/subscription_url`. + public var subscriptionUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/tags_url`. + public var tagsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/teams_url`. + public var teamsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/trees_url`. + public var treesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/clone_url`. + public var cloneUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/mirror_url`. + public var mirrorUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/hooks_url`. + public var hooksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/minimal-repository/svn_url`. + public var svnUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/homepage`. + public var homepage: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/language`. + public var language: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/forks_count`. + public var forksCount: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/stargazers_count`. + public var stargazersCount: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-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/minimal-repository/size`. + public var size: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/default_branch`. + public var defaultBranch: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/open_issues_count`. + public var openIssuesCount: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/is_template`. + public var isTemplate: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/topics`. + public var topics: [Swift.String]? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_issues`. + public var hasIssues: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_projects`. + public var hasProjects: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_wiki`. + public var hasWiki: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pages`. + public var hasPages: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_downloads`. + public var hasDownloads: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_discussions`. + public var hasDiscussions: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. + public var archived: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. + public var disabled: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/visibility`. + public var visibility: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/pushed_at`. + public var pushedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/minimal-repository/created_at`. + public var createdAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/minimal-repository/updated_at`. + public var updatedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/admin`. + public var admin: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/maintain`. + public var maintain: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/push`. + public var push: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/triage`. + public var triage: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions/pull`. + public var pull: Swift.Bool? + /// Creates a new `PermissionsPayload`. + /// + /// - Parameters: + /// - admin: + /// - maintain: + /// - push: + /// - triage: + /// - pull: + public init( + admin: Swift.Bool? = nil, + maintain: Swift.Bool? = nil, + push: Swift.Bool? = nil, + triage: Swift.Bool? = nil, + pull: Swift.Bool? = nil + ) { + self.admin = admin + self.maintain = maintain + self.push = push + self.triage = triage + self.pull = pull + } + public enum CodingKeys: String, CodingKey { + case admin + case maintain + case push + case triage + case pull + } + } + /// - Remark: Generated from `#/components/schemas/minimal-repository/permissions`. + public var permissions: Components.Schemas.MinimalRepository.PermissionsPayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/role_name`. + public var roleName: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/temp_clone_token`. + public var tempCloneToken: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/delete_branch_on_merge`. + public var deleteBranchOnMerge: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/subscribers_count`. + public var subscribersCount: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/network_count`. + public var networkCount: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/code_of_conduct`. + public var codeOfConduct: Components.Schemas.CodeOfConduct? + /// - Remark: Generated from `#/components/schemas/minimal-repository/license`. + public struct LicensePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/minimal-repository/license/key`. + public var key: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/license/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/license/spdx_id`. + public var spdxId: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/license/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/minimal-repository/license/node_id`. + public var nodeId: Swift.String? + /// Creates a new `LicensePayload`. + /// + /// - Parameters: + /// - key: + /// - name: + /// - spdxId: + /// - url: + /// - nodeId: + public init( + key: Swift.String? = nil, + name: Swift.String? = nil, + spdxId: Swift.String? = nil, + url: Swift.String? = nil, + nodeId: Swift.String? = nil + ) { + self.key = key + self.name = name + self.spdxId = spdxId + self.url = url + self.nodeId = nodeId + } + public enum CodingKeys: String, CodingKey { + case key + case name + case spdxId = "spdx_id" + case url + case nodeId = "node_id" + } + } + /// - Remark: Generated from `#/components/schemas/minimal-repository/license`. + public var license: Components.Schemas.MinimalRepository.LicensePayload? + /// - Remark: Generated from `#/components/schemas/minimal-repository/forks`. + public var forks: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/open_issues`. + public var openIssues: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/watchers`. + public var watchers: Swift.Int? + /// - Remark: Generated from `#/components/schemas/minimal-repository/allow_forking`. + public var allowForking: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/minimal-repository/web_commit_signoff_required`. + 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 Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.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: + /// - 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: + /// - openIssuesCount: + /// - isTemplate: + /// - topics: + /// - hasIssues: + /// - hasProjects: + /// - hasWiki: + /// - hasPages: + /// - hasDownloads: + /// - hasDiscussions: + /// - hasPullRequests: + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - archived: + /// - disabled: + /// - visibility: + /// - pushedAt: + /// - createdAt: + /// - updatedAt: + /// - permissions: + /// - roleName: + /// - tempCloneToken: + /// - deleteBranchOnMerge: + /// - subscribersCount: + /// - networkCount: + /// - codeOfConduct: + /// - license: + /// - forks: + /// - openIssues: + /// - watchers: + /// - 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, + 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, + gitUrl: Swift.String? = nil, + 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? = nil, + stargazersUrl: Swift.String, + statusesUrl: Swift.String, + subscribersUrl: Swift.String, + subscriptionUrl: Swift.String, + tagsUrl: Swift.String, + teamsUrl: Swift.String, + treesUrl: Swift.String, + cloneUrl: Swift.String? = nil, + mirrorUrl: Swift.String? = nil, + hooksUrl: Swift.String, + svnUrl: Swift.String? = nil, + homepage: Swift.String? = nil, + language: Swift.String? = nil, + forksCount: Swift.Int? = nil, + stargazersCount: Swift.Int? = nil, + watchersCount: Swift.Int? = nil, + size: Swift.Int? = nil, + defaultBranch: Swift.String? = nil, + openIssuesCount: Swift.Int? = nil, + isTemplate: Swift.Bool? = nil, + topics: [Swift.String]? = nil, + hasIssues: Swift.Bool? = nil, + hasProjects: Swift.Bool? = nil, + hasWiki: Swift.Bool? = nil, + hasPages: Swift.Bool? = nil, + hasDownloads: Swift.Bool? = nil, + hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, + archived: Swift.Bool? = nil, + disabled: Swift.Bool? = nil, + visibility: Swift.String? = nil, + pushedAt: Foundation.Date? = nil, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + permissions: Components.Schemas.MinimalRepository.PermissionsPayload? = nil, + roleName: Swift.String? = nil, + tempCloneToken: Swift.String? = nil, + deleteBranchOnMerge: Swift.Bool? = nil, + subscribersCount: Swift.Int? = nil, + networkCount: Swift.Int? = nil, + codeOfConduct: Components.Schemas.CodeOfConduct? = nil, + license: Components.Schemas.MinimalRepository.LicensePayload? = nil, + forks: Swift.Int? = nil, + openIssues: Swift.Int? = nil, + watchers: Swift.Int? = nil, + allowForking: Swift.Bool? = nil, + webCommitSignoffRequired: Swift.Bool? = nil, + securityAndAnalysis: Components.Schemas.SecurityAndAnalysis? = nil, + customProperties: Components.Schemas.MinimalRepository.CustomPropertiesPayload? = nil + ) { + self.id = id + self.nodeId = nodeId + self.name = name + self.fullName = fullName + 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.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.archived = archived + self.disabled = disabled + self.visibility = visibility + self.pushedAt = pushedAt + self.createdAt = createdAt + self.updatedAt = updatedAt + self.permissions = permissions + self.roleName = roleName + self.tempCloneToken = tempCloneToken + self.deleteBranchOnMerge = deleteBranchOnMerge + self.subscribersCount = subscribersCount + self.networkCount = networkCount + self.codeOfConduct = codeOfConduct + self.license = license + self.forks = forks + self.openIssues = openIssues + self.watchers = watchers + self.allowForking = allowForking + self.webCommitSignoffRequired = webCommitSignoffRequired + self.securityAndAnalysis = securityAndAnalysis + self.customProperties = customProperties + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case name + case fullName = "full_name" + 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 hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case archived + case disabled + case visibility + case pushedAt = "pushed_at" + case createdAt = "created_at" + case updatedAt = "updated_at" + case permissions + case roleName = "role_name" + case tempCloneToken = "temp_clone_token" + case deleteBranchOnMerge = "delete_branch_on_merge" + case subscribersCount = "subscribers_count" + case networkCount = "network_count" + case codeOfConduct = "code_of_conduct" + case license + case forks + case openIssues = "open_issues" + case watchers + 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 Swift.Decoder) throws { + try decoder.ensureNoAdditionalProperties(knownKeys: []) + } + } + /// Secrets for GitHub Actions for an organization. + /// + /// - Remark: Generated from `#/components/schemas/organization-actions-secret`. + public struct OrganizationActionsSecret: Codable, Hashable, Sendable { + /// The name of the secret. + /// + /// - Remark: Generated from `#/components/schemas/organization-actions-secret/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/organization-actions-secret/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/organization-actions-secret/updated_at`. + public var updatedAt: Foundation.Date + /// Visibility of a secret + /// + /// - Remark: Generated from `#/components/schemas/organization-actions-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-actions-secret/visibility`. + public var visibility: Components.Schemas.OrganizationActionsSecret.VisibilityPayload + /// - Remark: Generated from `#/components/schemas/organization-actions-secret/selected_repositories_url`. + public var selectedRepositoriesUrl: Swift.String? + /// Creates a new `OrganizationActionsSecret`. + /// + /// - 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.OrganizationActionsSecret.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 Actions Secrets. + /// + /// - Remark: Generated from `#/components/schemas/actions-public-key`. + public struct ActionsPublicKey: Codable, Hashable, Sendable { + /// The identifier for the key. + /// + /// - Remark: Generated from `#/components/schemas/actions-public-key/key_id`. + public var keyId: Swift.String + /// The Base64 encoded public key. + /// + /// - Remark: Generated from `#/components/schemas/actions-public-key/key`. + public var key: Swift.String + /// - Remark: Generated from `#/components/schemas/actions-public-key/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/components/schemas/actions-public-key/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/actions-public-key/title`. + public var title: Swift.String? + /// - Remark: Generated from `#/components/schemas/actions-public-key/created_at`. + public var createdAt: Swift.String? + /// Creates a new `ActionsPublicKey`. + /// + /// - Parameters: + /// - keyId: The identifier for the key. + /// - key: The Base64 encoded public key. + /// - id: + /// - url: + /// - title: + /// - createdAt: + public init( + keyId: Swift.String, + key: Swift.String, + id: Swift.Int? = nil, + url: Swift.String? = nil, + title: Swift.String? = nil, + createdAt: Swift.String? = nil + ) { + self.keyId = keyId + self.key = key + self.id = id + self.url = url + self.title = title + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey { + case keyId = "key_id" + case key + case id + case url + case title + case createdAt = "created_at" + } + } + /// Organization variable for GitHub Actions. + /// + /// - Remark: Generated from `#/components/schemas/organization-actions-variable`. + public struct OrganizationActionsVariable: Codable, Hashable, Sendable { + /// The name of the variable. + /// + /// - Remark: Generated from `#/components/schemas/organization-actions-variable/name`. + public var name: Swift.String + /// The value of the variable. + /// + /// - Remark: Generated from `#/components/schemas/organization-actions-variable/value`. + public var value: Swift.String + /// The date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// + /// - Remark: Generated from `#/components/schemas/organization-actions-variable/created_at`. + public var createdAt: Foundation.Date + /// The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// + /// - Remark: Generated from `#/components/schemas/organization-actions-variable/updated_at`. + public var updatedAt: Foundation.Date + /// Visibility of a variable + /// + /// - Remark: Generated from `#/components/schemas/organization-actions-variable/visibility`. + @frozen public enum VisibilityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case _private = "private" + case selected = "selected" + } + /// Visibility of a variable + /// + /// - Remark: Generated from `#/components/schemas/organization-actions-variable/visibility`. + public var visibility: Components.Schemas.OrganizationActionsVariable.VisibilityPayload + /// - Remark: Generated from `#/components/schemas/organization-actions-variable/selected_repositories_url`. + public var selectedRepositoriesUrl: Swift.String? + /// Creates a new `OrganizationActionsVariable`. + /// + /// - Parameters: + /// - name: The name of the variable. + /// - value: The value of the variable. + /// - createdAt: The date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// - updatedAt: The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// - visibility: Visibility of a variable + /// - selectedRepositoriesUrl: + public init( + name: Swift.String, + value: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + visibility: Components.Schemas.OrganizationActionsVariable.VisibilityPayload, + selectedRepositoriesUrl: Swift.String? = nil + ) { + self.name = name + self.value = value + self.createdAt = createdAt + self.updatedAt = updatedAt + self.visibility = visibility + self.selectedRepositoriesUrl = selectedRepositoriesUrl + } + public enum CodingKeys: String, CodingKey { + case name + case value + case createdAt = "created_at" + case updatedAt = "updated_at" + case visibility + case selectedRepositoriesUrl = "selected_repositories_url" + } + } + /// Set secrets for GitHub Actions. + /// + /// - Remark: Generated from `#/components/schemas/actions-secret`. + public struct ActionsSecret: Codable, Hashable, Sendable { + /// The name of the secret. + /// + /// - Remark: Generated from `#/components/schemas/actions-secret/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/actions-secret/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/actions-secret/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `ActionsSecret`. + /// + /// - 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" + } + } + /// - Remark: Generated from `#/components/schemas/actions-variable`. + public struct ActionsVariable: Codable, Hashable, Sendable { + /// The name of the variable. + /// + /// - Remark: Generated from `#/components/schemas/actions-variable/name`. + public var name: Swift.String + /// The value of the variable. + /// + /// - Remark: Generated from `#/components/schemas/actions-variable/value`. + public var value: Swift.String + /// The date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// + /// - Remark: Generated from `#/components/schemas/actions-variable/created_at`. + public var createdAt: Foundation.Date + /// The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// + /// - Remark: Generated from `#/components/schemas/actions-variable/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `ActionsVariable`. + /// + /// - Parameters: + /// - name: The name of the variable. + /// - value: The value of the variable. + /// - createdAt: The date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + /// - updatedAt: The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + public init( + name: Swift.String, + value: Swift.String, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.name = name + self.value = value + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case name + case value + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + } + /// 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 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 + /// 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 `#/components/parameters/variables-per-page`. + public typealias VariablesPerPage = Swift.Int + /// The name of the variable. + /// + /// - Remark: Generated from `#/components/parameters/variable-name`. + public typealias VariableName = 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 { + /// - 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 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}/agents/secrets`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/get(agents/list-org-secrets)`. + public enum AgentsListOrgSecrets { + public static let id: Swift.String = "agents/list-org-secrets" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/secrets/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsListOrgSecrets.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/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}/agents/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.AgentsListOrgSecrets.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsListOrgSecrets.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.AgentsListOrgSecrets.Input.Path, + query: Operations.AgentsListOrgSecrets.Input.Query = .init(), + headers: Operations.AgentsListOrgSecrets.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}/agents/secrets/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsListOrgSecrets.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/agents/secrets/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/secrets/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/secrets/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/secrets/GET/responses/200/content/application\/json`. + case json(Operations.AgentsListOrgSecrets.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.AgentsListOrgSecrets.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentsListOrgSecrets.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.AgentsListOrgSecrets.Output.Ok.Headers = .init(), + body: Operations.AgentsListOrgSecrets.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/get(agents/list-org-secrets)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentsListOrgSecrets.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.AgentsListOrgSecrets.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. + /// + /// 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}/agents/secrets/public-key`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/public-key/get(agents/get-org-public-key)`. + public enum AgentsGetOrgPublicKey { + public static let id: Swift.String = "agents/get-org-public-key" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/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.AgentsGetOrgPublicKey.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsGetOrgPublicKey.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.AgentsGetOrgPublicKey.Input.Path, + headers: Operations.AgentsGetOrgPublicKey.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}/agents/secrets/public-key/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsGetOrgPublicKey.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentsGetOrgPublicKey.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/public-key/get(agents/get-org-public-key)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentsGetOrgPublicKey.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.AgentsGetOrgPublicKey.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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/get(agents/get-org-secret)`. + public enum AgentsGetOrgSecret { + public static let id: Swift.String = "agents/get-org-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/secrets/{secret_name}/GET/path/org`. + public var org: Components.Parameters.Org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsGetOrgSecret.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsGetOrgSecret.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.AgentsGetOrgSecret.Input.Path, + headers: Operations.AgentsGetOrgSecret.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}/agents/secrets/{secret_name}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsGetOrgSecret.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentsGetOrgSecret.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/get(agents/get-org-secret)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentsGetOrgSecret.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.AgentsGetOrgSecret.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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/put(agents/create-or-update-org-secret)`. + public enum AgentsCreateOrUpdateOrgSecret { + public static let id: Swift.String = "agents/create-or-update-org-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/secrets/{secret_name}/PUT/path/org`. + public var org: Components.Parameters.Org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsCreateOrUpdateOrgSecret.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsCreateOrUpdateOrgSecret.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/agents/secrets/{secret_name}/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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/agents/secrets#get-an-organization-public-key) endpoint. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/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}/agents/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}/agents/secrets/{secret_name}/PUT/requestBody/json/visibility`. + public var visibility: Operations.AgentsCreateOrUpdateOrgSecret.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/agents/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/agents/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/agents/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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/agents/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/agents/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/agents/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/agents/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + public init( + encryptedValue: Swift.String, + keyId: Swift.String, + visibility: Operations.AgentsCreateOrUpdateOrgSecret.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}/agents/secrets/{secret_name}/PUT/requestBody/content/application\/json`. + case json(Operations.AgentsCreateOrUpdateOrgSecret.Input.Body.JsonPayload) + } + public var body: Operations.AgentsCreateOrUpdateOrgSecret.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.AgentsCreateOrUpdateOrgSecret.Input.Path, + headers: Operations.AgentsCreateOrUpdateOrgSecret.Input.Headers = .init(), + body: Operations.AgentsCreateOrUpdateOrgSecret.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}/agents/secrets/{secret_name}/PUT/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsCreateOrUpdateOrgSecret.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentsCreateOrUpdateOrgSecret.Output.Created.Body) { + self.body = body + } + } + /// Response when creating a secret + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/put(agents/create-or-update-org-secret)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.AgentsCreateOrUpdateOrgSecret.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.AgentsCreateOrUpdateOrgSecret.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}/agents/secrets/{secret_name}/put(agents/create-or-update-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.AgentsCreateOrUpdateOrgSecret.Output.NoContent) + /// Response when updating a secret + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/put(agents/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.AgentsCreateOrUpdateOrgSecret.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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/delete(agents/delete-org-secret)`. + public enum AgentsDeleteOrgSecret { + public static let id: Swift.String = "agents/delete-org-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/secrets/{secret_name}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsDeleteOrgSecret.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.AgentsDeleteOrgSecret.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}/agents/secrets/{secret_name}/delete(agents/delete-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.AgentsDeleteOrgSecret.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/delete(agents/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.AgentsDeleteOrgSecret.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}/agents/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/get(agents/list-selected-repos-for-org-secret)`. + public enum AgentsListSelectedReposForOrgSecret { + public static let id: Swift.String = "agents/list-selected-repos-for-org-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/secrets/{secret_name}/repositories/GET/path/org`. + public var org: Components.Parameters.Org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsListSelectedReposForOrgSecret.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/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}/agents/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.AgentsListSelectedReposForOrgSecret.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsListSelectedReposForOrgSecret.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.AgentsListSelectedReposForOrgSecret.Input.Path, + query: Operations.AgentsListSelectedReposForOrgSecret.Input.Query = .init(), + headers: Operations.AgentsListSelectedReposForOrgSecret.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}/agents/secrets/{secret_name}/repositories/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/secrets/{secret_name}/repositories/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/secrets/{secret_name}/repositories/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/secrets/{secret_name}/repositories/GET/responses/200/content/application\/json`. + case json(Operations.AgentsListSelectedReposForOrgSecret.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.AgentsListSelectedReposForOrgSecret.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentsListSelectedReposForOrgSecret.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentsListSelectedReposForOrgSecret.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/get(agents/list-selected-repos-for-org-secret)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentsListSelectedReposForOrgSecret.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.AgentsListSelectedReposForOrgSecret.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/agents/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}/agents/secrets/{secret_name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/put(agents/set-selected-repos-for-org-secret)`. + public enum AgentsSetSelectedReposForOrgSecret { + public static let id: Swift.String = "agents/set-selected-repos-for-org-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/secrets/{secret_name}/repositories/PUT/path/org`. + public var org: Components.Parameters.Org + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsSetSelectedReposForOrgSecret.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/agents/secrets/{secret_name}/repositories/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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/agents/secrets#add-selected-repository-to-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/agents/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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/agents/secrets#add-selected-repository-to-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/agents/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}/agents/secrets/{secret_name}/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.AgentsSetSelectedReposForOrgSecret.Input.Body.JsonPayload) + } + public var body: Operations.AgentsSetSelectedReposForOrgSecret.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.AgentsSetSelectedReposForOrgSecret.Input.Path, + body: Operations.AgentsSetSelectedReposForOrgSecret.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}/agents/secrets/{secret_name}/repositories/put(agents/set-selected-repos-for-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.AgentsSetSelectedReposForOrgSecret.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/put(agents/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.AgentsSetSelectedReposForOrgSecret.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/agents/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}/agents/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/{repository_id}/put(agents/add-selected-repo-to-org-secret)`. + public enum AgentsAddSelectedRepoToOrgSecret { + public static let id: Swift.String = "agents/add-selected-repo-to-org-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/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}/agents/secrets/{secret_name}/repositories/{repository_id}/PUT/path/secret_name`. + public var secretName: Components.Parameters.SecretName + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsAddSelectedRepoToOrgSecret.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.AgentsAddSelectedRepoToOrgSecret.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}/agents/secrets/{secret_name}/repositories/{repository_id}/put(agents/add-selected-repo-to-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.AgentsAddSelectedRepoToOrgSecret.Output.NoContent) + /// No Content when repository was added to the selected list + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/{repository_id}/put(agents/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.AgentsAddSelectedRepoToOrgSecret.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}/agents/secrets/{secret_name}/repositories/{repository_id}/put(agents/add-selected-repo-to-org-secret)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.AgentsAddSelectedRepoToOrgSecret.Output.Conflict) + /// Conflict when visibility type is not set to selected + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/{repository_id}/put(agents/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.AgentsAddSelectedRepoToOrgSecret.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/agents/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}/agents/secrets/{secret_name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/{repository_id}/delete(agents/remove-selected-repo-from-org-secret)`. + public enum AgentsRemoveSelectedRepoFromOrgSecret { + public static let id: Swift.String = "agents/remove-selected-repo-from-org-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/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}/agents/secrets/{secret_name}/repositories/{repository_id}/DELETE/path/secret_name`. + public var secretName: Components.Parameters.SecretName + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsRemoveSelectedRepoFromOrgSecret.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.AgentsRemoveSelectedRepoFromOrgSecret.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}/agents/secrets/{secret_name}/repositories/{repository_id}/delete(agents/remove-selected-repo-from-org-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.AgentsRemoveSelectedRepoFromOrgSecret.Output.NoContent) + /// Response when repository was removed from the selected list + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/{repository_id}/delete(agents/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.AgentsRemoveSelectedRepoFromOrgSecret.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}/agents/secrets/{secret_name}/repositories/{repository_id}/delete(agents/remove-selected-repo-from-org-secret)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.AgentsRemoveSelectedRepoFromOrgSecret.Output.Conflict) + /// Conflict when visibility type not set to selected + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/secrets/{secret_name}/repositories/{repository_id}/delete(agents/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.AgentsRemoveSelectedRepoFromOrgSecret.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 agent variables available in an organization. + /// Returned variables include their values. + /// + /// 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}/agents/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/get(agents/list-org-variables)`. + public enum AgentsListOrgVariables { + public static let id: Swift.String = "agents/list-org-variables" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsListOrgVariables.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/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}/agents/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.AgentsListOrgVariables.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsListOrgVariables.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.AgentsListOrgVariables.Input.Path, + query: Operations.AgentsListOrgVariables.Input.Query = .init(), + headers: Operations.AgentsListOrgVariables.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}/agents/variables/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsListOrgVariables.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/variables/GET/responses/200/content/application\/json`. + case json(Operations.AgentsListOrgVariables.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.AgentsListOrgVariables.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentsListOrgVariables.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.AgentsListOrgVariables.Output.Ok.Headers = .init(), + body: Operations.AgentsListOrgVariables.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/get(agents/list-org-variables)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentsListOrgVariables.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.AgentsListOrgVariables.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 agent 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}/agents/variables`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/post(agents/create-org-variable)`. + public enum AgentsCreateOrgVariable { + public static let id: Swift.String = "agents/create-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsCreateOrgVariable.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsCreateOrgVariable.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/POST/requestBody/json/name`. + public var name: Swift.String + /// The value of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/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}/agents/variables/POST/requestBody/json/visibility`. + public var visibility: Operations.AgentsCreateOrgVariable.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}/agents/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.AgentsCreateOrgVariable.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}/agents/variables/POST/requestBody/content/application\/json`. + case json(Operations.AgentsCreateOrgVariable.Input.Body.JsonPayload) + } + public var body: Operations.AgentsCreateOrgVariable.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.AgentsCreateOrgVariable.Input.Path, + headers: Operations.AgentsCreateOrgVariable.Input.Headers = .init(), + body: Operations.AgentsCreateOrgVariable.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}/agents/variables/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsCreateOrgVariable.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentsCreateOrgVariable.Output.Created.Body) { + self.body = body + } + } + /// Response when creating a variable + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/post(agents/create-org-variable)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.AgentsCreateOrgVariable.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.AgentsCreateOrgVariable.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 agent 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/get(agents/get-org-variable)`. + public enum AgentsGetOrgVariable { + public static let id: Swift.String = "agents/get-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/{name}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/{name}/GET/path/org`. + public var org: Components.Parameters.Org + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsGetOrgVariable.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsGetOrgVariable.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.AgentsGetOrgVariable.Input.Path, + headers: Operations.AgentsGetOrgVariable.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}/agents/variables/{name}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsGetOrgVariable.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentsGetOrgVariable.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/get(agents/get-org-variable)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentsGetOrgVariable.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.AgentsGetOrgVariable.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 agent 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/patch(agents/update-org-variable)`. + public enum AgentsUpdateOrgVariable { + public static let id: Swift.String = "agents/update-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/{name}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/{name}/PATCH/path/org`. + public var org: Components.Parameters.Org + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsUpdateOrgVariable.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/{name}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/{name}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/{name}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// The value of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/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}/agents/variables/{name}/PATCH/requestBody/json/visibility`. + public var visibility: Operations.AgentsUpdateOrgVariable.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}/agents/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.AgentsUpdateOrgVariable.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}/agents/variables/{name}/PATCH/requestBody/content/application\/json`. + case json(Operations.AgentsUpdateOrgVariable.Input.Body.JsonPayload) + } + public var body: Operations.AgentsUpdateOrgVariable.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.AgentsUpdateOrgVariable.Input.Path, + body: Operations.AgentsUpdateOrgVariable.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}/agents/variables/{name}/patch(agents/update-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.AgentsUpdateOrgVariable.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/patch(agents/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.AgentsUpdateOrgVariable.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 agent 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/delete(agents/delete-org-variable)`. + public enum AgentsDeleteOrgVariable { + public static let id: Swift.String = "agents/delete-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/{name}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/{name}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsDeleteOrgVariable.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.AgentsDeleteOrgVariable.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}/agents/variables/{name}/delete(agents/delete-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.AgentsDeleteOrgVariable.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/delete(agents/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.AgentsDeleteOrgVariable.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 agent 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}/agents/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/get(agents/list-selected-repos-for-org-variable)`. + public enum AgentsListSelectedReposForOrgVariable { + public static let id: Swift.String = "agents/list-selected-repos-for-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/variables/{name}/repositories/GET/path/org`. + public var org: Components.Parameters.Org + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsListSelectedReposForOrgVariable.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/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}/agents/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.AgentsListSelectedReposForOrgVariable.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsListSelectedReposForOrgVariable.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.AgentsListSelectedReposForOrgVariable.Input.Path, + query: Operations.AgentsListSelectedReposForOrgVariable.Input.Query = .init(), + headers: Operations.AgentsListSelectedReposForOrgVariable.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}/agents/variables/{name}/repositories/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/{name}/repositories/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/{name}/repositories/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/variables/{name}/repositories/GET/responses/200/content/application\/json`. + case json(Operations.AgentsListSelectedReposForOrgVariable.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.AgentsListSelectedReposForOrgVariable.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentsListSelectedReposForOrgVariable.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentsListSelectedReposForOrgVariable.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/get(agents/list-selected-repos-for-org-variable)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentsListSelectedReposForOrgVariable.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.AgentsListSelectedReposForOrgVariable.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}/agents/variables/{name}/repositories/get(agents/list-selected-repos-for-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.AgentsListSelectedReposForOrgVariable.Output.Conflict) + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/get(agents/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.AgentsListSelectedReposForOrgVariable.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 agent 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}/agents/variables/{name}/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/put(agents/set-selected-repos-for-org-variable)`. + public enum AgentsSetSelectedReposForOrgVariable { + public static let id: Swift.String = "agents/set-selected-repos-for-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/variables/{name}/repositories/PUT/path/org`. + public var org: Components.Parameters.Org + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsSetSelectedReposForOrgVariable.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/agents/variables/{name}/repositories/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/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}/agents/variables/{name}/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.AgentsSetSelectedReposForOrgVariable.Input.Body.JsonPayload) + } + public var body: Operations.AgentsSetSelectedReposForOrgVariable.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.AgentsSetSelectedReposForOrgVariable.Input.Path, + body: Operations.AgentsSetSelectedReposForOrgVariable.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}/agents/variables/{name}/repositories/put(agents/set-selected-repos-for-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.AgentsSetSelectedReposForOrgVariable.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/put(agents/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.AgentsSetSelectedReposForOrgVariable.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}/agents/variables/{name}/repositories/put(agents/set-selected-repos-for-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.AgentsSetSelectedReposForOrgVariable.Output.Conflict) + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/put(agents/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.AgentsSetSelectedReposForOrgVariable.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 agent 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 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}/agents/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/{repository_id}/put(agents/add-selected-repo-to-org-variable)`. + public enum AgentsAddSelectedRepoToOrgVariable { + public static let id: Swift.String = "agents/add-selected-repo-to-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/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}/agents/variables/{name}/repositories/{repository_id}/PUT/path/name`. + public var name: Components.Parameters.VariableName + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsAddSelectedRepoToOrgVariable.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.AgentsAddSelectedRepoToOrgVariable.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}/agents/variables/{name}/repositories/{repository_id}/put(agents/add-selected-repo-to-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.AgentsAddSelectedRepoToOrgVariable.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/{repository_id}/put(agents/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.AgentsAddSelectedRepoToOrgVariable.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}/agents/variables/{name}/repositories/{repository_id}/put(agents/add-selected-repo-to-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.AgentsAddSelectedRepoToOrgVariable.Output.Conflict) + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/{repository_id}/put(agents/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`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.AgentsAddSelectedRepoToOrgVariable.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 agent 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}/agents/variables/{name}/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/{repository_id}/delete(agents/remove-selected-repo-from-org-variable)`. + public enum AgentsRemoveSelectedRepoFromOrgVariable { + public static let id: Swift.String = "agents/remove-selected-repo-from-org-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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}/agents/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}/agents/variables/{name}/repositories/{repository_id}/DELETE/path/name`. + public var name: Components.Parameters.VariableName + /// - Remark: Generated from `#/paths/orgs/{org}/agents/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.AgentsRemoveSelectedRepoFromOrgVariable.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.AgentsRemoveSelectedRepoFromOrgVariable.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}/agents/variables/{name}/repositories/{repository_id}/delete(agents/remove-selected-repo-from-org-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.AgentsRemoveSelectedRepoFromOrgVariable.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/{repository_id}/delete(agents/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.AgentsRemoveSelectedRepoFromOrgVariable.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}/agents/variables/{name}/repositories/{repository_id}/delete(agents/remove-selected-repo-from-org-variable)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.AgentsRemoveSelectedRepoFromOrgVariable.Output.Conflict) + /// Response when the visibility of the variable is not set to `selected` + /// + /// - Remark: Generated from `#/paths//orgs/{org}/agents/variables/{name}/repositories/{repository_id}/delete(agents/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.AgentsRemoveSelectedRepoFromOrgVariable.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 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}/agents/organization-secrets`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/organization-secrets/get(agents/list-repo-organization-secrets)`. + public enum AgentsListRepoOrganizationSecrets { + public static let id: Swift.String = "agents/list-repo-organization-secrets" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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}/agents/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}/agents/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. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.AgentsListRepoOrganizationSecrets.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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}/agents/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}/agents/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.AgentsListRepoOrganizationSecrets.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/organization-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.AgentsListRepoOrganizationSecrets.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.AgentsListRepoOrganizationSecrets.Input.Path, + query: Operations.AgentsListRepoOrganizationSecrets.Input.Query = .init(), + headers: Operations.AgentsListRepoOrganizationSecrets.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}/agents/organization-secrets/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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.AgentsListRepoOrganizationSecrets.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/organization-secrets/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/organization-secrets/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/organization-secrets/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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}/agents/organization-secrets/GET/responses/200/content/application\/json`. + case json(Operations.AgentsListRepoOrganizationSecrets.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.AgentsListRepoOrganizationSecrets.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentsListRepoOrganizationSecrets.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.AgentsListRepoOrganizationSecrets.Output.Ok.Headers = .init(), + body: Operations.AgentsListRepoOrganizationSecrets.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/organization-secrets/get(agents/list-repo-organization-secrets)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentsListRepoOrganizationSecrets.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.AgentsListRepoOrganizationSecrets.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 repository organization variables + /// + /// Lists all organization variables shared with a repository. + /// + /// 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/agents/organization-variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/organization-variables/get(agents/list-repo-organization-variables)`. + public enum AgentsListRepoOrganizationVariables { + public static let id: Swift.String = "agents/list-repo-organization-variables" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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}/agents/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}/agents/organization-variables/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.AgentsListRepoOrganizationVariables.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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}/agents/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}/agents/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.AgentsListRepoOrganizationVariables.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/organization-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.AgentsListRepoOrganizationVariables.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.AgentsListRepoOrganizationVariables.Input.Path, + query: Operations.AgentsListRepoOrganizationVariables.Input.Query = .init(), + headers: Operations.AgentsListRepoOrganizationVariables.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}/agents/organization-variables/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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.AgentsListRepoOrganizationVariables.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/organization-variables/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/organization-variables/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/organization-variables/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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}/agents/organization-variables/GET/responses/200/content/application\/json`. + case json(Operations.AgentsListRepoOrganizationVariables.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.AgentsListRepoOrganizationVariables.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentsListRepoOrganizationVariables.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.AgentsListRepoOrganizationVariables.Output.Ok.Headers = .init(), + body: Operations.AgentsListRepoOrganizationVariables.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/organization-variables/get(agents/list-repo-organization-variables)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentsListRepoOrganizationVariables.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.AgentsListRepoOrganizationVariables.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 repository secrets + /// + /// Lists all secrets available in 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}/agents/secrets`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/get(agents/list-repo-secrets)`. + public enum AgentsListRepoSecrets { + public static let id: Swift.String = "agents/list-repo-secrets" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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}/agents/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}/agents/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. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.AgentsListRepoSecrets.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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}/agents/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}/agents/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.AgentsListRepoSecrets.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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.AgentsListRepoSecrets.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.AgentsListRepoSecrets.Input.Path, + query: Operations.AgentsListRepoSecrets.Input.Query = .init(), + headers: Operations.AgentsListRepoSecrets.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}/agents/secrets/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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.AgentsListRepoSecrets.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/secrets/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/secrets/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/secrets/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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}/agents/secrets/GET/responses/200/content/application\/json`. + case json(Operations.AgentsListRepoSecrets.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.AgentsListRepoSecrets.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentsListRepoSecrets.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.AgentsListRepoSecrets.Output.Ok.Headers = .init(), + body: Operations.AgentsListRepoSecrets.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/get(agents/list-repo-secrets)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentsListRepoSecrets.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.AgentsListRepoSecrets.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 a repository 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. + /// + /// 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}/agents/secrets/public-key`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/public-key/get(agents/get-repo-public-key)`. + public enum AgentsGetRepoPublicKey { + public static let id: Swift.String = "agents/get-repo-public-key" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/secrets/public-key/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}/agents/secrets/public-key/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}/agents/secrets/public-key/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.AgentsGetRepoPublicKey.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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.AgentsGetRepoPublicKey.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.AgentsGetRepoPublicKey.Input.Path, + headers: Operations.AgentsGetRepoPublicKey.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}/agents/secrets/public-key/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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.AgentsGetRepoPublicKey.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentsGetRepoPublicKey.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/public-key/get(agents/get-repo-public-key)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentsGetRepoPublicKey.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.AgentsGetRepoPublicKey.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 a repository secret + /// + /// Gets a single repository secret without revealing its encrypted value. + /// + /// The authenticated user must have collaborator access to the repository 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}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/get(agents/get-repo-secret)`. + public enum AgentsGetRepoSecret { + public static let id: Swift.String = "agents/get-repo-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/secrets/{secret_name}/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}/agents/secrets/{secret_name}/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}/agents/secrets/{secret_name}/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/secrets/{secret_name}/GET/path/secret_name`. + public var secretName: Components.Parameters.SecretName + /// 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. + /// - secretName: The name of the secret. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + secretName: Components.Parameters.SecretName + ) { + self.owner = owner + self.repo = repo + self.secretName = secretName + } + } + public var path: Operations.AgentsGetRepoSecret.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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.AgentsGetRepoSecret.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.AgentsGetRepoSecret.Input.Path, + headers: Operations.AgentsGetRepoSecret.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}/agents/secrets/{secret_name}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/secrets/{secret_name}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsSecret) + /// 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.ActionsSecret { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentsGetRepoSecret.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentsGetRepoSecret.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/get(agents/get-repo-secret)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentsGetRepoSecret.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.AgentsGetRepoSecret.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 a repository secret + /// + /// Creates or updates a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/put(agents/create-or-update-repo-secret)`. + public enum AgentsCreateOrUpdateRepoSecret { + public static let id: Swift.String = "agents/create-or-update-repo-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/secrets/{secret_name}/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}/agents/secrets/{secret_name}/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}/agents/secrets/{secret_name}/PUT/path/repo`. + public var repo: Components.Parameters.Repo + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/secrets/{secret_name}/PUT/path/secret_name`. + public var secretName: Components.Parameters.SecretName + /// 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. + /// - secretName: The name of the secret. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + secretName: Components.Parameters.SecretName + ) { + self.owner = owner + self.repo = repo + self.secretName = secretName + } + } + public var path: Operations.AgentsCreateOrUpdateRepoSecret.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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.AgentsCreateOrUpdateRepoSecret.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/secrets/{secret_name}/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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 a repository public key](https://docs.github.com/rest/agents/secrets#get-a-repository-public-key) endpoint. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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/repos/{owner}/{repo}/agents/secrets/{secret_name}/PUT/requestBody/json/key_id`. + public var keyId: Swift.String + /// 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 a repository public key](https://docs.github.com/rest/agents/secrets#get-a-repository-public-key) endpoint. + /// - keyId: ID of the key you used to encrypt the secret. + public init( + encryptedValue: Swift.String, + keyId: Swift.String + ) { + self.encryptedValue = encryptedValue + self.keyId = keyId + } + public enum CodingKeys: String, CodingKey { + case encryptedValue = "encrypted_value" + case keyId = "key_id" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/secrets/{secret_name}/PUT/requestBody/content/application\/json`. + case json(Operations.AgentsCreateOrUpdateRepoSecret.Input.Body.JsonPayload) + } + public var body: Operations.AgentsCreateOrUpdateRepoSecret.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.AgentsCreateOrUpdateRepoSecret.Input.Path, + headers: Operations.AgentsCreateOrUpdateRepoSecret.Input.Headers = .init(), + body: Operations.AgentsCreateOrUpdateRepoSecret.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}/agents/secrets/{secret_name}/PUT/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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.AgentsCreateOrUpdateRepoSecret.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentsCreateOrUpdateRepoSecret.Output.Created.Body) { + self.body = body + } + } + /// Response when creating a secret + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/put(agents/create-or-update-repo-secret)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.AgentsCreateOrUpdateRepoSecret.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.AgentsCreateOrUpdateRepoSecret.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//repos/{owner}/{repo}/agents/secrets/{secret_name}/put(agents/create-or-update-repo-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.AgentsCreateOrUpdateRepoSecret.Output.NoContent) + /// Response when updating a secret + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/put(agents/create-or-update-repo-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.AgentsCreateOrUpdateRepoSecret.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 a repository secret + /// + /// Deletes a secret in a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/agents/secrets/{secret_name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/delete(agents/delete-repo-secret)`. + public enum AgentsDeleteRepoSecret { + public static let id: Swift.String = "agents/delete-repo-secret" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/secrets/{secret_name}/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}/agents/secrets/{secret_name}/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}/agents/secrets/{secret_name}/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// The name of the secret. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/secrets/{secret_name}/DELETE/path/secret_name`. + public var secretName: Components.Parameters.SecretName + /// 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. + /// - secretName: The name of the secret. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + secretName: Components.Parameters.SecretName + ) { + self.owner = owner + self.repo = repo + self.secretName = secretName + } + } + public var path: Operations.AgentsDeleteRepoSecret.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.AgentsDeleteRepoSecret.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}/agents/secrets/{secret_name}/delete(agents/delete-repo-secret)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.AgentsDeleteRepoSecret.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/secrets/{secret_name}/delete(agents/delete-repo-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.AgentsDeleteRepoSecret.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 repository variables + /// + /// Lists all repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/agents/variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/get(agents/list-repo-variables)`. + public enum AgentsListRepoVariables { + public static let id: Swift.String = "agents/list-repo-variables" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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}/agents/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}/agents/variables/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.AgentsListRepoVariables.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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}/agents/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}/agents/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.AgentsListRepoVariables.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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.AgentsListRepoVariables.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.AgentsListRepoVariables.Input.Path, + query: Operations.AgentsListRepoVariables.Input.Query = .init(), + headers: Operations.AgentsListRepoVariables.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}/agents/variables/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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.AgentsListRepoVariables.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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}/agents/variables/GET/responses/200/content/application\/json`. + case json(Operations.AgentsListRepoVariables.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.AgentsListRepoVariables.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentsListRepoVariables.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.AgentsListRepoVariables.Output.Ok.Headers = .init(), + body: Operations.AgentsListRepoVariables.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/get(agents/list-repo-variables)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentsListRepoVariables.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.AgentsListRepoVariables.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 a repository variable + /// + /// Creates a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/agents/variables`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/post(agents/create-repo-variable)`. + public enum AgentsCreateRepoVariable { + public static let id: Swift.String = "agents/create-repo-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/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}/agents/variables/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}/agents/variables/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.AgentsCreateRepoVariable.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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.AgentsCreateRepoVariable.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/POST/requestBody/json/name`. + public var name: Swift.String + /// The value of the variable. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/POST/requestBody/json/value`. + public var value: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the variable. + /// - value: The value of the variable. + public init( + name: Swift.String, + value: Swift.String + ) { + self.name = name + self.value = value + } + public enum CodingKeys: String, CodingKey { + case name + case value + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/POST/requestBody/content/application\/json`. + case json(Operations.AgentsCreateRepoVariable.Input.Body.JsonPayload) + } + public var body: Operations.AgentsCreateRepoVariable.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.AgentsCreateRepoVariable.Input.Path, + headers: Operations.AgentsCreateRepoVariable.Input.Headers = .init(), + body: Operations.AgentsCreateRepoVariable.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}/agents/variables/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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.AgentsCreateRepoVariable.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentsCreateRepoVariable.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/post(agents/create-repo-variable)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.AgentsCreateRepoVariable.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.AgentsCreateRepoVariable.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 a repository variable + /// + /// Gets a specific variable in a repository. + /// + /// The authenticated user must have collaborator access to the repository 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}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/{name}/get(agents/get-repo-variable)`. + public enum AgentsGetRepoVariable { + public static let id: Swift.String = "agents/get-repo-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/{name}/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}/agents/variables/{name}/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}/agents/variables/{name}/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/{name}/GET/path/name`. + public var name: Components.Parameters.VariableName + /// 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. + /// - name: The name of the variable. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + name: Components.Parameters.VariableName + ) { + self.owner = owner + self.repo = repo + self.name = name + } + } + public var path: Operations.AgentsGetRepoVariable.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/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.AgentsGetRepoVariable.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.AgentsGetRepoVariable.Input.Path, + headers: Operations.AgentsGetRepoVariable.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}/agents/variables/{name}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/{name}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.ActionsVariable) + /// 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.ActionsVariable { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentsGetRepoVariable.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentsGetRepoVariable.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/{name}/get(agents/get-repo-variable)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentsGetRepoVariable.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.AgentsGetRepoVariable.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 a repository variable + /// + /// Updates a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/{name}/patch(agents/update-repo-variable)`. + public enum AgentsUpdateRepoVariable { + public static let id: Swift.String = "agents/update-repo-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/{name}/PATCH/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}/agents/variables/{name}/PATCH/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}/agents/variables/{name}/PATCH/path/repo`. + public var repo: Components.Parameters.Repo + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/{name}/PATCH/path/name`. + public var name: Components.Parameters.VariableName + /// 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. + /// - name: The name of the variable. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + name: Components.Parameters.VariableName + ) { + self.owner = owner + self.repo = repo + self.name = name + } + } + public var path: Operations.AgentsUpdateRepoVariable.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/{name}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/{name}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/{name}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// The value of the variable. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/{name}/PATCH/requestBody/json/value`. + public var value: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: The name of the variable. + /// - value: The value of the variable. + public init( + name: Swift.String? = nil, + value: Swift.String? = nil + ) { + self.name = name + self.value = value + } + public enum CodingKeys: String, CodingKey { + case name + case value + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/{name}/PATCH/requestBody/content/application\/json`. + case json(Operations.AgentsUpdateRepoVariable.Input.Body.JsonPayload) + } + public var body: Operations.AgentsUpdateRepoVariable.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - body: + public init( + path: Operations.AgentsUpdateRepoVariable.Input.Path, + body: Operations.AgentsUpdateRepoVariable.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}/agents/variables/{name}/patch(agents/update-repo-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.AgentsUpdateRepoVariable.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/{name}/patch(agents/update-repo-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.AgentsUpdateRepoVariable.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 a repository variable + /// + /// Deletes a repository 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 `repo` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/agents/variables/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/{name}/delete(agents/delete-repo-variable)`. + public enum AgentsDeleteRepoVariable { + public static let id: Swift.String = "agents/delete-repo-variable" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/{name}/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}/agents/variables/{name}/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}/agents/variables/{name}/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// The name of the variable. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/agents/variables/{name}/DELETE/path/name`. + public var name: Components.Parameters.VariableName + /// 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. + /// - name: The name of the variable. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + name: Components.Parameters.VariableName + ) { + self.owner = owner + self.repo = repo + self.name = name + } + } + public var path: Operations.AgentsDeleteRepoVariable.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.AgentsDeleteRepoVariable.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}/agents/variables/{name}/delete(agents/delete-repo-variable)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.AgentsDeleteRepoVariable.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/agents/variables/{name}/delete(agents/delete-repo-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.AgentsDeleteRepoVariable.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/copilot/Types.swift b/Sources/copilot/Types.swift index c19efbfb241..4759c99dbda 100644 --- a/Sources/copilot/Types.swift +++ b/Sources/copilot/Types.swift @@ -1871,6 +1871,17 @@ public enum Components { public var createdAt: Foundation.Date /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. public var updatedAt: Foundation.Date + /// Whether team members will receive notifications when the team is mentioned. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/notification_setting`. + @frozen public enum NotificationSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case notificationsEnabled = "notifications_enabled" + case notificationsDisabled = "notifications_disabled" + } + /// Whether team members will receive notifications when the team is mentioned. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/notification_setting`. + public var notificationSetting: Components.Schemas.EnterpriseTeam.NotificationSettingPayload? /// Creates a new `EnterpriseTeam`. /// /// - Parameters: @@ -1887,6 +1898,7 @@ public enum Components { /// - membersUrl: /// - createdAt: /// - updatedAt: + /// - notificationSetting: Whether team members will receive notifications when the team is mentioned. public init( id: Swift.Int64, name: Swift.String, @@ -1900,7 +1912,8 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, createdAt: Foundation.Date, - updatedAt: Foundation.Date + updatedAt: Foundation.Date, + notificationSetting: Components.Schemas.EnterpriseTeam.NotificationSettingPayload? = nil ) { self.id = id self.name = name @@ -1915,6 +1928,7 @@ public enum Components { self.membersUrl = membersUrl self.createdAt = createdAt self.updatedAt = updatedAt + self.notificationSetting = notificationSetting } public enum CodingKeys: String, CodingKey { case id @@ -1930,6 +1944,7 @@ public enum Components { case membersUrl = "members_url" case createdAt = "created_at" case updatedAt = "updated_at" + case notificationSetting = "notification_setting" } } /// - Remark: Generated from `#/components/schemas/security-and-analysis`. diff --git a/Sources/enterprise-teams/Types.swift b/Sources/enterprise-teams/Types.swift index aa064f3ebc1..2d1a8bc1250 100644 --- a/Sources/enterprise-teams/Types.swift +++ b/Sources/enterprise-teams/Types.swift @@ -231,6 +231,17 @@ public enum Components { public var createdAt: Foundation.Date /// - Remark: Generated from `#/components/schemas/enterprise-team/updated_at`. public var updatedAt: Foundation.Date + /// Whether team members will receive notifications when the team is mentioned. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/notification_setting`. + @frozen public enum NotificationSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case notificationsEnabled = "notifications_enabled" + case notificationsDisabled = "notifications_disabled" + } + /// Whether team members will receive notifications when the team is mentioned. + /// + /// - Remark: Generated from `#/components/schemas/enterprise-team/notification_setting`. + public var notificationSetting: Components.Schemas.EnterpriseTeam.NotificationSettingPayload? /// Creates a new `EnterpriseTeam`. /// /// - Parameters: @@ -247,6 +258,7 @@ public enum Components { /// - membersUrl: /// - createdAt: /// - updatedAt: + /// - notificationSetting: Whether team members will receive notifications when the team is mentioned. public init( id: Swift.Int64, name: Swift.String, @@ -260,7 +272,8 @@ public enum Components { htmlUrl: Swift.String, membersUrl: Swift.String, createdAt: Foundation.Date, - updatedAt: Foundation.Date + updatedAt: Foundation.Date, + notificationSetting: Components.Schemas.EnterpriseTeam.NotificationSettingPayload? = nil ) { self.id = id self.name = name @@ -275,6 +288,7 @@ public enum Components { self.membersUrl = membersUrl self.createdAt = createdAt self.updatedAt = updatedAt + self.notificationSetting = notificationSetting } public enum CodingKeys: String, CodingKey { case id @@ -290,6 +304,7 @@ public enum Components { case membersUrl = "members_url" case createdAt = "created_at" case updatedAt = "updated_at" + case notificationSetting = "notification_setting" } } } @@ -644,6 +659,29 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/group_id`. public var groupId: Swift.String? + /// The notification setting the team is set to. The options are: + /// + /// * `notifications_enabled` - team members receive notifications when the team is @mentioned. + /// * `notifications_disabled` - no one receives notifications. + /// + /// Default: `notifications_enabled` + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/notification_setting`. + @frozen public enum NotificationSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case notificationsEnabled = "notifications_enabled" + case notificationsDisabled = "notifications_disabled" + } + /// The notification setting the team is set to. The options are: + /// + /// * `notifications_enabled` - team members receive notifications when the team is @mentioned. + /// * `notifications_disabled` - no one receives notifications. + /// + /// Default: `notifications_enabled` + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/json/notification_setting`. + public var notificationSetting: Operations.EnterpriseTeamsCreate.Input.Body.JsonPayload.NotificationSettingPayload? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -652,18 +690,21 @@ public enum Operations { /// - 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). + /// - notificationSetting: The notification setting the team is set to. The options are: 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 + groupId: Swift.String? = nil, + notificationSetting: Operations.EnterpriseTeamsCreate.Input.Body.JsonPayload.NotificationSettingPayload? = nil ) { self.name = name self.description = description self.syncToOrganizations = syncToOrganizations self.organizationSelectionType = organizationSelectionType self.groupId = groupId + self.notificationSetting = notificationSetting } public enum CodingKeys: String, CodingKey { case name @@ -671,6 +712,7 @@ public enum Operations { case syncToOrganizations = "sync_to_organizations" case organizationSelectionType = "organization_selection_type" case groupId = "group_id" + case notificationSetting = "notification_setting" } } /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/POST/requestBody/content/application\/json`. @@ -1057,6 +1099,25 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/group_id`. public var groupId: Swift.String? + /// The notification setting the team is set to. The options are: + /// + /// * `notifications_enabled` - team members receive notifications when the team is @mentioned. + /// * `notifications_disabled` - no one receives notifications. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/notification_setting`. + @frozen public enum NotificationSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case notificationsEnabled = "notifications_enabled" + case notificationsDisabled = "notifications_disabled" + } + /// The notification setting the team is set to. The options are: + /// + /// * `notifications_enabled` - team members receive notifications when the team is @mentioned. + /// * `notifications_disabled` - no one receives notifications. + /// + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/json/notification_setting`. + public var notificationSetting: Operations.EnterpriseTeamsUpdate.Input.Body.JsonPayload.NotificationSettingPayload? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -1065,18 +1126,21 @@ public enum Operations { /// - 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. + /// - notificationSetting: The notification setting the team is set to. The options are: 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 + groupId: Swift.String? = nil, + notificationSetting: Operations.EnterpriseTeamsUpdate.Input.Body.JsonPayload.NotificationSettingPayload? = nil ) { self.name = name self.description = description self.syncToOrganizations = syncToOrganizations self.organizationSelectionType = organizationSelectionType self.groupId = groupId + self.notificationSetting = notificationSetting } public enum CodingKeys: String, CodingKey { case name @@ -1084,6 +1148,7 @@ public enum Operations { case syncToOrganizations = "sync_to_organizations" case organizationSelectionType = "organization_selection_type" case groupId = "group_id" + case notificationSetting = "notification_setting" } } /// - Remark: Generated from `#/paths/enterprises/{enterprise}/teams/{team_slug}/PATCH/requestBody/content/application\/json`. diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index 17056b337a1..16496123694 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -11350,6 +11350,93 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/assignees`. public var assignees: [Swift.String]? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload`. + public struct IssueFieldValuesPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the issue field to set + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/field_id`. + public var fieldId: Swift.Int + /// The value to set for the field + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/value/case2`. + case case2(Swift.Double) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.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 Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The value to set for the field + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/value`. + public var value: Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + /// Creates a new `IssueFieldValuesPayloadPayload`. + /// + /// - Parameters: + /// - fieldId: The ID of the issue field to set + /// - value: The value to set for the field + public init( + fieldId: Swift.Int, + value: Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + ) { + self.fieldId = fieldId + self.value = value + } + public enum CodingKeys: String, CodingKey { + case fieldId = "field_id" + case value + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.fieldId = try container.decode( + Swift.Int.self, + forKey: .fieldId + ) + self.value = try container.decode( + Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload.self, + forKey: .value + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "field_id", + "value" + ]) + } + } + /// An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Issue fields are only available for organization-owned repositories with the feature enabled. Field values are silently dropped otherwise. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/issue_field_values`. + public typealias IssueFieldValuesPayload = [Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload] + /// An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Issue fields are only available for organization-owned repositories with the feature enabled. Field values are silently dropped otherwise. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/issue_field_values`. + public var issueFieldValues: Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayload? /// The name of the issue type to associate with this issue. _NOTE: Only users with push access can set the type for new issues. The type is silently dropped otherwise._ /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/type`. @@ -11363,6 +11450,7 @@ public enum Operations { /// - milestone: /// - labels: Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ /// - assignees: Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ + /// - issueFieldValues: An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Issue fields are only available for organization-owned repositories with the feature enabled. Field values are silently dropped otherwise. /// - _type: The name of the issue type to associate with this issue. _NOTE: Only users with push access can set the type for new issues. The type is silently dropped otherwise._ public init( title: Operations.IssuesCreate.Input.Body.JsonPayload.TitlePayload, @@ -11371,6 +11459,7 @@ public enum Operations { milestone: Operations.IssuesCreate.Input.Body.JsonPayload.MilestonePayload? = nil, labels: Operations.IssuesCreate.Input.Body.JsonPayload.LabelsPayload? = nil, assignees: [Swift.String]? = nil, + issueFieldValues: Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayload? = nil, _type: Swift.String? = nil ) { self.title = title @@ -11379,6 +11468,7 @@ public enum Operations { self.milestone = milestone self.labels = labels self.assignees = assignees + self.issueFieldValues = issueFieldValues self._type = _type } public enum CodingKeys: String, CodingKey { @@ -11388,6 +11478,7 @@ public enum Operations { case milestone case labels case assignees + case issueFieldValues = "issue_field_values" case _type = "type" } } diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index 2841ab06187..5bad6ac0636 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -599,6 +599,10 @@ public struct Client: APIProtocol { /// If proposed records in the 'deployments' field have identical 'cluster', 'logical_environment', /// 'physical_environment', and 'deployment_name' values as existing records, the existing records will be updated. /// If no existing records match, new records will be created. + /// Note: Artifacts are uniquely identified by the combination of their repository and digest fields. If two entries in the deployments + /// array resolve to the same repository and have identical digest fields but differing name and version fields, the endpoint will use + /// the artifact name and version from the record processed first, since a single artifact (identified by repository and digest) can + /// only have one name and version. /// /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}`. /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)`. diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index 8f7d941e74b..da78a7d0758 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -91,6 +91,10 @@ public protocol APIProtocol: Sendable { /// If proposed records in the 'deployments' field have identical 'cluster', 'logical_environment', /// 'physical_environment', and 'deployment_name' values as existing records, the existing records will be updated. /// If no existing records match, new records will be created. + /// Note: Artifacts are uniquely identified by the combination of their repository and digest fields. If two entries in the deployments + /// array resolve to the same repository and have identical digest fields but differing name and version fields, the endpoint will use + /// the artifact name and version from the record processed first, since a single artifact (identified by repository and digest) can + /// only have one name and version. /// /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}`. /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)`. @@ -1195,6 +1199,10 @@ extension APIProtocol { /// If proposed records in the 'deployments' field have identical 'cluster', 'logical_environment', /// 'physical_environment', and 'deployment_name' values as existing records, the existing records will be updated. /// If no existing records match, new records will be created. + /// Note: Artifacts are uniquely identified by the combination of their repository and digest fields. If two entries in the deployments + /// array resolve to the same repository and have identical digest fields but differing name and version fields, the endpoint will use + /// the artifact name and version from the record processed first, since a single artifact (identified by repository and digest) can + /// only have one name and version. /// /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}`. /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)`. @@ -11850,6 +11858,10 @@ public enum Operations { /// If proposed records in the 'deployments' field have identical 'cluster', 'logical_environment', /// 'physical_environment', and 'deployment_name' values as existing records, the existing records will be updated. /// If no existing records match, new records will be created. + /// Note: Artifacts are uniquely identified by the combination of their repository and digest fields. If two entries in the deployments + /// array resolve to the same repository and have identical digest fields but differing name and version fields, the endpoint will use + /// the artifact name and version from the record processed first, since a single artifact (identified by repository and digest) can + /// only have one name and version. /// /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}`. /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)`. @@ -11906,21 +11918,15 @@ public enum Operations { public var physicalEnvironment: Swift.String? /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload`. public struct DeploymentsPayloadPayload: Codable, Hashable, Sendable { - /// The name of the artifact. Note that if multiple deployments have identical 'digest' parameter values, - /// the name parameter must also be identical across all entries. - /// + /// The name of the artifact. /// /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload/name`. public var name: Swift.String - /// The hex encoded digest of the artifact. Note that if multiple deployments have identical 'digest' parameter values, - /// the name and version parameters must also be identical across all entries. - /// + /// The hex encoded digest of the artifact. /// /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload/digest`. public var digest: Swift.String - /// The artifact version. Note that if multiple deployments have identical 'digest' parameter values, - /// the version parameter must also be identical across all entries. - /// + /// The artifact version. /// /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/DeploymentsPayload/version`. public var version: Swift.String? @@ -11994,9 +12000,9 @@ public enum Operations { /// Creates a new `DeploymentsPayloadPayload`. /// /// - Parameters: - /// - name: The name of the artifact. Note that if multiple deployments have identical 'digest' parameter values, - /// - digest: The hex encoded digest of the artifact. Note that if multiple deployments have identical 'digest' parameter values, - /// - version: The artifact version. Note that if multiple deployments have identical 'digest' parameter values, + /// - name: The name of the artifact. + /// - digest: The hex encoded digest of the artifact. + /// - version: The artifact version. /// - status: The deployment status of the artifact. /// - deploymentName: The unique identifier for the deployment represented by the new record. To accommodate differing /// - githubRepository: The name of the GitHub repository associated with the artifact. This should be used diff --git a/Sources/private-registries/Client.swift b/Sources/private-registries/Client.swift index 94f31a0d530..9406b81ba3d 100644 --- a/Sources/private-registries/Client.swift +++ b/Sources/private-registries/Client.swift @@ -185,7 +185,7 @@ public struct Client: APIProtocol { /// /// /// Creates a private registry configuration with an encrypted value for an organization. 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)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, `oidc_cloudsmith`, or `oidc_gcp`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -493,7 +493,7 @@ public struct Client: APIProtocol { /// /// /// Updates a private registry configuration with an encrypted value for an organization. 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)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, `oidc_cloudsmith`, or `oidc_gcp`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// diff --git a/Sources/private-registries/Types.swift b/Sources/private-registries/Types.swift index 726d537c8d2..f9370506076 100644 --- a/Sources/private-registries/Types.swift +++ b/Sources/private-registries/Types.swift @@ -26,7 +26,7 @@ public protocol APIProtocol: Sendable { /// /// /// Creates a private registry configuration with an encrypted value for an organization. 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)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, `oidc_cloudsmith`, or `oidc_gcp`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -57,7 +57,7 @@ public protocol APIProtocol: Sendable { /// /// /// Updates a private registry configuration with an encrypted value for an organization. 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)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, `oidc_cloudsmith`, or `oidc_gcp`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -103,7 +103,7 @@ extension APIProtocol { /// /// /// Creates a private registry configuration with an encrypted value for an organization. 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)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, `oidc_cloudsmith`, or `oidc_gcp`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -160,7 +160,7 @@ extension APIProtocol { /// /// /// Updates a private registry configuration with an encrypted value for an organization. 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)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, `oidc_cloudsmith`, or `oidc_gcp`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -473,6 +473,7 @@ public enum Components { case oidcAws = "oidc_aws" case oidcJfrog = "oidc_jfrog" case oidcCloudsmith = "oidc_cloudsmith" + case oidcGcp = "oidc_gcp" } /// The authentication type for the private registry. /// @@ -554,6 +555,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/api_host`. public var apiHost: Swift.String? + /// The full resource name of the GCP Workload Identity Provider (e.g. `projects//locations/global/workloadIdentityPools//providers/`). + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/workload_identity_provider`. + public var workloadIdentityProvider: Swift.String? + /// The GCP service account email to impersonate. If omitted, the federated token is used directly (direct WIF). + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/service_account`. + public var serviceAccount: Swift.String? /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/created_at`. public var createdAt: Foundation.Date /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/updated_at`. @@ -581,6 +590,8 @@ public enum Components { /// - namespace: The Cloudsmith organization namespace. /// - serviceSlug: The Cloudsmith service account slug. /// - apiHost: The Cloudsmith API host. + /// - workloadIdentityProvider: The full resource name of the GCP Workload Identity Provider (e.g. `projects//locations/global/workloadIdentityPools//providers/`). + /// - serviceAccount: The GCP service account email to impersonate. If omitted, the federated token is used directly (direct WIF). /// - createdAt: /// - updatedAt: public init( @@ -604,6 +615,8 @@ public enum Components { namespace: Swift.String? = nil, serviceSlug: Swift.String? = nil, apiHost: Swift.String? = nil, + workloadIdentityProvider: Swift.String? = nil, + serviceAccount: Swift.String? = nil, createdAt: Foundation.Date, updatedAt: Foundation.Date ) { @@ -627,6 +640,8 @@ public enum Components { self.namespace = namespace self.serviceSlug = serviceSlug self.apiHost = apiHost + self.workloadIdentityProvider = workloadIdentityProvider + self.serviceAccount = serviceAccount self.createdAt = createdAt self.updatedAt = updatedAt } @@ -651,6 +666,8 @@ public enum Components { case namespace case serviceSlug = "service_slug" case apiHost = "api_host" + case workloadIdentityProvider = "workload_identity_provider" + case serviceAccount = "service_account" case createdAt = "created_at" case updatedAt = "updated_at" } @@ -697,6 +714,7 @@ public enum Components { case oidcAws = "oidc_aws" case oidcJfrog = "oidc_jfrog" case oidcCloudsmith = "oidc_cloudsmith" + case oidcGcp = "oidc_gcp" } /// The authentication type for the private registry. /// @@ -782,6 +800,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/api_host`. public var apiHost: Swift.String? + /// The full resource name of the GCP Workload Identity Provider (e.g. `projects//locations/global/workloadIdentityPools//providers/`). + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/workload_identity_provider`. + public var workloadIdentityProvider: Swift.String? + /// The GCP service account email to impersonate. If omitted, the federated token is used directly (direct WIF). + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/service_account`. + public var serviceAccount: Swift.String? /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/created_at`. public var createdAt: Foundation.Date /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/updated_at`. @@ -810,6 +836,8 @@ public enum Components { /// - namespace: The Cloudsmith organization namespace. /// - serviceSlug: The Cloudsmith service account slug. /// - apiHost: The Cloudsmith API host. + /// - workloadIdentityProvider: The full resource name of the GCP Workload Identity Provider (e.g. `projects//locations/global/workloadIdentityPools//providers/`). + /// - serviceAccount: The GCP service account email to impersonate. If omitted, the federated token is used directly (direct WIF). /// - createdAt: /// - updatedAt: public init( @@ -834,6 +862,8 @@ public enum Components { namespace: Swift.String? = nil, serviceSlug: Swift.String? = nil, apiHost: Swift.String? = nil, + workloadIdentityProvider: Swift.String? = nil, + serviceAccount: Swift.String? = nil, createdAt: Foundation.Date, updatedAt: Foundation.Date ) { @@ -858,6 +888,8 @@ public enum Components { self.namespace = namespace self.serviceSlug = serviceSlug self.apiHost = apiHost + self.workloadIdentityProvider = workloadIdentityProvider + self.serviceAccount = serviceAccount self.createdAt = createdAt self.updatedAt = updatedAt } @@ -883,6 +915,8 @@ public enum Components { case namespace case serviceSlug = "service_slug" case apiHost = "api_host" + case workloadIdentityProvider = "workload_identity_provider" + case serviceAccount = "service_account" case createdAt = "created_at" case updatedAt = "updated_at" } @@ -1290,7 +1324,7 @@ public enum Operations { /// /// /// Creates a private registry configuration with an encrypted value for an organization. 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)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, `oidc_cloudsmith`, or `oidc_gcp`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -1390,7 +1424,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/selected_repository_ids`. public var selectedRepositoryIds: [Swift.Int]? - /// The authentication type for the private registry. Defaults to `token` if not specified. Use `oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith` for OIDC authentication. + /// The authentication type for the private registry. Defaults to `token` if not specified. Use `oidc_azure`, `oidc_aws`, `oidc_jfrog`, `oidc_cloudsmith`, or `oidc_gcp` for OIDC authentication. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/auth_type`. @frozen public enum AuthTypePayload: String, Codable, Hashable, Sendable, CaseIterable { @@ -1400,8 +1434,9 @@ public enum Operations { case oidcAws = "oidc_aws" case oidcJfrog = "oidc_jfrog" case oidcCloudsmith = "oidc_cloudsmith" + case oidcGcp = "oidc_gcp" } - /// The authentication type for the private registry. Defaults to `token` if not specified. Use `oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith` for OIDC authentication. + /// The authentication type for the private registry. Defaults to `token` if not specified. Use `oidc_azure`, `oidc_aws`, `oidc_jfrog`, `oidc_cloudsmith`, or `oidc_gcp` for OIDC authentication. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/auth_type`. public var authType: Operations.PrivateRegistriesCreateOrgPrivateRegistry.Input.Body.JsonPayload.AuthTypePayload? @@ -1437,7 +1472,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/jfrog_oidc_provider_name`. public var jfrogOidcProviderName: Swift.String? - /// The OIDC audience. Optional for `oidc_aws`, `oidc_jfrog`, and required for `oidc_cloudsmith` auth types. + /// The OIDC audience. Optional for `oidc_aws`, `oidc_jfrog`, and `oidc_gcp`, and required for `oidc_cloudsmith` auth types. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/audience`. public var audience: Swift.String? @@ -1457,6 +1492,14 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/api_host`. public var apiHost: Swift.String? + /// The full resource name of the GCP Workload Identity Provider (e.g. `projects//locations/global/workloadIdentityPools//providers/`). Required when `auth_type` is `oidc_gcp`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/workload_identity_provider`. + public var workloadIdentityProvider: Swift.String? + /// The GCP service account email to impersonate. Optional for `oidc_gcp` auth type. If omitted, the federated token is used directly (direct WIF). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/service_account`. + public var serviceAccount: Swift.String? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -1468,7 +1511,7 @@ public enum Operations { /// - keyId: The ID of the key you used to encrypt the secret. Required when `auth_type` is `token` or `username_password`. Should be omitted for OIDC auth types. /// - visibility: Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. /// - 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`. - /// - authType: The authentication type for the private registry. Defaults to `token` if not specified. Use `oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith` for OIDC authentication. + /// - authType: The authentication type for the private registry. Defaults to `token` if not specified. Use `oidc_azure`, `oidc_aws`, `oidc_jfrog`, `oidc_cloudsmith`, or `oidc_gcp` for OIDC authentication. /// - tenantId: The tenant ID of the Azure AD application. Required when `auth_type` is `oidc_azure`. /// - clientId: The client ID of the Azure AD application. Required when `auth_type` is `oidc_azure`. /// - awsRegion: The AWS region. Required when `auth_type` is `oidc_aws`. @@ -1477,11 +1520,13 @@ public enum Operations { /// - domain: The CodeArtifact domain. Required when `auth_type` is `oidc_aws`. /// - domainOwner: The CodeArtifact domain owner (AWS account ID). Required when `auth_type` is `oidc_aws`. /// - jfrogOidcProviderName: The JFrog OIDC provider name. Required when `auth_type` is `oidc_jfrog`. - /// - audience: The OIDC audience. Optional for `oidc_aws`, `oidc_jfrog`, and required for `oidc_cloudsmith` auth types. + /// - audience: The OIDC audience. Optional for `oidc_aws`, `oidc_jfrog`, and `oidc_gcp`, and required for `oidc_cloudsmith` auth types. /// - identityMappingName: The JFrog identity mapping name. Optional for `oidc_jfrog` auth type. /// - namespace: The Cloudsmith organization namespace. Required when `auth_type` is `oidc_cloudsmith`. /// - serviceSlug: The Cloudsmith service account slug. Required when `auth_type` is `oidc_cloudsmith`. /// - apiHost: The Cloudsmith API host. Optional for `oidc_cloudsmith` auth type. If omitted, `api.cloudsmith.io` is used by default. + /// - workloadIdentityProvider: The full resource name of the GCP Workload Identity Provider (e.g. `projects//locations/global/workloadIdentityPools//providers/`). Required when `auth_type` is `oidc_gcp`. + /// - serviceAccount: The GCP service account email to impersonate. Optional for `oidc_gcp` auth type. If omitted, the federated token is used directly (direct WIF). public init( registryType: Operations.PrivateRegistriesCreateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload, url: Swift.String, @@ -1504,7 +1549,9 @@ public enum Operations { identityMappingName: Swift.String? = nil, namespace: Swift.String? = nil, serviceSlug: Swift.String? = nil, - apiHost: Swift.String? = nil + apiHost: Swift.String? = nil, + workloadIdentityProvider: Swift.String? = nil, + serviceAccount: Swift.String? = nil ) { self.registryType = registryType self.url = url @@ -1528,6 +1575,8 @@ public enum Operations { self.namespace = namespace self.serviceSlug = serviceSlug self.apiHost = apiHost + self.workloadIdentityProvider = workloadIdentityProvider + self.serviceAccount = serviceAccount } public enum CodingKeys: String, CodingKey { case registryType = "registry_type" @@ -1552,6 +1601,8 @@ public enum Operations { case namespace case serviceSlug = "service_slug" case apiHost = "api_host" + case workloadIdentityProvider = "workload_identity_provider" + case serviceAccount = "service_account" } } /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/content/application\/json`. @@ -2078,7 +2129,7 @@ public enum Operations { /// /// /// Updates a private registry configuration with an encrypted value for an organization. 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)." - /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, or `oidc_cloudsmith`), the `encrypted_value` and `key_id` fields should be omitted. + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, `oidc_jfrog`, `oidc_cloudsmith`, or `oidc_gcp`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -2197,6 +2248,7 @@ public enum Operations { case oidcAws = "oidc_aws" case oidcJfrog = "oidc_jfrog" case oidcCloudsmith = "oidc_cloudsmith" + case oidcGcp = "oidc_gcp" } /// The authentication type for the private registry. This field cannot be changed after creation. If provided, it must match the existing `auth_type` of the configuration. To change the authentication type, delete and recreate the configuration. /// @@ -2234,7 +2286,7 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/jfrog_oidc_provider_name`. public var jfrogOidcProviderName: Swift.String? - /// The OIDC audience. Optional for `oidc_aws`, `oidc_jfrog`, and required for `oidc_cloudsmith` auth types. + /// The OIDC audience. Optional for `oidc_aws`, `oidc_jfrog`, and `oidc_gcp`, and required for `oidc_cloudsmith` auth types. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/audience`. public var audience: Swift.String? @@ -2254,6 +2306,14 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/api_host`. public var apiHost: Swift.String? + /// The full resource name of the GCP Workload Identity Provider (e.g. `projects//locations/global/workloadIdentityPools//providers/`). Required when `auth_type` is `oidc_gcp`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/workload_identity_provider`. + public var workloadIdentityProvider: Swift.String? + /// The GCP service account email to impersonate. Optional for `oidc_gcp` auth type. If omitted, the federated token is used directly (direct WIF). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/service_account`. + public var serviceAccount: Swift.String? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -2274,11 +2334,13 @@ public enum Operations { /// - domain: The CodeArtifact domain. Required when `auth_type` is `oidc_aws`. /// - domainOwner: The CodeArtifact domain owner (AWS account ID). Required when `auth_type` is `oidc_aws`. /// - jfrogOidcProviderName: The JFrog OIDC provider name. Required when `auth_type` is `oidc_jfrog`. - /// - audience: The OIDC audience. Optional for `oidc_aws`, `oidc_jfrog`, and required for `oidc_cloudsmith` auth types. + /// - audience: The OIDC audience. Optional for `oidc_aws`, `oidc_jfrog`, and `oidc_gcp`, and required for `oidc_cloudsmith` auth types. /// - identityMappingName: The JFrog identity mapping name. Optional for `oidc_jfrog` auth type. /// - namespace: The Cloudsmith organization namespace. Required when `auth_type` is `oidc_cloudsmith`. /// - serviceSlug: The Cloudsmith service account slug. Required when `auth_type` is `oidc_cloudsmith`. /// - apiHost: The Cloudsmith API host. Optional for `oidc_cloudsmith` auth type. If omitted, `api.cloudsmith.io` is used by default. + /// - workloadIdentityProvider: The full resource name of the GCP Workload Identity Provider (e.g. `projects//locations/global/workloadIdentityPools//providers/`). Required when `auth_type` is `oidc_gcp`. + /// - serviceAccount: The GCP service account email to impersonate. Optional for `oidc_gcp` auth type. If omitted, the federated token is used directly (direct WIF). public init( registryType: Operations.PrivateRegistriesUpdateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload? = nil, url: Swift.String? = nil, @@ -2301,7 +2363,9 @@ public enum Operations { identityMappingName: Swift.String? = nil, namespace: Swift.String? = nil, serviceSlug: Swift.String? = nil, - apiHost: Swift.String? = nil + apiHost: Swift.String? = nil, + workloadIdentityProvider: Swift.String? = nil, + serviceAccount: Swift.String? = nil ) { self.registryType = registryType self.url = url @@ -2325,6 +2389,8 @@ public enum Operations { self.namespace = namespace self.serviceSlug = serviceSlug self.apiHost = apiHost + self.workloadIdentityProvider = workloadIdentityProvider + self.serviceAccount = serviceAccount } public enum CodingKeys: String, CodingKey { case registryType = "registry_type" @@ -2349,6 +2415,8 @@ public enum Operations { case namespace case serviceSlug = "service_slug" case apiHost = "api_host" + case workloadIdentityProvider = "workload_identity_provider" + case serviceAccount = "service_account" } } /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/content/application\/json`. diff --git a/Sources/secret-scanning/Client.swift b/Sources/secret-scanning/Client.swift index cbaac9bca6a..94710ce3c0d 100644 --- a/Sources/secret-scanning/Client.swift +++ b/Sources/secret-scanning/Client.swift @@ -183,6 +183,13 @@ public struct Client: APIProtocol { name: "hide_secret", value: input.query.hideSecret ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "is_bypassed", + value: input.query.isBypassed + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -727,6 +734,13 @@ public struct Client: APIProtocol { name: "hide_secret", value: input.query.hideSecret ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "is_bypassed", + value: input.query.isBypassed + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -967,6 +981,8 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: return .badRequest(.init()) + case 403: + return .forbidden(.init()) case 404: return .notFound(.init()) case 422: diff --git a/Sources/secret-scanning/Types.swift b/Sources/secret-scanning/Types.swift index b1409d266bd..70d91a49957 100644 --- a/Sources/secret-scanning/Types.swift +++ b/Sources/secret-scanning/Types.swift @@ -3017,6 +3017,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-hide-secret`. public typealias SecretScanningAlertHideSecret = Swift.Bool + /// A boolean value (`true` or `false`) indicating whether to filter alerts by their push protection bypass status. When set to `true`, only alerts that were created because a push protection rule was bypassed will be returned. When set to `false`, only alerts that were not caused by a push protection bypass will be returned. + /// + /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-bypassed`. + public typealias SecretScanningAlertBypassed = 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`. @@ -3380,6 +3384,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/hide_secret`. public var hideSecret: Components.Parameters.SecretScanningAlertHideSecret? + /// A boolean value (`true` or `false`) indicating whether to filter alerts by their push protection bypass status. When set to `true`, only alerts that were created because a push protection rule was bypassed will be returned. When set to `false`, only alerts that were not caused by a push protection bypass will be returned. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/is_bypassed`. + public var isBypassed: Components.Parameters.SecretScanningAlertBypassed? /// Creates a new `Query`. /// /// - Parameters: @@ -3400,6 +3408,7 @@ public enum Operations { /// - 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. + /// - isBypassed: A boolean value (`true` or `false`) indicating whether to filter alerts by their push protection bypass status. When set to `true`, only alerts that were created because a push protection rule was bypassed will be returned. When set to `false`, only alerts that were not caused by a push protection bypass will be returned. public init( state: Components.Parameters.SecretScanningAlertState? = nil, secretType: Components.Parameters.SecretScanningAlertSecretType? = nil, @@ -3417,7 +3426,8 @@ public enum Operations { validity: Components.Parameters.SecretScanningAlertValidity? = nil, isPubliclyLeaked: Components.Parameters.SecretScanningAlertPubliclyLeaked? = nil, isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? = nil, - hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil + hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil, + isBypassed: Components.Parameters.SecretScanningAlertBypassed? = nil ) { self.state = state self.secretType = secretType @@ -3436,6 +3446,7 @@ public enum Operations { self.isPubliclyLeaked = isPubliclyLeaked self.isMultiRepo = isMultiRepo self.hideSecret = hideSecret + self.isBypassed = isBypassed } } public var query: Operations.SecretScanningListAlertsForOrg.Input.Query @@ -4320,6 +4331,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/hide_secret`. public var hideSecret: Components.Parameters.SecretScanningAlertHideSecret? + /// A boolean value (`true` or `false`) indicating whether to filter alerts by their push protection bypass status. When set to `true`, only alerts that were created because a push protection rule was bypassed will be returned. When set to `false`, only alerts that were not caused by a push protection bypass will be returned. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/is_bypassed`. + public var isBypassed: Components.Parameters.SecretScanningAlertBypassed? /// Creates a new `Query`. /// /// - Parameters: @@ -4340,6 +4355,7 @@ public enum Operations { /// - 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. + /// - isBypassed: A boolean value (`true` or `false`) indicating whether to filter alerts by their push protection bypass status. When set to `true`, only alerts that were created because a push protection rule was bypassed will be returned. When set to `false`, only alerts that were not caused by a push protection bypass will be returned. public init( state: Components.Parameters.SecretScanningAlertState? = nil, secretType: Components.Parameters.SecretScanningAlertSecretType? = nil, @@ -4357,7 +4373,8 @@ public enum Operations { validity: Components.Parameters.SecretScanningAlertValidity? = nil, isPubliclyLeaked: Components.Parameters.SecretScanningAlertPubliclyLeaked? = nil, isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? = nil, - hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil + hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil, + isBypassed: Components.Parameters.SecretScanningAlertBypassed? = nil ) { self.state = state self.secretType = secretType @@ -4376,6 +4393,7 @@ public enum Operations { self.isPubliclyLeaked = isPubliclyLeaked self.isMultiRepo = isMultiRepo self.hideSecret = hideSecret + self.isBypassed = isBypassed } } public var query: Operations.SecretScanningListAlertsForRepo.Input.Query @@ -5046,6 +5064,41 @@ public enum Operations { } } } + public struct Forbidden: Sendable, Hashable { + /// Creates a new `Forbidden`. + public init() {} + } + /// Delegated alert dismissal is enabled and the authenticated user is not a valid reviewer. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.SecretScanningUpdateAlert.Output.Forbidden) + /// Delegated alert dismissal is enabled and the authenticated user is not a valid reviewer. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/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.SecretScanningUpdateAlert.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } public struct NotFound: Sendable, Hashable { /// Creates a new `NotFound`. public init() {} diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index d3a3c2a50bb..88dc3d8d815 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit d3a3c2a50bb45b5f437bdfd8e0c700091bb1fb7b +Subproject commit 88dc3d8d8159aa2513e49fbc62651e4e5b67af6d