Skip to content

Commit 5002cdb

Browse files
Commit via running: make Sources/orgs
1 parent 7c8690f commit 5002cdb

File tree

2 files changed

+616
-1
lines changed

2 files changed

+616
-1
lines changed

Sources/orgs/Client.swift

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,104 @@ public struct Client: APIProtocol {
464464
}
465465
)
466466
}
467+
/// List attestations by bulk subject digests
468+
///
469+
/// List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization.
470+
///
471+
/// 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.
472+
///
473+
/// **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).
474+
///
475+
/// - Remark: HTTP `POST /orgs/{org}/attestations/bulk-list`.
476+
/// - Remark: Generated from `#/paths//orgs/{org}/attestations/bulk-list/post(orgs/list-attestations-bulk)`.
477+
public func orgsListAttestationsBulk(_ input: Operations.OrgsListAttestationsBulk.Input) async throws -> Operations.OrgsListAttestationsBulk.Output {
478+
try await client.send(
479+
input: input,
480+
forOperation: Operations.OrgsListAttestationsBulk.id,
481+
serializer: { input in
482+
let path = try converter.renderedPath(
483+
template: "/orgs/{}/attestations/bulk-list",
484+
parameters: [
485+
input.path.org
486+
]
487+
)
488+
var request: HTTPTypes.HTTPRequest = .init(
489+
soar_path: path,
490+
method: .post
491+
)
492+
suppressMutabilityWarning(&request)
493+
try converter.setQueryItemAsURI(
494+
in: &request,
495+
style: .form,
496+
explode: true,
497+
name: "per_page",
498+
value: input.query.perPage
499+
)
500+
try converter.setQueryItemAsURI(
501+
in: &request,
502+
style: .form,
503+
explode: true,
504+
name: "before",
505+
value: input.query.before
506+
)
507+
try converter.setQueryItemAsURI(
508+
in: &request,
509+
style: .form,
510+
explode: true,
511+
name: "after",
512+
value: input.query.after
513+
)
514+
converter.setAcceptHeader(
515+
in: &request.headerFields,
516+
contentTypes: input.headers.accept
517+
)
518+
let body: OpenAPIRuntime.HTTPBody?
519+
switch input.body {
520+
case let .json(value):
521+
body = try converter.setRequiredRequestBodyAsJSON(
522+
value,
523+
headerFields: &request.headerFields,
524+
contentType: "application/json; charset=utf-8"
525+
)
526+
}
527+
return (request, body)
528+
},
529+
deserializer: { response, responseBody in
530+
switch response.status.code {
531+
case 200:
532+
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
533+
let body: Operations.OrgsListAttestationsBulk.Output.Ok.Body
534+
let chosenContentType = try converter.bestContentType(
535+
received: contentType,
536+
options: [
537+
"application/json"
538+
]
539+
)
540+
switch chosenContentType {
541+
case "application/json":
542+
body = try await converter.getResponseBodyAsJSON(
543+
Operations.OrgsListAttestationsBulk.Output.Ok.Body.JsonPayload.self,
544+
from: responseBody,
545+
transforming: { value in
546+
.json(value)
547+
}
548+
)
549+
default:
550+
preconditionFailure("bestContentType chose an invalid content type.")
551+
}
552+
return .ok(.init(body: body))
553+
default:
554+
return .undocumented(
555+
statusCode: response.status.code,
556+
.init(
557+
headerFields: response.headerFields,
558+
body: responseBody
559+
)
560+
)
561+
}
562+
}
563+
)
564+
}
467565
/// List attestations
468566
///
469567
/// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization.

0 commit comments

Comments
 (0)