diff --git a/.github/workflows/actions/setup/action.yml b/.github/composites/setup/action.yml similarity index 91% rename from .github/workflows/actions/setup/action.yml rename to .github/composites/setup/action.yml index 2d93d053c57..4bb760c6ece 100644 --- a/.github/workflows/actions/setup/action.yml +++ b/.github/composites/setup/action.yml @@ -11,9 +11,14 @@ inputs: runs: using: 'composite' steps: - - uses: swift-actions/setup-swift@v2 + - uses: jdx/mise-action@v2 with: - swift-version: ${{ inputs.swift }} + mise_toml: | + [tools] + swift = "${{ inputs.swift }}" + [settings] + experimental = true + - uses: irgaly/setup-mint@v1 with: mint-executable-directory: $HOME/.mint/bin diff --git a/.github/dependabot-mintfile/manifest-swift-openapi-generator/Package.swift b/.github/dependabot-mintfile/manifest-swift-openapi-generator/Package.swift index 3ef35dcbe57..0257fd3bd9c 100644 --- a/.github/dependabot-mintfile/manifest-swift-openapi-generator/Package.swift +++ b/.github/dependabot-mintfile/manifest-swift-openapi-generator/Package.swift @@ -6,6 +6,6 @@ import PackageDescription let package = Package( name: "manifest-swift-openapi-generator", dependencies: [ - .package(url: "https://github.com/apple/swift-openapi-generator", exact: "1.8.0"), + .package(url: "https://github.com/apple/swift-openapi-generator", exact: "1.9.0"), ] ) diff --git a/.github/workflows/CI-Dependabot.yml b/.github/workflows/CI-Dependabot.yml index aecfeb8725c..922ff26bbb9 100644 --- a/.github/workflows/CI-Dependabot.yml +++ b/.github/workflows/CI-Dependabot.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: true - - uses: ./.github/workflows/actions/setup + - uses: ./.github/composites/setup with: swift: ${{ matrix.swift }} os: ${{ matrix.os }} diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 04542e52f8a..3be1573059b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: true - - uses: ./.github/workflows/actions/setup + - uses: ./.github/composites/setup with: swift: ${{ matrix.swift }} os: ${{ matrix.os }} diff --git a/.github/workflows/Doc.yml b/.github/workflows/Doc.yml index fdb110f7c2b..ac0fb66893d 100644 --- a/.github/workflows/Doc.yml +++ b/.github/workflows/Doc.yml @@ -25,7 +25,7 @@ jobs: uses: sersoft-gmbh/oss-common-actions/.github/workflows/swift-generate-and-publish-docs.yml@main with: os: ubuntu - swift-version: '5.9' + swift-version: '6' organisation: ${{ github.repository_owner }} repository: ${{ github.event.repository.name }} pages-branch: gh-pages diff --git a/.gitmodules b/.gitmodules index cfdc733eb75..e69de29bb2d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +0,0 @@ -[submodule "Submodule/github/rest-api-description"] - path = Submodule/github/rest-api-description - url = https://github.com/github/rest-api-description.git - shallow = true diff --git a/Mintfile b/Mintfile index d7131cc1182..2cf622ccfc4 100644 --- a/Mintfile +++ b/Mintfile @@ -1,2 +1,2 @@ yonaskolb/Mint@0.18.0 -apple/swift-openapi-generator@1.8.0 +apple/swift-openapi-generator@1.9.0 diff --git a/Sources/code-security/Types.swift b/Sources/code-security/Types.swift index d6eb34a4641..baaac91aca7 100644 --- a/Sources/code-security/Types.swift +++ b/Sources/code-security/Types.swift @@ -1035,6 +1035,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/dependabot_security_updates`. public var dependabotSecurityUpdates: Components.Schemas.CodeSecurityConfiguration.DependabotSecurityUpdatesPayload? + /// Feature options for code scanning + /// + /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_options`. + public var codeScanningOptions: OpenAPIRuntime.OpenAPIObjectContainer? /// The enablement status of code scanning default setup /// /// - Remark: Generated from `#/components/schemas/code-security-configuration/code_scanning_default_setup`. @@ -1293,6 +1297,7 @@ public enum Components { /// - dependencyGraphAutosubmitActionOptions: Feature options for Automatic dependency submission /// - dependabotAlerts: The enablement status of Dependabot alerts /// - dependabotSecurityUpdates: The enablement status of Dependabot security updates + /// - codeScanningOptions: Feature options for code scanning /// - codeScanningDefaultSetup: The enablement status of code scanning default setup /// - codeScanningDefaultSetupOptions: Feature options for code scanning default setup /// - codeScanningDelegatedAlertDismissal: The enablement status of code scanning delegated alert dismissal @@ -1321,6 +1326,7 @@ public enum Components { dependencyGraphAutosubmitActionOptions: Components.Schemas.CodeSecurityConfiguration.DependencyGraphAutosubmitActionOptionsPayload? = nil, dependabotAlerts: Components.Schemas.CodeSecurityConfiguration.DependabotAlertsPayload? = nil, dependabotSecurityUpdates: Components.Schemas.CodeSecurityConfiguration.DependabotSecurityUpdatesPayload? = nil, + codeScanningOptions: OpenAPIRuntime.OpenAPIObjectContainer? = nil, codeScanningDefaultSetup: Components.Schemas.CodeSecurityConfiguration.CodeScanningDefaultSetupPayload? = nil, codeScanningDefaultSetupOptions: Components.Schemas.CodeSecurityConfiguration.CodeScanningDefaultSetupOptionsPayload? = nil, codeScanningDelegatedAlertDismissal: Components.Schemas.CodeSecurityConfiguration.CodeScanningDelegatedAlertDismissalPayload? = nil, @@ -1349,6 +1355,7 @@ public enum Components { self.dependencyGraphAutosubmitActionOptions = dependencyGraphAutosubmitActionOptions self.dependabotAlerts = dependabotAlerts self.dependabotSecurityUpdates = dependabotSecurityUpdates + self.codeScanningOptions = codeScanningOptions self.codeScanningDefaultSetup = codeScanningDefaultSetup self.codeScanningDefaultSetupOptions = codeScanningDefaultSetupOptions self.codeScanningDelegatedAlertDismissal = codeScanningDelegatedAlertDismissal @@ -1378,6 +1385,7 @@ public enum Components { case dependencyGraphAutosubmitActionOptions = "dependency_graph_autosubmit_action_options" case dependabotAlerts = "dependabot_alerts" case dependabotSecurityUpdates = "dependabot_security_updates" + case codeScanningOptions = "code_scanning_options" case codeScanningDefaultSetup = "code_scanning_default_setup" case codeScanningDefaultSetupOptions = "code_scanning_default_setup_options" case codeScanningDelegatedAlertDismissal = "code_scanning_delegated_alert_dismissal" diff --git a/Sources/dependabot/Client.swift b/Sources/dependabot/Client.swift index 0222c62e550..825226c91c3 100644 --- a/Sources/dependabot/Client.swift +++ b/Sources/dependabot/Client.swift @@ -274,8 +274,9 @@ public struct Client: APIProtocol { } ) } - /// Lists repositories that organization admins have allowed Dependabot to access when updating dependencies. + /// Lists the repositories Dependabot can access in an organization /// + /// Lists repositories that organization admins have allowed Dependabot to access when updating dependencies. /// > [!NOTE] /// > This operation supports both server-to-server and user-to-server access. /// Unauthorized users will not see the existence of this endpoint. @@ -398,7 +399,9 @@ public struct Client: APIProtocol { } ) } - /// Updates repositories to the list of repositories that organization admins have allowed Dependabot to access when updating dependencies. + /// Updates Dependabot's repository access list for an organization + /// + /// Updates repositories according to the list of repositories that organization admins have given Dependabot access to when they've updated dependencies. /// /// > [!NOTE] /// > This operation supports both server-to-server and user-to-server access. @@ -507,14 +510,14 @@ public struct Client: APIProtocol { } /// Set the default repository access level for Dependabot /// - /// > [!NOTE] - /// > This operation supports both server-to-server and user-to-server access. /// Sets the default level of repository access Dependabot will have while performing an update. Available values are: /// - 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories. /// - 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories. /// /// Unauthorized users will not see the existence of this endpoint. /// + /// This operation supports both server-to-server and user-to-server access. + /// /// - Remark: HTTP `PUT /organizations/{org}/dependabot/repository-access/default-level`. /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level)`. public func dependabotSetRepositoryAccessDefaultLevel(_ input: Operations.DependabotSetRepositoryAccessDefaultLevel.Input) async throws -> Operations.DependabotSetRepositoryAccessDefaultLevel.Output { diff --git a/Sources/dependabot/Types.swift b/Sources/dependabot/Types.swift index 524f976bf67..f6743203651 100644 --- a/Sources/dependabot/Types.swift +++ b/Sources/dependabot/Types.swift @@ -24,8 +24,9 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /enterprises/{enterprise}/dependabot/alerts`. /// - Remark: Generated from `#/paths//enterprises/{enterprise}/dependabot/alerts/get(dependabot/list-alerts-for-enterprise)`. func dependabotListAlertsForEnterprise(_ input: Operations.DependabotListAlertsForEnterprise.Input) async throws -> Operations.DependabotListAlertsForEnterprise.Output - /// Lists repositories that organization admins have allowed Dependabot to access when updating dependencies. + /// Lists the repositories Dependabot can access in an organization /// + /// Lists repositories that organization admins have allowed Dependabot to access when updating dependencies. /// > [!NOTE] /// > This operation supports both server-to-server and user-to-server access. /// Unauthorized users will not see the existence of this endpoint. @@ -33,7 +34,9 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /organizations/{org}/dependabot/repository-access`. /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/get(dependabot/repository-access-for-org)`. func dependabotRepositoryAccessForOrg(_ input: Operations.DependabotRepositoryAccessForOrg.Input) async throws -> Operations.DependabotRepositoryAccessForOrg.Output - /// Updates repositories to the list of repositories that organization admins have allowed Dependabot to access when updating dependencies. + /// Updates Dependabot's repository access list for an organization + /// + /// Updates repositories according to the list of repositories that organization admins have given Dependabot access to when they've updated dependencies. /// /// > [!NOTE] /// > This operation supports both server-to-server and user-to-server access. @@ -52,14 +55,14 @@ public protocol APIProtocol: Sendable { func dependabotUpdateRepositoryAccessForOrg(_ input: Operations.DependabotUpdateRepositoryAccessForOrg.Input) async throws -> Operations.DependabotUpdateRepositoryAccessForOrg.Output /// Set the default repository access level for Dependabot /// - /// > [!NOTE] - /// > This operation supports both server-to-server and user-to-server access. /// Sets the default level of repository access Dependabot will have while performing an update. Available values are: /// - 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories. /// - 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories. /// /// Unauthorized users will not see the existence of this endpoint. /// + /// This operation supports both server-to-server and user-to-server access. + /// /// - Remark: HTTP `PUT /organizations/{org}/dependabot/repository-access/default-level`. /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level)`. func dependabotSetRepositoryAccessDefaultLevel(_ input: Operations.DependabotSetRepositoryAccessDefaultLevel.Input) async throws -> Operations.DependabotSetRepositoryAccessDefaultLevel.Output @@ -264,8 +267,9 @@ extension APIProtocol { headers: headers )) } - /// Lists repositories that organization admins have allowed Dependabot to access when updating dependencies. + /// Lists the repositories Dependabot can access in an organization /// + /// Lists repositories that organization admins have allowed Dependabot to access when updating dependencies. /// > [!NOTE] /// > This operation supports both server-to-server and user-to-server access. /// Unauthorized users will not see the existence of this endpoint. @@ -283,7 +287,9 @@ extension APIProtocol { headers: headers )) } - /// Updates repositories to the list of repositories that organization admins have allowed Dependabot to access when updating dependencies. + /// Updates Dependabot's repository access list for an organization + /// + /// Updates repositories according to the list of repositories that organization admins have given Dependabot access to when they've updated dependencies. /// /// > [!NOTE] /// > This operation supports both server-to-server and user-to-server access. @@ -312,14 +318,14 @@ extension APIProtocol { } /// Set the default repository access level for Dependabot /// - /// > [!NOTE] - /// > This operation supports both server-to-server and user-to-server access. /// Sets the default level of repository access Dependabot will have while performing an update. Available values are: /// - 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories. /// - 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories. /// /// Unauthorized users will not see the existence of this endpoint. /// + /// This operation supports both server-to-server and user-to-server access. + /// /// - Remark: HTTP `PUT /organizations/{org}/dependabot/repository-access/default-level`. /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level)`. public func dependabotSetRepositoryAccessDefaultLevel( @@ -4915,8 +4921,9 @@ public enum Operations { } } } - /// Lists repositories that organization admins have allowed Dependabot to access when updating dependencies. + /// Lists the repositories Dependabot can access in an organization /// + /// Lists repositories that organization admins have allowed Dependabot to access when updating dependencies. /// > [!NOTE] /// > This operation supports both server-to-server and user-to-server access. /// Unauthorized users will not see the existence of this endpoint. @@ -5122,7 +5129,9 @@ public enum Operations { } } } - /// Updates repositories to the list of repositories that organization admins have allowed Dependabot to access when updating dependencies. + /// Updates Dependabot's repository access list for an organization + /// + /// Updates repositories according to the list of repositories that organization admins have given Dependabot access to when they've updated dependencies. /// /// > [!NOTE] /// > This operation supports both server-to-server and user-to-server access. @@ -5332,14 +5341,14 @@ public enum Operations { } /// Set the default repository access level for Dependabot /// - /// > [!NOTE] - /// > This operation supports both server-to-server and user-to-server access. /// Sets the default level of repository access Dependabot will have while performing an update. Available values are: /// - 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories. /// - 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories. /// /// Unauthorized users will not see the existence of this endpoint. /// + /// This operation supports both server-to-server and user-to-server access. + /// /// - Remark: HTTP `PUT /organizations/{org}/dependabot/repository-access/default-level`. /// - Remark: Generated from `#/paths//organizations/{org}/dependabot/repository-access/default-level/put(dependabot/set-repository-access-default-level)`. public enum DependabotSetRepositoryAccessDefaultLevel { diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index 102c00290f9..e3ebadc3005 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -562,6 +562,241 @@ public struct Client: APIProtocol { } ) } + /// Delete attestations in bulk + /// + /// Delete artifact attestations in bulk by either subject digests or unique ID. + /// + /// - Remark: HTTP `POST /orgs/{org}/attestations/delete-request`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)`. + public func orgsDeleteAttestationsBulk(_ input: Operations.OrgsDeleteAttestationsBulk.Input) async throws -> Operations.OrgsDeleteAttestationsBulk.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsDeleteAttestationsBulk.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/attestations/delete-request", + 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 200: + return .ok(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete attestations by subject digest + /// + /// Delete an artifact attestation by subject digest. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/digest/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)`. + public func orgsDeleteAttestationsBySubjectDigest(_ input: Operations.OrgsDeleteAttestationsBySubjectDigest.Input) async throws -> Operations.OrgsDeleteAttestationsBySubjectDigest.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsDeleteAttestationsBySubjectDigest.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/attestations/digest/{}", + parameters: [ + input.path.org, + input.path.subjectDigest + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + return .ok(.init()) + case 204: + return .noContent(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Delete attestations by ID + /// + /// Delete an artifact attestation by unique ID that is associated with a repository owned by an org. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/{attestation_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)`. + public func orgsDeleteAttestationsById(_ input: Operations.OrgsDeleteAttestationsById.Input) async throws -> Operations.OrgsDeleteAttestationsById.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsDeleteAttestationsById.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/attestations/{}", + parameters: [ + input.path.org, + input.path.attestationId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + return .ok(.init()) + case 204: + return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// List attestations /// /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index 4ebbd92be72..0fcc943f1a9 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -77,6 +77,27 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `POST /orgs/{org}/attestations/bulk-list`. /// - Remark: Generated from `#/paths//orgs/{org}/attestations/bulk-list/post(orgs/list-attestations-bulk)`. func orgsListAttestationsBulk(_ input: Operations.OrgsListAttestationsBulk.Input) async throws -> Operations.OrgsListAttestationsBulk.Output + /// Delete attestations in bulk + /// + /// Delete artifact attestations in bulk by either subject digests or unique ID. + /// + /// - Remark: HTTP `POST /orgs/{org}/attestations/delete-request`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)`. + func orgsDeleteAttestationsBulk(_ input: Operations.OrgsDeleteAttestationsBulk.Input) async throws -> Operations.OrgsDeleteAttestationsBulk.Output + /// Delete attestations by subject digest + /// + /// Delete an artifact attestation by subject digest. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/digest/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)`. + func orgsDeleteAttestationsBySubjectDigest(_ input: Operations.OrgsDeleteAttestationsBySubjectDigest.Input) async throws -> Operations.OrgsDeleteAttestationsBySubjectDigest.Output + /// Delete attestations by ID + /// + /// Delete an artifact attestation by unique ID that is associated with a repository owned by an org. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/{attestation_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)`. + func orgsDeleteAttestationsById(_ input: Operations.OrgsDeleteAttestationsById.Input) async throws -> Operations.OrgsDeleteAttestationsById.Output /// List attestations /// /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. @@ -997,6 +1018,53 @@ extension APIProtocol { body: body )) } + /// Delete attestations in bulk + /// + /// Delete artifact attestations in bulk by either subject digests or unique ID. + /// + /// - Remark: HTTP `POST /orgs/{org}/attestations/delete-request`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)`. + public func orgsDeleteAttestationsBulk( + path: Operations.OrgsDeleteAttestationsBulk.Input.Path, + headers: Operations.OrgsDeleteAttestationsBulk.Input.Headers = .init(), + body: Operations.OrgsDeleteAttestationsBulk.Input.Body + ) async throws -> Operations.OrgsDeleteAttestationsBulk.Output { + try await orgsDeleteAttestationsBulk(Operations.OrgsDeleteAttestationsBulk.Input( + path: path, + headers: headers, + body: body + )) + } + /// Delete attestations by subject digest + /// + /// Delete an artifact attestation by subject digest. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/digest/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)`. + public func orgsDeleteAttestationsBySubjectDigest( + path: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Path, + headers: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Headers = .init() + ) async throws -> Operations.OrgsDeleteAttestationsBySubjectDigest.Output { + try await orgsDeleteAttestationsBySubjectDigest(Operations.OrgsDeleteAttestationsBySubjectDigest.Input( + path: path, + headers: headers + )) + } + /// Delete attestations by ID + /// + /// Delete an artifact attestation by unique ID that is associated with a repository owned by an org. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/{attestation_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)`. + public func orgsDeleteAttestationsById( + path: Operations.OrgsDeleteAttestationsById.Input.Path, + headers: Operations.OrgsDeleteAttestationsById.Input.Headers = .init() + ) async throws -> Operations.OrgsDeleteAttestationsById.Output { + try await orgsDeleteAttestationsById(Operations.OrgsDeleteAttestationsById.Input( + path: path, + headers: headers + )) + } /// List attestations /// /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. @@ -10324,6 +10392,614 @@ public enum Operations { } } } + /// Delete attestations in bulk + /// + /// Delete artifact attestations in bulk by either subject digests or unique ID. + /// + /// - Remark: HTTP `POST /orgs/{org}/attestations/delete-request`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)`. + public enum OrgsDeleteAttestationsBulk { + public static let id: Swift.String = "orgs/delete-attestations-bulk" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.OrgsDeleteAttestationsBulk.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsDeleteAttestationsBulk.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// The request body must include either `subject_digests` or `attestation_ids`, but not both. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json`. + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// List of subject digests associated with the artifact attestations to delete. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case1/subject_digests`. + public var subjectDigests: [Swift.String] + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - subjectDigests: List of subject digests associated with the artifact attestations to delete. + public init(subjectDigests: [Swift.String]) { + self.subjectDigests = subjectDigests + } + public enum CodingKeys: String, CodingKey { + case subjectDigests = "subject_digests" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case1`. + case case1(Operations.OrgsDeleteAttestationsBulk.Input.Body.JsonPayload.Case1Payload) + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// List of unique IDs associated with the artifact attestations to delete. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case2/attestation_ids`. + public var attestationIds: [Swift.Int] + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - attestationIds: List of unique IDs associated with the artifact attestations to delete. + public init(attestationIds: [Swift.Int]) { + self.attestationIds = attestationIds + } + public enum CodingKeys: String, CodingKey { + case attestationIds = "attestation_ids" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/json/case2`. + case case2(Operations.OrgsDeleteAttestationsBulk.Input.Body.JsonPayload.Case2Payload) + public init(from decoder: any Decoder) throws { + var errors: [any Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/delete-request/POST/requestBody/content/application\/json`. + case json(Operations.OrgsDeleteAttestationsBulk.Input.Body.JsonPayload) + } + public var body: Operations.OrgsDeleteAttestationsBulk.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.OrgsDeleteAttestationsBulk.Input.Path, + headers: Operations.OrgsDeleteAttestationsBulk.Input.Headers = .init(), + body: Operations.OrgsDeleteAttestationsBulk.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// Creates a new `Ok`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsDeleteAttestationsBulk.Output.Ok) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)/responses/200`. + /// + /// HTTP response code: `200 ok`. + public static var ok: Self { + .ok(.init()) + } + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsDeleteAttestationsBulk.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/delete-request/post(orgs/delete-attestations-bulk)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete attestations by subject digest + /// + /// Delete an artifact attestation by subject digest. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/digest/{subject_digest}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)`. + public enum OrgsDeleteAttestationsBySubjectDigest { + public static let id: Swift.String = "orgs/delete-attestations-by-subject-digest" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// Subject Digest + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/DELETE/path/subject_digest`. + public var subjectDigest: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - subjectDigest: Subject Digest + public init( + org: Components.Parameters.Org, + subjectDigest: Swift.String + ) { + self.org = org + self.subjectDigest = subjectDigest + } + } + public var path: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/digest/{subject_digest}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Path, + headers: Operations.OrgsDeleteAttestationsBySubjectDigest.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// Creates a new `Ok`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsDeleteAttestationsBySubjectDigest.Output.Ok) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/200`. + /// + /// HTTP response code: `200 ok`. + public static var ok: Self { + .ok(.init()) + } + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsDeleteAttestationsBySubjectDigest.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsDeleteAttestationsBySubjectDigest.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsDeleteAttestationsBySubjectDigest.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/digest/{subject_digest}/delete(orgs/delete-attestations-by-subject-digest)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Delete attestations by ID + /// + /// Delete an artifact attestation by unique ID that is associated with a repository owned by an org. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/attestations/{attestation_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)`. + public enum OrgsDeleteAttestationsById { + public static let id: Swift.String = "orgs/delete-attestations-by-id" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_id}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// Attestation ID + /// + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_id}/DELETE/path/attestation_id`. + public var attestationId: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - attestationId: Attestation ID + public init( + org: Components.Parameters.Org, + attestationId: Swift.Int + ) { + self.org = org + self.attestationId = attestationId + } + } + public var path: Operations.OrgsDeleteAttestationsById.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/attestations/{attestation_id}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsDeleteAttestationsById.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.OrgsDeleteAttestationsById.Input.Path, + headers: Operations.OrgsDeleteAttestationsById.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// Creates a new `Ok`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsDeleteAttestationsById.Output.Ok) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/200`. + /// + /// HTTP response code: `200 ok`. + public static var ok: Self { + .ok(.init()) + } + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsDeleteAttestationsById.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.OrgsDeleteAttestationsById.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.OrgsDeleteAttestationsById.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/attestations/{attestation_id}/delete(orgs/delete-attestations-by-id)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// List attestations /// /// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization. diff --git a/Sources/private-registries/Types.swift b/Sources/private-registries/Types.swift index 6dc8524a06e..56467dc3c28 100644 --- a/Sources/private-registries/Types.swift +++ b/Sources/private-registries/Types.swift @@ -1035,6 +1035,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/registry_type`. public var registryType: Operations.PrivateRegistriesCreateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload + /// The URL of the private registry. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/url`. + public var url: Swift.String /// The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/username`. @@ -1067,6 +1071,7 @@ public enum Operations { /// /// - Parameters: /// - registryType: The registry type. + /// - url: The URL of the private registry. /// - username: The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. /// - encryptedValue: The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. /// - keyId: The ID of the key you used to encrypt the secret. @@ -1074,6 +1079,7 @@ public enum Operations { /// - selectedRepositoryIds: An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. You can manage the list of selected repositories using the [Update a private registry for an organization](https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization) endpoint. This field should be omitted if `visibility` is set to `all` or `private`. public init( registryType: Operations.PrivateRegistriesCreateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload, + url: Swift.String, username: Swift.String? = nil, encryptedValue: Swift.String, keyId: Swift.String, @@ -1081,6 +1087,7 @@ public enum Operations { selectedRepositoryIds: [Swift.Int]? = nil ) { self.registryType = registryType + self.url = url self.username = username self.encryptedValue = encryptedValue self.keyId = keyId @@ -1089,6 +1096,7 @@ public enum Operations { } public enum CodingKeys: String, CodingKey { case registryType = "registry_type" + case url case username case encryptedValue = "encrypted_value" case keyId = "key_id" @@ -1680,6 +1688,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/registry_type`. public var registryType: Operations.PrivateRegistriesUpdateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload? + /// The URL of the private registry. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/url`. + public var url: Swift.String? /// The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/username`. @@ -1712,6 +1724,7 @@ public enum Operations { /// /// - Parameters: /// - registryType: The registry type. + /// - url: The URL of the private registry. /// - username: The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. /// - encryptedValue: The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. /// - keyId: The ID of the key you used to encrypt the secret. @@ -1719,6 +1732,7 @@ public enum Operations { /// - selectedRepositoryIds: An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. This field should be omitted if `visibility` is set to `all` or `private`. public init( registryType: Operations.PrivateRegistriesUpdateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload? = nil, + url: Swift.String? = nil, username: Swift.String? = nil, encryptedValue: Swift.String? = nil, keyId: Swift.String? = nil, @@ -1726,6 +1740,7 @@ public enum Operations { selectedRepositoryIds: [Swift.Int]? = nil ) { self.registryType = registryType + self.url = url self.username = username self.encryptedValue = encryptedValue self.keyId = keyId @@ -1734,6 +1749,7 @@ public enum Operations { } public enum CodingKeys: String, CodingKey { case registryType = "registry_type" + case url case username case encryptedValue = "encrypted_value" case keyId = "key_id" diff --git a/Sources/rate-limit/Client.swift b/Sources/rate-limit/Client.swift index c0eb8031643..d6aa4ad18c8 100644 --- a/Sources/rate-limit/Client.swift +++ b/Sources/rate-limit/Client.swift @@ -50,6 +50,7 @@ public struct Client: APIProtocol { /// * The `graphql` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/graphql/overview/resource-limitations#rate-limit)." /// * The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)." /// * The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." + /// * The `dependency_sbom` object provides your rate limit status for requesting SBOMs from the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." /// * The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)." /// * The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)." /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." diff --git a/Sources/rate-limit/Types.swift b/Sources/rate-limit/Types.swift index a4217bf4a7d..d1983645195 100644 --- a/Sources/rate-limit/Types.swift +++ b/Sources/rate-limit/Types.swift @@ -23,6 +23,7 @@ public protocol APIProtocol: Sendable { /// * The `graphql` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/graphql/overview/resource-limitations#rate-limit)." /// * The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)." /// * The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." + /// * The `dependency_sbom` object provides your rate limit status for requesting SBOMs from the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." /// * The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)." /// * The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)." /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." @@ -49,6 +50,7 @@ extension APIProtocol { /// * The `graphql` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/graphql/overview/resource-limitations#rate-limit)." /// * The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)." /// * The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." + /// * The `dependency_sbom` object provides your rate limit status for requesting SBOMs from the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." /// * The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)." /// * The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)." /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." @@ -184,6 +186,8 @@ public enum Components { public var scim: Components.Schemas.RateLimit? /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources/dependency_snapshots`. public var dependencySnapshots: Components.Schemas.RateLimit? + /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources/dependency_sbom`. + public var dependencySbom: Components.Schemas.RateLimit? /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources/code_scanning_autofix`. public var codeScanningAutofix: Components.Schemas.RateLimit? /// Creates a new `ResourcesPayload`. @@ -199,6 +203,7 @@ public enum Components { /// - actionsRunnerRegistration: /// - scim: /// - dependencySnapshots: + /// - dependencySbom: /// - codeScanningAutofix: public init( core: Components.Schemas.RateLimit, @@ -211,6 +216,7 @@ public enum Components { actionsRunnerRegistration: Components.Schemas.RateLimit? = nil, scim: Components.Schemas.RateLimit? = nil, dependencySnapshots: Components.Schemas.RateLimit? = nil, + dependencySbom: Components.Schemas.RateLimit? = nil, codeScanningAutofix: Components.Schemas.RateLimit? = nil ) { self.core = core @@ -223,6 +229,7 @@ public enum Components { self.actionsRunnerRegistration = actionsRunnerRegistration self.scim = scim self.dependencySnapshots = dependencySnapshots + self.dependencySbom = dependencySbom self.codeScanningAutofix = codeScanningAutofix } public enum CodingKeys: String, CodingKey { @@ -236,6 +243,7 @@ public enum Components { case actionsRunnerRegistration = "actions_runner_registration" case scim case dependencySnapshots = "dependency_snapshots" + case dependencySbom = "dependency_sbom" case codeScanningAutofix = "code_scanning_autofix" } } @@ -325,6 +333,7 @@ public enum Operations { /// * The `graphql` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/graphql/overview/resource-limitations#rate-limit)." /// * The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)." /// * The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." + /// * The `dependency_sbom` object provides your rate limit status for requesting SBOMs from the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." /// * The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)." /// * The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)." /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." diff --git a/Sources/users/Client.swift b/Sources/users/Client.swift index 4b7df52b88b..ae1f6a4bcfc 100644 --- a/Sources/users/Client.swift +++ b/Sources/users/Client.swift @@ -4656,6 +4656,104 @@ public struct Client: APIProtocol { } ) } + /// List attestations by bulk subject digests + /// + /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by a user. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /users/{username}/attestations/bulk-list`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/bulk-list/post(users/list-attestations-bulk)`. + public func usersListAttestationsBulk(_ input: Operations.UsersListAttestationsBulk.Input) async throws -> Operations.UsersListAttestationsBulk.Output { + try await client.send( + input: input, + forOperation: Operations.UsersListAttestationsBulk.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/users/{}/attestations/bulk-list", + parameters: [ + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.UsersListAttestationsBulk.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Delete attestations in bulk /// /// Delete artifact attestations in bulk by either subject digests or unique ID. diff --git a/Sources/users/Types.swift b/Sources/users/Types.swift index 382767aa346..f37397da92c 100644 --- a/Sources/users/Types.swift +++ b/Sources/users/Types.swift @@ -300,6 +300,17 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /users/{username}`. /// - Remark: Generated from `#/paths//users/{username}/get(users/get-by-username)`. func usersGetByUsername(_ input: Operations.UsersGetByUsername.Input) async throws -> Operations.UsersGetByUsername.Output + /// List attestations by bulk subject digests + /// + /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by a user. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /users/{username}/attestations/bulk-list`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/bulk-list/post(users/list-attestations-bulk)`. + func usersListAttestationsBulk(_ input: Operations.UsersListAttestationsBulk.Input) async throws -> Operations.UsersListAttestationsBulk.Output /// Delete attestations in bulk /// /// Delete artifact attestations in bulk by either subject digests or unique ID. @@ -951,6 +962,29 @@ extension APIProtocol { headers: headers )) } + /// List attestations by bulk subject digests + /// + /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by a user. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /users/{username}/attestations/bulk-list`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/bulk-list/post(users/list-attestations-bulk)`. + public func usersListAttestationsBulk( + path: Operations.UsersListAttestationsBulk.Input.Path, + query: Operations.UsersListAttestationsBulk.Input.Query = .init(), + headers: Operations.UsersListAttestationsBulk.Input.Headers = .init(), + body: Operations.UsersListAttestationsBulk.Input.Body + ) async throws -> Operations.UsersListAttestationsBulk.Output { + try await usersListAttestationsBulk(Operations.UsersListAttestationsBulk.Input( + path: path, + query: query, + headers: headers, + body: body + )) + } /// Delete attestations in bulk /// /// Delete artifact attestations in bulk by either subject digests or unique ID. @@ -2746,21 +2780,27 @@ public enum Components { public var id: Swift.Int /// - Remark: Generated from `#/components/schemas/key-simple/key`. public var key: Swift.String + /// - Remark: Generated from `#/components/schemas/key-simple/created_at`. + public var createdAt: Foundation.Date? /// Creates a new `KeySimple`. /// /// - Parameters: /// - id: /// - key: + /// - createdAt: public init( id: Swift.Int, - key: Swift.String + key: Swift.String, + createdAt: Foundation.Date? = nil ) { self.id = id self.key = key + self.createdAt = createdAt } public enum CodingKeys: String, CodingKey { case id case key + case createdAt = "created_at" } } } @@ -11353,6 +11393,405 @@ public enum Operations { } } } + /// List attestations by bulk subject digests + /// + /// List a collection of artifact attestations associated with any entry in a list of subject digests owned by a user. + /// + /// The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required. + /// + /// **Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds). + /// + /// - Remark: HTTP `POST /users/{username}/attestations/bulk-list`. + /// - Remark: Generated from `#/paths//users/{username}/attestations/bulk-list/post(users/list-attestations-bulk)`. + public enum UsersListAttestationsBulk { + public static let id: Swift.String = "users/list-attestations-bulk" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/path`. + public struct Path: Sendable, Hashable { + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/path/username`. + public var username: Components.Parameters.Username + /// Creates a new `Path`. + /// + /// - Parameters: + /// - username: The handle for the GitHub user account. + public init(username: Components.Parameters.Username) { + self.username = username + } + } + public var path: Operations.UsersListAttestationsBulk.Input.Path + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/query/before`. + public var before: Components.Parameters.PaginationBefore? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/query/after`. + public var after: Components.Parameters.PaginationAfter? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.PaginationBefore? = nil, + after: Components.Parameters.PaginationAfter? = nil + ) { + self.perPage = perPage + self.before = before + self.after = after + } + } + public var query: Operations.UsersListAttestationsBulk.Input.Query + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.UsersListAttestationsBulk.Input.Headers + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// List of subject digests to fetch attestations for. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/requestBody/json/subject_digests`. + public var subjectDigests: [Swift.String] + /// Optional filter for fetching attestations with a given predicate type. + /// This option accepts `provenance`, `sbom`, or freeform text for custom predicate types. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/requestBody/json/predicate_type`. + public var predicateType: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - subjectDigests: List of subject digests to fetch attestations for. + /// - predicateType: Optional filter for fetching attestations with a given predicate type. + public init( + subjectDigests: [Swift.String], + predicateType: Swift.String? = nil + ) { + self.subjectDigests = subjectDigests + self.predicateType = predicateType + } + public enum CodingKeys: String, CodingKey { + case subjectDigests = "subject_digests" + case predicateType = "predicate_type" + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/requestBody/content/application\/json`. + case json(Operations.UsersListAttestationsBulk.Input.Body.JsonPayload) + } + public var body: Operations.UsersListAttestationsBulk.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + /// - body: + public init( + path: Operations.UsersListAttestationsBulk.Input.Path, + query: Operations.UsersListAttestationsBulk.Input.Query = .init(), + headers: Operations.UsersListAttestationsBulk.Input.Headers = .init(), + body: Operations.UsersListAttestationsBulk.Input.Body + ) { + self.path = path + self.query = query + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Mapping of subject digest to bundles. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests`. + public struct AttestationsSubjectDigestsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload`. + public struct AdditionalPropertiesPayloadPayload: Codable, Hashable, Sendable { + /// The bundle of the attestation. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle`. + public struct BundlePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/mediaType`. + public var mediaType: Swift.String? + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/verificationMaterial`. + public struct VerificationMaterialPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `VerificationMaterialPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/verificationMaterial`. + public var verificationMaterial: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.VerificationMaterialPayload? + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/dsseEnvelope`. + public struct DsseEnvelopePayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `DsseEnvelopePayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle/dsseEnvelope`. + public var dsseEnvelope: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.DsseEnvelopePayload? + /// Creates a new `BundlePayload`. + /// + /// - Parameters: + /// - mediaType: + /// - verificationMaterial: + /// - dsseEnvelope: + public init( + mediaType: Swift.String? = nil, + verificationMaterial: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.VerificationMaterialPayload? = nil, + dsseEnvelope: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload.DsseEnvelopePayload? = nil + ) { + self.mediaType = mediaType + self.verificationMaterial = verificationMaterial + self.dsseEnvelope = dsseEnvelope + } + public enum CodingKeys: String, CodingKey { + case mediaType + case verificationMaterial + case dsseEnvelope + } + } + /// The bundle of the attestation. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle`. + public var bundle: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload? + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/repository_id`. + public var repositoryId: Swift.Int? + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/AdditionalPropertiesPayload/bundle_url`. + public var bundleUrl: Swift.String? + /// Creates a new `AdditionalPropertiesPayloadPayload`. + /// + /// - Parameters: + /// - bundle: The bundle of the attestation. + /// - repositoryId: + /// - bundleUrl: + public init( + bundle: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload.BundlePayload? = nil, + repositoryId: Swift.Int? = nil, + bundleUrl: Swift.String? = nil + ) { + self.bundle = bundle + self.repositoryId = repositoryId + self.bundleUrl = bundleUrl + } + public enum CodingKeys: String, CodingKey { + case bundle + case repositoryId = "repository_id" + case bundleUrl = "bundle_url" + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests/additionalProperties`. + public typealias AdditionalPropertiesPayload = [Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayloadPayload] + /// A container of undocumented properties. + public var additionalProperties: [String: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayload?] + /// Creates a new `AttestationsSubjectDigestsPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: [String: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload.AdditionalPropertiesPayload?] = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Mapping of subject digest to bundles. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/attestations_subject_digests`. + public var attestationsSubjectDigests: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload? + /// Information about the current page. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/page_info`. + public struct PageInfoPayload: Codable, Hashable, Sendable { + /// Indicates whether there is a next page. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/page_info/has_next`. + public var hasNext: Swift.Bool? + /// Indicates whether there is a previous page. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/page_info/has_previous`. + public var hasPrevious: Swift.Bool? + /// The cursor to the next page. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/page_info/next`. + public var next: Swift.String? + /// The cursor to the previous page. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/page_info/previous`. + public var previous: Swift.String? + /// Creates a new `PageInfoPayload`. + /// + /// - Parameters: + /// - hasNext: Indicates whether there is a next page. + /// - hasPrevious: Indicates whether there is a previous page. + /// - next: The cursor to the next page. + /// - previous: The cursor to the previous page. + public init( + hasNext: Swift.Bool? = nil, + hasPrevious: Swift.Bool? = nil, + next: Swift.String? = nil, + previous: Swift.String? = nil + ) { + self.hasNext = hasNext + self.hasPrevious = hasPrevious + self.next = next + self.previous = previous + } + public enum CodingKeys: String, CodingKey { + case hasNext = "has_next" + case hasPrevious = "has_previous" + case next + case previous + } + } + /// Information about the current page. + /// + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/json/page_info`. + public var pageInfo: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.PageInfoPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - attestationsSubjectDigests: Mapping of subject digest to bundles. + /// - pageInfo: Information about the current page. + public init( + attestationsSubjectDigests: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.AttestationsSubjectDigestsPayload? = nil, + pageInfo: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.PageInfoPayload? = nil + ) { + self.attestationsSubjectDigests = attestationsSubjectDigests + self.pageInfo = pageInfo + } + public enum CodingKeys: String, CodingKey { + case attestationsSubjectDigests = "attestations_subject_digests" + case pageInfo = "page_info" + } + } + /// - Remark: Generated from `#/paths/users/{username}/attestations/bulk-list/POST/responses/200/content/application\/json`. + case json(Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.UsersListAttestationsBulk.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.UsersListAttestationsBulk.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//users/{username}/attestations/bulk-list/post(users/list-attestations-bulk)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.UsersListAttestationsBulk.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.UsersListAttestationsBulk.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// Delete attestations in bulk /// /// Delete artifact attestations in bulk by either subject digests or unique ID. diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description deleted file mode 160000 index 23d16a0c080..00000000000 --- a/Submodule/github/rest-api-description +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 23d16a0c0808c8241b1076d63e8d3f2e75cb6632 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy