Skip to content

Commit 83553e1

Browse files
Commit via running ake Sources/orgs
1 parent e320152 commit 83553e1

File tree

2 files changed

+1701
-1281
lines changed

2 files changed

+1701
-1281
lines changed

Sources/orgs/Client.swift

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,96 @@ public struct Client: APIProtocol {
481481
}
482482
)
483483
}
484+
/// List attestations
485+
///
486+
/// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization.
487+
///
488+
/// 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.
489+
///
490+
/// **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).
491+
///
492+
/// - Remark: HTTP `GET /orgs/{org}/attestations/{subject_digest}`.
493+
/// - Remark: Generated from `#/paths//orgs/{org}/attestations/{subject_digest}/get(orgs/list-attestations)`.
494+
public func orgs_sol_list_hyphen_attestations(_ input: Operations.orgs_sol_list_hyphen_attestations.Input) async throws -> Operations.orgs_sol_list_hyphen_attestations.Output {
495+
try await client.send(
496+
input: input,
497+
forOperation: Operations.orgs_sol_list_hyphen_attestations.id,
498+
serializer: { input in
499+
let path = try converter.renderedPath(
500+
template: "/orgs/{}/attestations/{}",
501+
parameters: [
502+
input.path.org,
503+
input.path.subject_digest
504+
]
505+
)
506+
var request: HTTPTypes.HTTPRequest = .init(
507+
soar_path: path,
508+
method: .get
509+
)
510+
suppressMutabilityWarning(&request)
511+
try converter.setQueryItemAsURI(
512+
in: &request,
513+
style: .form,
514+
explode: true,
515+
name: "per_page",
516+
value: input.query.per_page
517+
)
518+
try converter.setQueryItemAsURI(
519+
in: &request,
520+
style: .form,
521+
explode: true,
522+
name: "before",
523+
value: input.query.before
524+
)
525+
try converter.setQueryItemAsURI(
526+
in: &request,
527+
style: .form,
528+
explode: true,
529+
name: "after",
530+
value: input.query.after
531+
)
532+
converter.setAcceptHeader(
533+
in: &request.headerFields,
534+
contentTypes: input.headers.accept
535+
)
536+
return (request, nil)
537+
},
538+
deserializer: { response, responseBody in
539+
switch response.status.code {
540+
case 200:
541+
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
542+
let body: Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body
543+
let chosenContentType = try converter.bestContentType(
544+
received: contentType,
545+
options: [
546+
"application/json"
547+
]
548+
)
549+
switch chosenContentType {
550+
case "application/json":
551+
body = try await converter.getResponseBodyAsJSON(
552+
Operations.orgs_sol_list_hyphen_attestations.Output.Ok.Body.jsonPayload.self,
553+
from: responseBody,
554+
transforming: { value in
555+
.json(value)
556+
}
557+
)
558+
default:
559+
preconditionFailure("bestContentType chose an invalid content type.")
560+
}
561+
return .ok(.init(body: body))
562+
default:
563+
return .undocumented(
564+
statusCode: response.status.code,
565+
.init(
566+
headerFields: response.headerFields,
567+
body: responseBody
568+
)
569+
)
570+
}
571+
}
572+
)
573+
}
484574
/// List users blocked by an organization
485575
///
486576
/// List the users blocked by an organization.

0 commit comments

Comments
 (0)