@@ -8718,6 +8718,340 @@ public struct Client: APIProtocol {
87188718 }
87198719 )
87208720 }
8721+ /// Get immutable releases settings for an organization
8722+ ///
8723+ /// Gets the immutable releases policy for repositories in an organization.
8724+ ///
8725+ /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
8726+ ///
8727+ /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases`.
8728+ /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/get(orgs/get-immutable-releases-settings)`.
8729+ public func orgsGetImmutableReleasesSettings( _ input: Operations . OrgsGetImmutableReleasesSettings . Input ) async throws -> Operations . OrgsGetImmutableReleasesSettings . Output {
8730+ try await client. send (
8731+ input: input,
8732+ forOperation: Operations . OrgsGetImmutableReleasesSettings. id,
8733+ serializer: { input in
8734+ let path = try converter. renderedPath (
8735+ template: " /orgs/{}/settings/immutable-releases " ,
8736+ parameters: [
8737+ input. path. org
8738+ ]
8739+ )
8740+ var request : HTTPTypes . HTTPRequest = . init(
8741+ soar_path: path,
8742+ method: . get
8743+ )
8744+ suppressMutabilityWarning ( & request)
8745+ converter. setAcceptHeader (
8746+ in: & request. headerFields,
8747+ contentTypes: input. headers. accept
8748+ )
8749+ return ( request, nil )
8750+ } ,
8751+ deserializer: { response, responseBody in
8752+ switch response. status. code {
8753+ case 200 :
8754+ let contentType = converter. extractContentTypeIfPresent ( in: response. headerFields)
8755+ let body : Operations . OrgsGetImmutableReleasesSettings . Output . Ok . Body
8756+ let chosenContentType = try converter. bestContentType (
8757+ received: contentType,
8758+ options: [
8759+ " application/json "
8760+ ]
8761+ )
8762+ switch chosenContentType {
8763+ case " application/json " :
8764+ body = try await converter. getResponseBodyAsJSON (
8765+ Components . Schemas. ImmutableReleasesOrganizationSettings. self,
8766+ from: responseBody,
8767+ transforming: { value in
8768+ . json( value)
8769+ }
8770+ )
8771+ default :
8772+ preconditionFailure ( " bestContentType chose an invalid content type. " )
8773+ }
8774+ return . ok( . init( body: body) )
8775+ default :
8776+ return . undocumented(
8777+ statusCode: response. status. code,
8778+ . init(
8779+ headerFields: response. headerFields,
8780+ body: responseBody
8781+ )
8782+ )
8783+ }
8784+ }
8785+ )
8786+ }
8787+ /// Set immutable releases settings for an organization
8788+ ///
8789+ /// Sets the immutable releases policy for repositories in an organization.
8790+ ///
8791+ /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
8792+ ///
8793+ /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases`.
8794+ /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/put(orgs/set-immutable-releases-settings)`.
8795+ public func orgsSetImmutableReleasesSettings( _ input: Operations . OrgsSetImmutableReleasesSettings . Input ) async throws -> Operations . OrgsSetImmutableReleasesSettings . Output {
8796+ try await client. send (
8797+ input: input,
8798+ forOperation: Operations . OrgsSetImmutableReleasesSettings. id,
8799+ serializer: { input in
8800+ let path = try converter. renderedPath (
8801+ template: " /orgs/{}/settings/immutable-releases " ,
8802+ parameters: [
8803+ input. path. org
8804+ ]
8805+ )
8806+ var request : HTTPTypes . HTTPRequest = . init(
8807+ soar_path: path,
8808+ method: . put
8809+ )
8810+ suppressMutabilityWarning ( & request)
8811+ let body : OpenAPIRuntime . HTTPBody ?
8812+ switch input. body {
8813+ case let . json( value) :
8814+ body = try converter. setRequiredRequestBodyAsJSON (
8815+ value,
8816+ headerFields: & request. headerFields,
8817+ contentType: " application/json; charset=utf-8 "
8818+ )
8819+ }
8820+ return ( request, body)
8821+ } ,
8822+ deserializer: { response, responseBody in
8823+ switch response. status. code {
8824+ case 204 :
8825+ return . noContent( . init( ) )
8826+ default :
8827+ return . undocumented(
8828+ statusCode: response. status. code,
8829+ . init(
8830+ headerFields: response. headerFields,
8831+ body: responseBody
8832+ )
8833+ )
8834+ }
8835+ }
8836+ )
8837+ }
8838+ /// List selected repositories for immutable releases enforcement
8839+ ///
8840+ /// List all of the repositories that have been selected for immutable releases enforcement in an organization.
8841+ ///
8842+ /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
8843+ ///
8844+ /// - Remark: HTTP `GET /orgs/{org}/settings/immutable-releases/repositories`.
8845+ /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/get(orgs/get-immutable-releases-settings-repositories)`.
8846+ public func orgsGetImmutableReleasesSettingsRepositories( _ input: Operations . OrgsGetImmutableReleasesSettingsRepositories . Input ) async throws -> Operations . OrgsGetImmutableReleasesSettingsRepositories . Output {
8847+ try await client. send (
8848+ input: input,
8849+ forOperation: Operations . OrgsGetImmutableReleasesSettingsRepositories. id,
8850+ serializer: { input in
8851+ let path = try converter. renderedPath (
8852+ template: " /orgs/{}/settings/immutable-releases/repositories " ,
8853+ parameters: [
8854+ input. path. org
8855+ ]
8856+ )
8857+ var request : HTTPTypes . HTTPRequest = . init(
8858+ soar_path: path,
8859+ method: . get
8860+ )
8861+ suppressMutabilityWarning ( & request)
8862+ try converter. setQueryItemAsURI (
8863+ in: & request,
8864+ style: . form,
8865+ explode: true ,
8866+ name: " page " ,
8867+ value: input. query. page
8868+ )
8869+ try converter. setQueryItemAsURI (
8870+ in: & request,
8871+ style: . form,
8872+ explode: true ,
8873+ name: " per_page " ,
8874+ value: input. query. perPage
8875+ )
8876+ converter. setAcceptHeader (
8877+ in: & request. headerFields,
8878+ contentTypes: input. headers. accept
8879+ )
8880+ return ( request, nil )
8881+ } ,
8882+ deserializer: { response, responseBody in
8883+ switch response. status. code {
8884+ case 200 :
8885+ let contentType = converter. extractContentTypeIfPresent ( in: response. headerFields)
8886+ let body : Operations . OrgsGetImmutableReleasesSettingsRepositories . Output . Ok . Body
8887+ let chosenContentType = try converter. bestContentType (
8888+ received: contentType,
8889+ options: [
8890+ " application/json "
8891+ ]
8892+ )
8893+ switch chosenContentType {
8894+ case " application/json " :
8895+ body = try await converter. getResponseBodyAsJSON (
8896+ Operations . OrgsGetImmutableReleasesSettingsRepositories. Output. Ok. Body. JsonPayload. self,
8897+ from: responseBody,
8898+ transforming: { value in
8899+ . json( value)
8900+ }
8901+ )
8902+ default :
8903+ preconditionFailure ( " bestContentType chose an invalid content type. " )
8904+ }
8905+ return . ok( . init( body: body) )
8906+ default :
8907+ return . undocumented(
8908+ statusCode: response. status. code,
8909+ . init(
8910+ headerFields: response. headerFields,
8911+ body: responseBody
8912+ )
8913+ )
8914+ }
8915+ }
8916+ )
8917+ }
8918+ /// Set selected repositories for immutable releases enforcement
8919+ ///
8920+ /// Replaces all repositories that have been selected for immutable releases enforcement in an organization. To use this endpoint, the organization immutable releases policy for `enforced_repositories` must be configured to `selected`.
8921+ ///
8922+ /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
8923+ ///
8924+ /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories`.
8925+ /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/put(orgs/set-immutable-releases-settings-repositories)`.
8926+ public func orgsSetImmutableReleasesSettingsRepositories( _ input: Operations . OrgsSetImmutableReleasesSettingsRepositories . Input ) async throws -> Operations . OrgsSetImmutableReleasesSettingsRepositories . Output {
8927+ try await client. send (
8928+ input: input,
8929+ forOperation: Operations . OrgsSetImmutableReleasesSettingsRepositories. id,
8930+ serializer: { input in
8931+ let path = try converter. renderedPath (
8932+ template: " /orgs/{}/settings/immutable-releases/repositories " ,
8933+ parameters: [
8934+ input. path. org
8935+ ]
8936+ )
8937+ var request : HTTPTypes . HTTPRequest = . init(
8938+ soar_path: path,
8939+ method: . put
8940+ )
8941+ suppressMutabilityWarning ( & request)
8942+ let body : OpenAPIRuntime . HTTPBody ?
8943+ switch input. body {
8944+ case let . json( value) :
8945+ body = try converter. setRequiredRequestBodyAsJSON (
8946+ value,
8947+ headerFields: & request. headerFields,
8948+ contentType: " application/json; charset=utf-8 "
8949+ )
8950+ }
8951+ return ( request, body)
8952+ } ,
8953+ deserializer: { response, responseBody in
8954+ switch response. status. code {
8955+ case 204 :
8956+ return . noContent( . init( ) )
8957+ default :
8958+ return . undocumented(
8959+ statusCode: response. status. code,
8960+ . init(
8961+ headerFields: response. headerFields,
8962+ body: responseBody
8963+ )
8964+ )
8965+ }
8966+ }
8967+ )
8968+ }
8969+ /// Enable a selected repository for immutable releases in an organization
8970+ ///
8971+ /// Adds a repository to the list of selected repositories that are enforced for immutable releases in an organization. To use this endpoint, the organization immutable releases policy for `enforced_repositories` must be configured to `selected`.
8972+ ///
8973+ /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
8974+ ///
8975+ /// - Remark: HTTP `PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`.
8976+ /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/put(orgs/enable-selected-repository-immutable-releases-organization)`.
8977+ public func orgsEnableSelectedRepositoryImmutableReleasesOrganization( _ input: Operations . OrgsEnableSelectedRepositoryImmutableReleasesOrganization . Input ) async throws -> Operations . OrgsEnableSelectedRepositoryImmutableReleasesOrganization . Output {
8978+ try await client. send (
8979+ input: input,
8980+ forOperation: Operations . OrgsEnableSelectedRepositoryImmutableReleasesOrganization. id,
8981+ serializer: { input in
8982+ let path = try converter. renderedPath (
8983+ template: " /orgs/{}/settings/immutable-releases/repositories/{} " ,
8984+ parameters: [
8985+ input. path. org,
8986+ input. path. repositoryId
8987+ ]
8988+ )
8989+ var request : HTTPTypes . HTTPRequest = . init(
8990+ soar_path: path,
8991+ method: . put
8992+ )
8993+ suppressMutabilityWarning ( & request)
8994+ return ( request, nil )
8995+ } ,
8996+ deserializer: { response, responseBody in
8997+ switch response. status. code {
8998+ case 204 :
8999+ return . noContent( . init( ) )
9000+ default :
9001+ return . undocumented(
9002+ statusCode: response. status. code,
9003+ . init(
9004+ headerFields: response. headerFields,
9005+ body: responseBody
9006+ )
9007+ )
9008+ }
9009+ }
9010+ )
9011+ }
9012+ /// Disable a selected repository for immutable releases in an organization
9013+ ///
9014+ /// Removes a repository from the list of selected repositories that are enforced for immutable releases in an organization. To use this endpoint, the organization immutable releases policy for `enforced_repositories` must be configured to `selected`.
9015+ ///
9016+ /// OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
9017+ ///
9018+ /// - Remark: HTTP `DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}`.
9019+ /// - Remark: Generated from `#/paths//orgs/{org}/settings/immutable-releases/repositories/{repository_id}/delete(orgs/disable-selected-repository-immutable-releases-organization)`.
9020+ public func orgsDisableSelectedRepositoryImmutableReleasesOrganization( _ input: Operations . OrgsDisableSelectedRepositoryImmutableReleasesOrganization . Input ) async throws -> Operations . OrgsDisableSelectedRepositoryImmutableReleasesOrganization . Output {
9021+ try await client. send (
9022+ input: input,
9023+ forOperation: Operations . OrgsDisableSelectedRepositoryImmutableReleasesOrganization. id,
9024+ serializer: { input in
9025+ let path = try converter. renderedPath (
9026+ template: " /orgs/{}/settings/immutable-releases/repositories/{} " ,
9027+ parameters: [
9028+ input. path. org,
9029+ input. path. repositoryId
9030+ ]
9031+ )
9032+ var request : HTTPTypes . HTTPRequest = . init(
9033+ soar_path: path,
9034+ method: . delete
9035+ )
9036+ suppressMutabilityWarning ( & request)
9037+ return ( request, nil )
9038+ } ,
9039+ deserializer: { response, responseBody in
9040+ switch response. status. code {
9041+ case 204 :
9042+ return . noContent( . init( ) )
9043+ default :
9044+ return . undocumented(
9045+ statusCode: response. status. code,
9046+ . init(
9047+ headerFields: response. headerFields,
9048+ body: responseBody
9049+ )
9050+ )
9051+ }
9052+ }
9053+ )
9054+ }
87219055 /// Enable or disable a security feature for an organization
87229056 ///
87239057 /// > [!WARNING]
0 commit comments