@@ -4656,6 +4656,241 @@ public struct Client: APIProtocol {
4656
4656
}
4657
4657
)
4658
4658
}
4659
+ /// Delete attestations in bulk
4660
+ ///
4661
+ /// Delete artifact attestations in bulk by either subject digests or unique ID.
4662
+ ///
4663
+ /// - Remark: HTTP `POST /users/{username}/attestations/delete-request`.
4664
+ /// - Remark: Generated from `#/paths//users/{username}/attestations/delete-request/post(users/delete-attestations-bulk)`.
4665
+ public func usersDeleteAttestationsBulk( _ input: Operations . UsersDeleteAttestationsBulk . Input ) async throws -> Operations . UsersDeleteAttestationsBulk . Output {
4666
+ try await client. send (
4667
+ input: input,
4668
+ forOperation: Operations . UsersDeleteAttestationsBulk. id,
4669
+ serializer: { input in
4670
+ let path = try converter. renderedPath (
4671
+ template: " /users/{}/attestations/delete-request " ,
4672
+ parameters: [
4673
+ input. path. username
4674
+ ]
4675
+ )
4676
+ var request : HTTPTypes . HTTPRequest = . init(
4677
+ soar_path: path,
4678
+ method: . post
4679
+ )
4680
+ suppressMutabilityWarning ( & request)
4681
+ converter. setAcceptHeader (
4682
+ in: & request. headerFields,
4683
+ contentTypes: input. headers. accept
4684
+ )
4685
+ let body : OpenAPIRuntime . HTTPBody ?
4686
+ switch input. body {
4687
+ case let . json( value) :
4688
+ body = try converter. setRequiredRequestBodyAsJSON (
4689
+ value,
4690
+ headerFields: & request. headerFields,
4691
+ contentType: " application/json; charset=utf-8 "
4692
+ )
4693
+ }
4694
+ return ( request, body)
4695
+ } ,
4696
+ deserializer: { response, responseBody in
4697
+ switch response. status. code {
4698
+ case 200 :
4699
+ return . ok( . init( ) )
4700
+ case 404 :
4701
+ let contentType = converter. extractContentTypeIfPresent ( in: response. headerFields)
4702
+ let body : Components . Responses . NotFound . Body
4703
+ let chosenContentType = try converter. bestContentType (
4704
+ received: contentType,
4705
+ options: [
4706
+ " application/json "
4707
+ ]
4708
+ )
4709
+ switch chosenContentType {
4710
+ case " application/json " :
4711
+ body = try await converter. getResponseBodyAsJSON (
4712
+ Components . Schemas. BasicError. self,
4713
+ from: responseBody,
4714
+ transforming: { value in
4715
+ . json( value)
4716
+ }
4717
+ )
4718
+ default :
4719
+ preconditionFailure ( " bestContentType chose an invalid content type. " )
4720
+ }
4721
+ return . notFound( . init( body: body) )
4722
+ default :
4723
+ return . undocumented(
4724
+ statusCode: response. status. code,
4725
+ . init(
4726
+ headerFields: response. headerFields,
4727
+ body: responseBody
4728
+ )
4729
+ )
4730
+ }
4731
+ }
4732
+ )
4733
+ }
4734
+ /// Delete attestations by subject digest
4735
+ ///
4736
+ /// Delete an artifact attestation by subject digest.
4737
+ ///
4738
+ /// - Remark: HTTP `DELETE /users/{username}/attestations/digest/{subject_digest}`.
4739
+ /// - Remark: Generated from `#/paths//users/{username}/attestations/digest/{subject_digest}/delete(users/delete-attestations-by-subject-digest)`.
4740
+ public func usersDeleteAttestationsBySubjectDigest( _ input: Operations . UsersDeleteAttestationsBySubjectDigest . Input ) async throws -> Operations . UsersDeleteAttestationsBySubjectDigest . Output {
4741
+ try await client. send (
4742
+ input: input,
4743
+ forOperation: Operations . UsersDeleteAttestationsBySubjectDigest. id,
4744
+ serializer: { input in
4745
+ let path = try converter. renderedPath (
4746
+ template: " /users/{}/attestations/digest/{} " ,
4747
+ parameters: [
4748
+ input. path. username,
4749
+ input. path. subjectDigest
4750
+ ]
4751
+ )
4752
+ var request : HTTPTypes . HTTPRequest = . init(
4753
+ soar_path: path,
4754
+ method: . delete
4755
+ )
4756
+ suppressMutabilityWarning ( & request)
4757
+ converter. setAcceptHeader (
4758
+ in: & request. headerFields,
4759
+ contentTypes: input. headers. accept
4760
+ )
4761
+ return ( request, nil )
4762
+ } ,
4763
+ deserializer: { response, responseBody in
4764
+ switch response. status. code {
4765
+ case 200 :
4766
+ return . ok( . init( ) )
4767
+ case 204 :
4768
+ return . noContent( . init( ) )
4769
+ case 404 :
4770
+ let contentType = converter. extractContentTypeIfPresent ( in: response. headerFields)
4771
+ let body : Components . Responses . NotFound . Body
4772
+ let chosenContentType = try converter. bestContentType (
4773
+ received: contentType,
4774
+ options: [
4775
+ " application/json "
4776
+ ]
4777
+ )
4778
+ switch chosenContentType {
4779
+ case " application/json " :
4780
+ body = try await converter. getResponseBodyAsJSON (
4781
+ Components . Schemas. BasicError. self,
4782
+ from: responseBody,
4783
+ transforming: { value in
4784
+ . json( value)
4785
+ }
4786
+ )
4787
+ default :
4788
+ preconditionFailure ( " bestContentType chose an invalid content type. " )
4789
+ }
4790
+ return . notFound( . init( body: body) )
4791
+ default :
4792
+ return . undocumented(
4793
+ statusCode: response. status. code,
4794
+ . init(
4795
+ headerFields: response. headerFields,
4796
+ body: responseBody
4797
+ )
4798
+ )
4799
+ }
4800
+ }
4801
+ )
4802
+ }
4803
+ /// Delete attestations by ID
4804
+ ///
4805
+ /// Delete an artifact attestation by unique ID that is associated with a repository owned by a user.
4806
+ ///
4807
+ /// - Remark: HTTP `DELETE /users/{username}/attestations/{attestation_id}`.
4808
+ /// - Remark: Generated from `#/paths//users/{username}/attestations/{attestation_id}/delete(users/delete-attestations-by-id)`.
4809
+ public func usersDeleteAttestationsById( _ input: Operations . UsersDeleteAttestationsById . Input ) async throws -> Operations . UsersDeleteAttestationsById . Output {
4810
+ try await client. send (
4811
+ input: input,
4812
+ forOperation: Operations . UsersDeleteAttestationsById. id,
4813
+ serializer: { input in
4814
+ let path = try converter. renderedPath (
4815
+ template: " /users/{}/attestations/{} " ,
4816
+ parameters: [
4817
+ input. path. username,
4818
+ input. path. attestationId
4819
+ ]
4820
+ )
4821
+ var request : HTTPTypes . HTTPRequest = . init(
4822
+ soar_path: path,
4823
+ method: . delete
4824
+ )
4825
+ suppressMutabilityWarning ( & request)
4826
+ converter. setAcceptHeader (
4827
+ in: & request. headerFields,
4828
+ contentTypes: input. headers. accept
4829
+ )
4830
+ return ( request, nil )
4831
+ } ,
4832
+ deserializer: { response, responseBody in
4833
+ switch response. status. code {
4834
+ case 200 :
4835
+ return . ok( . init( ) )
4836
+ case 204 :
4837
+ return . noContent( . init( ) )
4838
+ case 403 :
4839
+ let contentType = converter. extractContentTypeIfPresent ( in: response. headerFields)
4840
+ let body : Components . Responses . Forbidden . Body
4841
+ let chosenContentType = try converter. bestContentType (
4842
+ received: contentType,
4843
+ options: [
4844
+ " application/json "
4845
+ ]
4846
+ )
4847
+ switch chosenContentType {
4848
+ case " application/json " :
4849
+ body = try await converter. getResponseBodyAsJSON (
4850
+ Components . Schemas. BasicError. self,
4851
+ from: responseBody,
4852
+ transforming: { value in
4853
+ . json( value)
4854
+ }
4855
+ )
4856
+ default :
4857
+ preconditionFailure ( " bestContentType chose an invalid content type. " )
4858
+ }
4859
+ return . forbidden( . init( body: body) )
4860
+ case 404 :
4861
+ let contentType = converter. extractContentTypeIfPresent ( in: response. headerFields)
4862
+ let body : Components . Responses . NotFound . Body
4863
+ let chosenContentType = try converter. bestContentType (
4864
+ received: contentType,
4865
+ options: [
4866
+ " application/json "
4867
+ ]
4868
+ )
4869
+ switch chosenContentType {
4870
+ case " application/json " :
4871
+ body = try await converter. getResponseBodyAsJSON (
4872
+ Components . Schemas. BasicError. self,
4873
+ from: responseBody,
4874
+ transforming: { value in
4875
+ . json( value)
4876
+ }
4877
+ )
4878
+ default :
4879
+ preconditionFailure ( " bestContentType chose an invalid content type. " )
4880
+ }
4881
+ return . notFound( . init( body: body) )
4882
+ default :
4883
+ return . undocumented(
4884
+ statusCode: response. status. code,
4885
+ . init(
4886
+ headerFields: response. headerFields,
4887
+ body: responseBody
4888
+ )
4889
+ )
4890
+ }
4891
+ }
4892
+ )
4893
+ }
4659
4894
/// List attestations
4660
4895
///
4661
4896
/// List a collection of artifact attestations with a given subject digest that are associated with repositories owned by a user.
0 commit comments