Skip to content

Commit 444f9f3

Browse files
Commit via running: make Sources/users
1 parent fa8ac2c commit 444f9f3

File tree

2 files changed

+538
-1
lines changed

2 files changed

+538
-1
lines changed

Sources/users/Client.swift

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4656,6 +4656,104 @@ public struct Client: APIProtocol {
46564656
}
46574657
)
46584658
}
4659+
/// List attestations by bulk subject digests
4660+
///
4661+
/// List a collection of artifact attestations associated with any entry in a list of subject digests owned by a user.
4662+
///
4663+
/// 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.
4664+
///
4665+
/// **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).
4666+
///
4667+
/// - Remark: HTTP `POST /users/{username}/attestations/bulk-list`.
4668+
/// - Remark: Generated from `#/paths//users/{username}/attestations/bulk-list/post(users/list-attestations-bulk)`.
4669+
public func usersListAttestationsBulk(_ input: Operations.UsersListAttestationsBulk.Input) async throws -> Operations.UsersListAttestationsBulk.Output {
4670+
try await client.send(
4671+
input: input,
4672+
forOperation: Operations.UsersListAttestationsBulk.id,
4673+
serializer: { input in
4674+
let path = try converter.renderedPath(
4675+
template: "/users/{}/attestations/bulk-list",
4676+
parameters: [
4677+
input.path.username
4678+
]
4679+
)
4680+
var request: HTTPTypes.HTTPRequest = .init(
4681+
soar_path: path,
4682+
method: .post
4683+
)
4684+
suppressMutabilityWarning(&request)
4685+
try converter.setQueryItemAsURI(
4686+
in: &request,
4687+
style: .form,
4688+
explode: true,
4689+
name: "per_page",
4690+
value: input.query.perPage
4691+
)
4692+
try converter.setQueryItemAsURI(
4693+
in: &request,
4694+
style: .form,
4695+
explode: true,
4696+
name: "before",
4697+
value: input.query.before
4698+
)
4699+
try converter.setQueryItemAsURI(
4700+
in: &request,
4701+
style: .form,
4702+
explode: true,
4703+
name: "after",
4704+
value: input.query.after
4705+
)
4706+
converter.setAcceptHeader(
4707+
in: &request.headerFields,
4708+
contentTypes: input.headers.accept
4709+
)
4710+
let body: OpenAPIRuntime.HTTPBody?
4711+
switch input.body {
4712+
case let .json(value):
4713+
body = try converter.setRequiredRequestBodyAsJSON(
4714+
value,
4715+
headerFields: &request.headerFields,
4716+
contentType: "application/json; charset=utf-8"
4717+
)
4718+
}
4719+
return (request, body)
4720+
},
4721+
deserializer: { response, responseBody in
4722+
switch response.status.code {
4723+
case 200:
4724+
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
4725+
let body: Operations.UsersListAttestationsBulk.Output.Ok.Body
4726+
let chosenContentType = try converter.bestContentType(
4727+
received: contentType,
4728+
options: [
4729+
"application/json"
4730+
]
4731+
)
4732+
switch chosenContentType {
4733+
case "application/json":
4734+
body = try await converter.getResponseBodyAsJSON(
4735+
Operations.UsersListAttestationsBulk.Output.Ok.Body.JsonPayload.self,
4736+
from: responseBody,
4737+
transforming: { value in
4738+
.json(value)
4739+
}
4740+
)
4741+
default:
4742+
preconditionFailure("bestContentType chose an invalid content type.")
4743+
}
4744+
return .ok(.init(body: body))
4745+
default:
4746+
return .undocumented(
4747+
statusCode: response.status.code,
4748+
.init(
4749+
headerFields: response.headerFields,
4750+
body: responseBody
4751+
)
4752+
)
4753+
}
4754+
}
4755+
)
4756+
}
46594757
/// Delete attestations in bulk
46604758
///
46614759
/// Delete artifact attestations in bulk by either subject digests or unique ID.

0 commit comments

Comments
 (0)